[BUG] Temp declarations get inserted into literals

Leandro Caniglia caniglia at dm.uba.ar
Mon Jun 21 15:10:44 UTC 1999


When a method begins with a literal expression, the parser fails to insert
the declaration of temporaries in the right place. Here is an example:

1) In a browser add this nonsense method to any class

nonsense
    #(1 1 -1) atRandom > 0 ifTrue: [^nil].
    d _ 'Squeak' atRandom.
    ^ d

2) Try to accept. The parser asks you to declare d as a temp variable.
Accept.

3) The result presents a strange (and working!) insertion of | d | like
this:

nonsense
    #(1 1 -1| d |
) atRandom > 0 ifTrue: [^nil].
    d _ 'Squeak' atRandom.
    ^ d

Leandro





More information about the Squeak-dev mailing list