mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-07 03:22:23 +08:00
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:
4
regexp.c
4
regexp.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user