Skip to content

Commit 9035f46

Browse files
committed
fix(lexer): handle empty text segments in DevInLexer
Add a check to return TEXT_SEGMENT if the text length is zero, preventing potential errors when processing empty segments
1 parent 17b7200 commit 9035f46

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

exts/devins-lang/src/grammar/DevInLexer.flex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ SHARP=#
110110
}
111111

112112
// get first char, if $, @, /, #, should be a YYUSED
113+
if (text.length() == 0) {
114+
return TEXT_SEGMENT;
115+
}
116+
113117
char first = text.charAt(0);
114118
if (first == '@') {
115119
yypushback(yylength() - 1);

0 commit comments

Comments
 (0)