AST-Core for Pharo and Squeak?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

AST-Core for Pharo and Squeak?

hernanmd
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

Reply | Threaded
Open this post in threaded view
|

Re: AST-Core for Pharo and Squeak?

Lukas Renggli
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 <[hidden email]>:

> 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 <[hidden email]>:

> 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

Reply | Threaded
Open this post in threaded view
|

Re: AST-Core for Pharo and Squeak?

hernanmd
Hi Lukas

2009/12/6 Lukas Renggli <[hidden email]>:
> 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 <[hidden email]>:
>> 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 <[hidden email]>:
>> 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
>
>

Reply | Threaded
Open this post in threaded view
|

Re: AST-Core for Pharo and Squeak?

Lukas Renggli
>> 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

Aha, you are on 3.10?

AST-Core and Refactoring-Core requires a closure image and ByteArrays ...

For 3.9 and 3.10 use the old version from
http://www.squeaksource.com/AST and
http://www.squeaksource.com/RefactoringEngine.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: AST-Core for Pharo and Squeak?

hernanmd
2009/12/6 Lukas Renggli <[hidden email]>:

>>> 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
>
> Aha, you are on 3.10?
>
> AST-Core and Refactoring-Core requires a closure image and ByteArrays ...
>
> For 3.9 and 3.10 use the old version from
> http://www.squeaksource.com/AST and
> http://www.squeaksource.com/RefactoringEngine.
>

That's it, thank you,

Hernán

> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>