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 parser #56

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

Whitespace and comment handling in parser #56

mikeclayton opened this issue Feb 5, 2019 · 0 comments

Comments

@mikeclayton
Copy link
Member

At present, the parser removes all WhitespaceToken and CommentToken elements from the input stream before processing the syntax rules.

            // remove all comments and whitespace
            var tokens = lexerTokens.Where(lt => !(lt is CommentToken) &&
                                                 !(lt is WhitespaceToken)).ToList();

This doesn't generally matter because whitespace is optional between most tokens.

However, should we explicitly check for optional vs mandatory whitespace in the syntax rule methods, or is it ok to just strip it out at source?

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