Yes, because they are wrong. Here is an issue:
https://pharo.fogbugz.com/f/cases/14254/AST-method-replaceWith-does-not-change-source-interval

2014-10-28 13:32 GMT+02:00 Thierry Goubier <thierry.goub...@gmail.com>:

> Le 28/10/2014 12:12, Mark Rizun a écrit :
>
>>     Well, not really.
>>
>>     Technically, tokens are used to drive a parser from a scanner.
>>
>>     If an AST node knows how to relate itself to its original source
>>     code chunk and is able to print itself correctly, then tokens are
>>     redundant.
>>
>>     In short, if you work with parsers, you'd better know what tokens
>>     are. If you're only working with the AST, tokens are redundant and
>>     noise (i.e. they often have a type (or more than one) which is only
>>     understood by the parser).
>>
>>
>> I'm working with ASTs sourceInterval. Trying to calculate it after
>> method replaceWith:.
>> You see, my proble was that each node of AST doesn't hold its start and
>> stop position in same place. So I thought that token is such a place,
>> however, eventually I understood that RBValueNodes don't have tokens:)
>>
>
> Do you mean you're trying to do a replace and update the positions of all
> the nodes ?
>
> Thierry
>
>

Reply via email to