On 09/24/2011 11:27 AM, Holger Hans Peter Freyther wrote:
> 
> when using the STCompiler I end up with a MessageNotUnderstood error:
> 
> STInST.STEvaluationDriver new parseSmalltalk: '[:each :ablock | (each) ifTrue:
> ablock]!' with: STInST.STFileInParser
> 
> 
> In STCompiler>>#compileBoolean: aNode will be '(each) ifTrue:..' the arguments
> is the RBVariableNode and RBVariableNode does not understand arguments/body.
> So somehow the bytecode for STCompiler>>#acceptVariableNode would need to end
> up in bc1 and bc2?

ablock would need to be replaced with [ablock value].  Alternatively, you
can just avoid inlining #ifTrue: in this case:

diff --git a/packages/stinst/parser/STCompiler.st 
b/packages/stinst/parser/STCompiler.st
index 620e019..4235d41 100644
--- a/packages/stinst/parser/STCompiler.st
+++ b/packages/stinst/parser/STCompiler.st
@@ -795,6 +795,7 @@ indexed'' bytecode. The resulting stream is
        | bc1 ret1 bc2 selector |
        aNode arguments do: 
                [:each | 
+               each isBlock ifFalse: [^false].
                (each arguments isEmpty and: [each body temporaries isEmpty]) 
                    ifFalse: [^false].
                bc1 isNil 

Paolo

_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to