[squeak-dev] Parser Pragma Issue and Fix

Eliot Miranda eliot.miranda at gmail.com
Tue Aug 18 15:06:19 UTC 2020


Hi Patrick,

    please push to trunk ASAP.  What a terrible blunder on my part!!

_,,,^..^,,,_ (phone)

> On Aug 17, 2020, at 4:58 AM, Rein, Patrick <Patrick.Rein at hpi.de> wrote:
> 
> Hi everyone,
> 
> while working on a parser framework I recently discovered an issue when parsing the following method:
> 
> someTestMethod
>    '<' first
> 
> This method can not be parsed by the current Squeak parser, as it expects a closing angle bracket after the message send. The parser misinterprets the bracket in the string as the beginning of a pragma. The fault is in the Parser class which did not respect the type of the token to be parsed. The attached changeset is a proposed fix for the fault. It boils down to checking for the #binary token type in the the responsible parser method:
> 
> Parser>>#pragmaSequence
>    "Parse a sequence of method pragmas."
>    
>    [    (hereType == #binary and: [self matchToken: #<])
>            ifFalse: [ ^ self ].
>        self pragmaStatement.
>        (self matchToken: #>)
>            ifFalse: [ ^ self expected: '>' ] ] repeat
> 
> As this is somewhat of a fundamental change, I wanted to bring this up for discussion before merging it.
> 
> Thanks and best wishes,
> Patrick
> <ParserPragmaFix.1.cs>
> 


More information about the Squeak-dev mailing list