summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-03 14:56:42 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-03 15:15:54 +0900
commitc990b3c41af5957a739dfb235dfbb821e73a74df (patch)
tree3b238c404c143522973016b03b2e7f4b242c2e46 /parse.y
parent22da5d71eaa50a749f8a08beb9bd6fe59e489449 (diff)
Fix the error token on "invalid hex escape"
* parse.y (tok_hex): flush token after dispatching the "invalid hex escape" parse error.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 58b8714d95..311bbba80b 100644
--- a/parse.y
+++ b/parse.y
@@ -6133,8 +6133,8 @@ tok_hex(struct parser_params *p, size_t *numlen)
c = scan_hex(p->lex.pcur, 2, numlen);
if (!*numlen) {
- p->lex.ptok = p->lex.pcur;
yyerror0("invalid hex escape");
+ token_flush(p);
return 0;
}
p->lex.pcur += *numlen;