Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace and comment handling in lexer #55

Open
mikeclayton opened this issue Feb 5, 2019 · 0 comments
Open

Whitespace and comment handling in lexer #55

mikeclayton opened this issue Feb 5, 2019 · 0 comments

Comments

@mikeclayton
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant