-
Notifications
You must be signed in to change notification settings - Fork 16
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
Nolol multiline if's do not allow $ after end #125
Comments
Not really a bug, but rather a consequence of how nolol is structured. A nolol-ast consist of differen things. There are mainly Elements (include, define etc.), NestableElements (if, for) and StatementLines. A line that only contains a $ results in an empty line, by design. The correct way to do what you are trying to is to add the $ either at the end of the last line inside the if-block, or at the beginning of the first (non empty) line after the if-block. If one of that does not work, then it definitely a bug. I cant test this myself right now, but does one of this work for you?
|
if c=="-" then
:a=1
:b=42 $
end
:a=0 As already described in the opening comment the dollar here does nothing.
This version however works! I was not aware that prepending a $ is allowed. |
Ok, then the first one is a bug. I will have to see when I find the time to look into this. |
Feel free to take your time, this is just something I've noticed and don't even have a usecase for it currently :D |
Describe the bug
Nolol multiline if's do not allow $ after end erroring out with
Expected newline. Found Token: '$'(Symbol)
, although it works just fine with single line ifs. This makes it hard to describe behaviour where after a multiline if a line break ($) is required followed by time sensitive code which should execute exactly 1 tick later later. Inserting the $ into a new line after the if inserts an empty line and thus 2 ticks of latency.I my use-case (well known number parser ported to nolol) I can use the workaround described below: a useless statement followed by a $.
Example Code/Screenshots
Platform:
The text was updated successfully, but these errors were encountered: