smalltalk: Clean up grammar and fix a bug with underscores in identifiers.
parent
e49d721374
commit
e4df1c8503
extra/smalltalk/parser
|
@ -298,3 +298,5 @@ test = <foreign parse-smalltalk LocalVariableDeclarationList>
|
|||
{ } [ "class Foo []. Tests blah " parse-smalltalk drop ] unit-test
|
||||
|
||||
{ } [ "vocab:smalltalk/parser/test.st" ascii file-contents parse-smalltalk drop ] unit-test
|
||||
|
||||
{ } [ "_abc_" parse-smalltalk drop ] unit-test
|
||||
|
|
|
@ -16,7 +16,7 @@ ERROR: bad-number str ;
|
|||
EBNF: parse-smalltalk
|
||||
|
||||
Character = .
|
||||
WhitespaceCharacter = (" " | "\t" | "\n" | "\r" )
|
||||
WhitespaceCharacter = [ \t\n\r]
|
||||
DecimalDigit = [0-9]
|
||||
Letter = [A-Za-z]
|
||||
|
||||
|
@ -27,7 +27,7 @@ OptionalWhiteSpace = (WhitespaceCharacter | Comment)*
|
|||
Whitespace = (WhitespaceCharacter | Comment)+
|
||||
|
||||
LetterOrDigit = DecimalDigit | Letter
|
||||
Identifier = (Letter | "_"):h (LetterOrDigit | "_")*:t => [[ { h t } flatten >string ]]
|
||||
Identifier = (Letter | [_]):h (LetterOrDigit | [_])*:t => [[ { h t } flatten >string ]]
|
||||
Reference = Identifier => [[ ast-name boa ]]
|
||||
|
||||
ConstantReference = "nil" => [[ nil ]]
|
||||
|
|
Loading…
Reference in New Issue