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:
@@ -0,0 +1,5 @@
|
||||
// In middle of line.
|
||||
io.write/* ... */(/* */"ok"/* */) // expect: ok
|
||||
|
||||
// Nested.
|
||||
io.write(/* in /* nest */ out */"ok") // expect: ok
|
||||
@@ -0,0 +1,2 @@
|
||||
io.write("ok") // expect: ok
|
||||
/* comment */
|
||||
@@ -0,0 +1,2 @@
|
||||
io.write("ok") // expect: ok
|
||||
// comment
|
||||
Reference in New Issue
Block a user