Closed dogboydog closed 1 year ago
There is a bit more going on here than it first appears, these notes are as much for me to remember so I don't forget as they are to try and explain what is going on.
The missing >>
is actually cascading out and it just keeps gobbling up text until it finds one.
The first example throws a strange error because it never finds the closing >>
and is complaining about that.
The second example "works" purely because the <<wait 1>>
has a >>
that the earlier <<my_command
can use.
So the command on line four spans eight lines and has a lot of parameters which probably isn't desirable.
At this stage I think unfortunately the fix will be to make it so that command text cannot contain newlines and we'll have to capture any rogue new lines/unterminated commands at the parser level instead of just the lexer.
Hopefully not too many people use commands with newlines in them. Never occured to me that would work since you can't split dialogue lines. Thanks for looking into it.
Fixed in 6df2d19be3b38518f4aec25aa572ef7d79e6cc72 by making the lexer detect newlines inside commands. The parser will now emit parse errors when this is detected.
What is the current behavior?
This will cause an error:
Line 4: Unexpected "" while reading a command statement
But this won't
Please provide the steps to reproduce, and if possible a minimal demo of the problem: Run this project https://github.com/dogboydog/YarnSpinnerUnterminatedCommand
What is the expected behavior?
These two should probably be treated the same way (I would think an error for both?)
Please tell us about your environment: