Skip to content

Commit 720f693

Browse files
authored
Merge pull request #14416 from lovesegfault/fix-lexer-warn
fix(libexpr/lexer): fix flex warning about default rule
2 parents 49084a7 + 8b3af40 commit 720f693

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libexpr/lexer.l

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,14 @@ or { return OR_KW; }
243243
return HPATH;
244244
}
245245

246+
<PATH_START>{ANY} |
247+
<PATH_START><<EOF>> {
248+
/* This should be unreachable: PATH_START is only entered after matching
249+
PATH_SEG or HPATH_START, and we rewind to re-parse those same patterns.
250+
This rule exists to satisfy flex's %option nodefault requirement. */
251+
unreachable();
252+
}
253+
246254
{PATH} {
247255
if (yytext[yyleng-1] == '/')
248256
PUSH_STATE(INPATH_SLASH);

0 commit comments

Comments
 (0)