diff --git a/extra/smalltalk/parser/parser-tests.factor b/extra/smalltalk/parser/parser-tests.factor index 5fd3d57857..7588dfba24 100644 --- a/extra/smalltalk/parser/parser-tests.factor +++ b/extra/smalltalk/parser/parser-tests.factor @@ -298,3 +298,5 @@ test = { } [ "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 diff --git a/extra/smalltalk/parser/parser.factor b/extra/smalltalk/parser/parser.factor index 6de20afc6d..892f2e4ad8 100644 --- a/extra/smalltalk/parser/parser.factor +++ b/extra/smalltalk/parser/parser.factor @@ -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 ]]