-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-line comments should be (#664)
* Add a broken nesting example * Add some comment examples * Multi-line comments should be RE2 `.` does not match newlines by default. This allows newlines inside multi-line comments.
- Loading branch information
Showing
14 changed files
with
107 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Comment | ||
|
||
// Comment /* with nested comment */ | ||
|
||
// Comment with "quotes" | ||
|
||
// Comment with "quotes /* and nested comment */" | ||
|
||
// Comment with "quotes /* and nested comment */" and more text | ||
|
||
/* Single-line comment */ | ||
/**/ | ||
/* Single-line comment with /*Nested comment*/ */ | ||
|
||
/* Multi-line | ||
comment */ | ||
/* | ||
|
||
*/ | ||
/* Multi-line | ||
comment /* with nested comment */ | ||
*/ | ||
|
||
|
||
// /* Comment opening inside comment ignored | ||
|
||
/* // line comment inside comment ignored */ | ||
|
||
// Interaction with strings: | ||
let a = "// not a comment!" | ||
|
||
let b = "/* not a comment start" | ||
|
||
let c = "not a comment end */" | ||
|
||
/* Quotes don't affect the nesting. "/*" */ */ | ||
|
||
// Comment doesn't need a new line to terminate it |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* Nested comments /* like this need well bracketed termination */ |
9 changes: 9 additions & 0 deletions
9
testsuite/verona_nostdlib/spec/comments_broken_nest_out/00_parse.trieste
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Verona | ||
parse | ||
(top | ||
{} | ||
(file | ||
(group | ||
(error | ||
(errormsg 33:Unterminated comment starting at ) | ||
(errorast))))) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Verona | ||
parse | ||
(top | ||
{} | ||
(file | ||
(group | ||
(error | ||
(errormsg 33:Unterminated comment starting at ) | ||
(errorast))))) |
1 change: 1 addition & 0 deletions
1
testsuite/verona_nostdlib/spec/comments_broken_nest_out/exit_code.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
Empty file.
8 changes: 8 additions & 0 deletions
8
testsuite/verona_nostdlib/spec/comments_broken_nest_out/stdout.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Errors: | ||
Unterminated comment starting at | ||
-- comments_broken_nest.verona:1:1 | ||
/* Nested comments /* like this need well bracketed termination */ | ||
~~ | ||
|
||
Pass parse failed with 1 error! | ||
|
23 changes: 23 additions & 0 deletions
23
testsuite/verona_nostdlib/spec/comments_out/00_parse.trieste
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Verona | ||
parse | ||
(top | ||
{} | ||
(file | ||
(equals | ||
(group | ||
(let) | ||
(ident 1:a)) | ||
(group | ||
(escaped 17:// not a comment!))) | ||
(equals | ||
(group | ||
(let) | ||
(ident 1:b)) | ||
(group | ||
(escaped 22:/* not a comment start))) | ||
(equals | ||
(group | ||
(let) | ||
(ident 1:c)) | ||
(group | ||
(escaped 20:not a comment end */))))) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
Empty file.
Empty file.