feat: add line comment support to lexer with skipLineComment helper
Add a new `skipLineComment` function to the compiler's lexer that consumes characters from the current position until a newline or end-of-file is encountered. Update the `readRawToken` switch case for '/' to detect the "//" sequence and delegate to the new function instead of emitting a TOKEN_SLASH. Also add a line comment to the example hello.wren file to demonstrate the feature.
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
class Foo {
|
||||
class Foo { // line comment
|
||||
bar {
|
||||
123
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user