Support #! as a comment on the first line only.

This commit is contained in:
Christoffer Lerno
2025-09-20 21:10:19 +02:00
parent d3db91536c
commit f5090eb158
2 changed files with 9 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
- Comparing slices and arrays of user-defined types that implement == operator now works #2486.
- Add 'loop-vectorize', 'slp-vectorize', 'unroll-loops' and 'merge-functions' optimization flags #2491.
- Add exec timings to -vv output #2490.
- Support #! as a comment on the first line only.
### Fixes
- Compiler assert with var x @noinit = 0 #2452

View File

@@ -278,6 +278,14 @@ static void skip_whitespace(Lexer *lexer)
case '\r':
// Already filtered out.
UNREACHABLE_VOID
case '#':
if (lexer->file_begin == lexer->current && peek_next(lexer) == '!')
{
skip(lexer, 2);
parse_line_comment(lexer);
continue;
}
return;
default:
return;
}