--- a/Parser.st Thu Feb 07 12:01:36 2019 +0000
+++ b/Parser.st Sat Feb 09 21:55:06 2019 +0000
@@ -2401,14 +2401,22 @@
"Return the parse tree (as instance `MethodNode`).
Note, that #tree return the parse tree as `StatementNode`"
- ^ (MethodNode new
- selector:selector
- arguments:methodArgs
- locals:methodVars
- statements:(tree isNil ifTrue:[#()] ifFalse:[tree asCollectionOfStatements]))
- encoder:self
+ methodNode isNil ifTrue:[
+ (tree notNil and:[tree isMethodNode]) ifTrue:[
+ methodNode := tree.
+ ] ifFalse:[
+ methodNode := MethodNode new
+ selector:selector
+ arguments:methodArgs
+ locals:methodVars
+ statements:(tree isNil ifTrue:[#()] ifFalse:[tree asCollectionOfStatements])
+ ].
+ methodNode encoder:self.
+ ].
+ ^ methodNode
"Created: / 15-07-2018 / 14:48:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 09-02-2019 / 21:42:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
moreSharedPools