Fix glitch with escape \x2d being treated as - in character classes.

Don't treat \x and \u escapes as "unquoted".
This commit is contained in:
Tor Andersson
2025-05-05 13:10:43 +02:00
parent 94ec2f2d7c
commit 4bfb1a2575

View File

@@ -147,7 +147,7 @@ static int nextrune(struct cstate *g)
g->yychar = '0';
return 1;
}
return 0;
return 1;
case 'u':
if (!g->source[0] || !g->source[1] || !g->source[2] || !g->source[3])
die(g, "unterminated escape sequence");
@@ -159,7 +159,7 @@ static int nextrune(struct cstate *g)
g->yychar = '0';
return 1;
}
return 0;
return 1;
case 0:
g->yychar = '0';
return 1;