Skip to content

Commit 10115ca

Browse files
committed
Fix for hexadecimal escapes of the from \x{62}.
1 parent 2633251 commit 10115ca

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

source/lex.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,17 +939,31 @@ auto lex_line(
939939
if (
940940
peek( offset) == '\\'
941941
&& peek(1+offset) == 'x'
942-
&& is_hexadecimal_digit(peek(2+offset))
942+
&& (is_hexadecimal_digit(peek(2+offset))
943+
|| (peek(2+offset) == '{' && is_hexadecimal_digit(peek(3+offset)))
943944
)
945+
)
944946
{
947+
bool has_bracket = peek(2+offset) == '{';
945948
auto j = 3;
949+
950+
if (has_bracket) { ++j; }
951+
946952
while (
947953
peek(j+offset)
948954
&& is_hexadecimal_digit(peek(j+offset))
949955
)
950956
{
951957
++j;
952958
}
959+
960+
if (has_bracket) {
961+
if (peek(j+offset) == '}') {
962+
++j;
963+
} else {
964+
return 0;
965+
}
966+
}
953967
return j;
954968
}
955969
return 0;

0 commit comments

Comments
 (0)