From aace0d316f1a5c2e2b67a623a9897799063eb520 Mon Sep 17 00:00:00 2001 From: FalsePattern Date: Sun, 12 Jan 2025 14:41:22 +0100 Subject: [PATCH] fix: non-terminating lexer rule --- CHANGELOG.md | 4 +++- core/src/main/grammar/Zig.flex | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a95a6aac..2e7913eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,9 @@ Changelog structure reference: ### Fixed -- Zig source file path highlighter made the terminal lag with some files +- Zig + - Source file path highlighter made the terminal lag with some files + - Non-terminating rule in lexer could make the editor hang ## [20.1.1] diff --git a/core/src/main/grammar/Zig.flex b/core/src/main/grammar/Zig.flex index 00af51a9..e2aa8a6d 100644 --- a/core/src/main/grammar/Zig.flex +++ b/core/src/main/grammar/Zig.flex @@ -246,10 +246,10 @@ BUILTINIDENTIFIER="@"[A-Za-z_][A-Za-z0-9_]* <> { yybegin(YYINITIAL); return BAD_SQUOT; } {CRLF} { yybegin(YYINITIAL); return BAD_SQUOT; } - [^\n]* { } + [^\n]+ { } <> { yybegin(YYINITIAL); return BAD_DQUOT; } {CRLF} { yybegin(YYINITIAL); return BAD_DQUOT; } - [^\n]* { } + [^\n]+ { } {WHITE_SPACE} { return WHITE_SPACE; }