Skip to content

Commit 2e18159

Browse files
authored
Merge pull request #42 from dylanahsmith/unicode-unescape-fix
Fix bug in unescaping unicode escaped characters
2 parents 07103ef + 41f5b77 commit 2e18159

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lexer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ YY_RULE_SETUP
978978
#line 87 "lexer.lpp"
979979
{
980980
int ch;
981-
sscanf(yytext + 1, "%x", &ch);
981+
sscanf(yytext + 2, "%x", &ch);
982982
yyextra->str.push_back(ch);
983983
}
984984
YY_BREAK

lexer.lpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ notnewline [^\n\r]
8686

8787
\\u[0-9A-Fa-f]{4} {
8888
int ch;
89-
sscanf(yytext + 1, "%x", &ch);
89+
sscanf(yytext + 2, "%x", &ch);
9090
yyextra->str.push_back(ch);
9191
}
9292

0 commit comments

Comments
 (0)