Skip to content
Discussion options

You must be logged in to vote

Ok, I see, that makes sense. Well, I guess you won't be able to get around using some whitespace sensitivity. Something like:

VariableDecl: type=TypeRef name=ID ('=' value=Expression)? NEWLINE+; // Expect one or more newlines after the variable declaration
terminal NEWLINE = /\r?\n/;

Note that this has the major drawback of explicitly using the NEWLINE everywhere you expect a newline character to appear, as it is now no longer hidden.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@jindong-zhannng
Comment options

@msujew
Comment options

@jindong-zhannng
Comment options

@msujew
Comment options

Answer selected by jindong-zhannng
@jindong-zhannng
Comment options

@msujew
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants