-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪲 Exclude end blocks from comments (#5409)
Fixes #5395 In a specific case, an end block (`#ENDBLOCK`) is parsed as a comment. This PR excludes end blocks from the definition of comments. Note comments are ignored in the parse tree, while end blocks are not. To ensure we will not leak an end block in an parse error message, I altered the textwithoutspaces to include a potential end block. How to test - Ensure that the following program does not produce an error in level 9 ``` repeat 3 times print 3 repeat 5 times print 5 print 1 ``` - Ensure that the following program does not show an error message which leaks a character from the endblock. It should mention that the unexpected character is a new line and not `#`: ``` for i in range 1 to 10 print i ```
- Loading branch information
1 parent
582b0af
commit 703b8d8
Showing
5 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters