[Pharo-project] AST-Core for Pharo and Squeak?
Hi guys, I've noticed a different behavior relating the RBParseTreeSearcher between Pharo and Squeak, using AST-Core-lr.33, the following code: | rbMethodNode | rbMethodNode := RBParser parseMethod: 'test [ ]'. ( RBParseTreeSearcher new matches: '`{:node | node isVariable }' do:[: aNode : answer | answer add: aNode; yourself ] ) executeTree: rbMethodNode initialAnswer: Set new. gives an empty Set in Pharo-Core (#11072) and a Set(RBSequenceNode()) in Squeak 3.10.2 Does anybody know if I should use a different AST-Core version for Squeak? An alternative repository maybe? Hernán
Did you run the tests, especially RBParserTest? They do all pass on Pharo. Does Squeak implement #isVariable on Object? Lukas 2009/12/6 Hernán Morales Durand <hernan.morales@gmail.com>:
Hi guys, I've noticed a different behavior relating the RBParseTreeSearcher between Pharo and Squeak, using AST-Core-lr.33, the following code:
| rbMethodNode | rbMethodNode := RBParser parseMethod: 'test [ ]'. ( RBParseTreeSearcher new matches: '`{:node | node isVariable }' do:[: aNode : answer | answer add: aNode; yourself ] ) executeTree: rbMethodNode initialAnswer: Set new.
gives an empty Set in Pharo-Core (#11072) and a Set(RBSequenceNode()) in Squeak 3.10.2 Does anybody know if I should use a different AST-Core version for Squeak? An alternative repository maybe?
Hernán
-- Lukas Renggli http://www.lukas-renggli.ch 2009/12/6 Hernán Morales Durand <hernan.morales@gmail.com>:
Hi guys, Â I've noticed a different behavior relating the RBParseTreeSearcher between Pharo and Squeak, using AST-Core-lr.33, the following code:
| rbMethodNode | rbMethodNode := RBParser parseMethod: 'test [  ]'. ( RBParseTreeSearcher new     matches: '`{:node | node isVariable }'     do:[: aNode : answer | answer add: aNode; yourself ] )         executeTree: rbMethodNode initialAnswer: Set new.
gives an empty Set in Pharo-Core (#11072) and  a Set(RBSequenceNode()) in Squeak 3.10.2 Does anybody know if I should use a different AST-Core version for Squeak? An alternative repository maybe?
Hernán
-- Lukas Renggli http://www.lukas-renggli.ch
Hi Lukas 2009/12/6 Lukas Renggli <renggli@gmail.com>:
Did you run the tests, especially RBParserTest? They do all pass on Pharo.
I couldn't do a clean load the Refactoring-Tests package in Squeak 3.10.2, there is a Syntax Error testLiteralArray | tree collection | tree := RBParser parseExpression: '#( a #b #''c'' . + - 1 -2 3.4 #true true #false false #nil nil "comment" ''string'' #[ 1 2 3 ] #(1 2 3))'. collection := OrderedCollection new. collection add: #a; add: #b; add: #c; add: #'.'; add: #+; add: #-; add: 1; add: -2; add: 3.4; add: #true; add: true; add: #false; add: false; add: #nil; add: nil; add: 'string'; add: #[Nothing more expected ->1 2 3]; add: #(1 2 3). tree value with: collection do: [ :token :value | self assert: token value = value ] I removed that one to complete the loading, there are 8 failures and 5 errors, most of them in RBSmallintTest and two in RBParserTest: RBParserTest>>testBestNodeFor RBParserTest>>testIntervals but it seems to be unrelated with the #isVariable problem. In Pharo-Core #11072 I have just one failure in #testRemoveSameMethodButSendsSuper, let me know if you cannot reproduce it.
Does Squeak implement #isVariable on Object?
No, it doesn't at least in the official image. Cheers, Hernán
Lukas
2009/12/6 Hernán Morales Durand <hernan.morales@gmail.com>:
Hi guys, Â I've noticed a different behavior relating the RBParseTreeSearcher between Pharo and Squeak, using AST-Core-lr.33, the following code:
| rbMethodNode | rbMethodNode := RBParser parseMethod: 'test [  ]'. ( RBParseTreeSearcher new     matches: '`{:node | node isVariable }'     do:[: aNode : answer | answer add: aNode; yourself ] )         executeTree: rbMethodNode initialAnswer: Set new.
gives an empty Set in Pharo-Core (#11072) and  a Set(RBSequenceNode()) in Squeak 3.10.2 Does anybody know if I should use a different AST-Core version for Squeak? An alternative repository maybe?
Hernán
-- Lukas Renggli http://www.lukas-renggli.ch
2009/12/6 Hernán Morales Durand <hernan.morales@gmail.com>:
Hi guys, Â I've noticed a different behavior relating the RBParseTreeSearcher between Pharo and Squeak, using AST-Core-lr.33, the following code:
| rbMethodNode | rbMethodNode := RBParser parseMethod: 'test [  ]'. ( RBParseTreeSearcher new     matches: '`{:node | node isVariable }'     do:[: aNode : answer | answer add: aNode; yourself ] )         executeTree: rbMethodNode initialAnswer: Set new.
gives an empty Set in Pharo-Core (#11072) and  a Set(RBSequenceNode()) in Squeak 3.10.2 Does anybody know if I should use a different AST-Core version for Squeak? An alternative repository maybe?
Hernán
-- Lukas Renggli http://www.lukas-renggli.ch
participants (2)
-
Hernán Morales Durand -
Lukas Renggli