feat: add skipBlockComment parser with nesting support and three test cases

Implement a new skipBlockComment function in the compiler that handles nested /* */ block comments by tracking a nesting counter. The parser advances through comment characters, incrementing nesting on opening /* and decrementing on closing */. Also add three test files: comment_block.wren verifying inline and nested block comments, comment_block_at_eof.wren for a block comment at end of file without newline, and comment_line_at_eof.wren for a line comment at end of file without newline.
This commit is contained in:
Bob Nystrom
2013-11-14 01:09:47 +00:00
parent ccbc2f8d4e
commit c55150d9c4
4 changed files with 52 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
// In middle of line.
io.write/* ... */(/* */"ok"/* */) // expect: ok
// Nested.
io.write(/* in /* nest */ out */"ok") // expect: ok
+2
View File
@@ -0,0 +1,2 @@
io.write("ok") // expect: ok
/* comment */
+2
View File
@@ -0,0 +1,2 @@
io.write("ok") // expect: ok
// comment