Kingsland.MofParser icon indicating copy to clipboard operation
Kingsland.MofParser copied to clipboard

Whitespace and comment handling in lexer

Open mikeclayton opened this issue 6 years ago • 0 comments

Whitespace and comments are consumed and emitted by the lexer, but not mandatory between some tokens. This means that, for example, the following text:

12345myIdentifier

gets converted to two valid tokens:

IntegerLiteralToken: 12345
IdentifierToken:     "myIdentifier"

This probably isn't much of a problem as in general sequences of tokens without whitespace between them aren't valid in any parser rules anywhere this could appear anyway, but it would probably be better if the input text failed at the lexer stage rather than the parser when mandatory whitespace is missing.

mikeclayton avatar Feb 05 '19 12:02 mikeclayton