diff --git a/src/scanner.zig b/src/scanner.zig index f2073d1..0cffde2 100644 --- a/src/scanner.zig +++ b/src/scanner.zig @@ -272,6 +272,19 @@ pub const Scanner = struct { // consume comments if (self.match('/')) { while (self.peek() != '\n' and !self.isAtEnd()) { + _ = self.advance(); + } + } else if (self.match('*')) { + // multiline block comments are messier to work with, but + // we can still do it! + while (true) { + if (self.isAtEnd()) break; + // check '*/' + if (self.peek() == '*' and self.peekNext() == '/') { + self.current += 2; + break; + } + _ = self.advance(); } } else {