Fix error message about invalid surrogate pairs
I tested following strings with invalid surrogate pair and unpaired surrogate in files: 1. `"a\uD800\uD800x"` 2. `"a\uD800x"` The error messge was: "... invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF; ..." I think it must be: "... invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF; ..."
This commit is contained in:
parent
db013c9428
commit
6815968a42
2 changed files with 4 additions and 4 deletions
|
@ -338,13 +338,13 @@ class lexer
|
|||
}
|
||||
else
|
||||
{
|
||||
error_message = "invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF";
|
||||
error_message = "invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF";
|
||||
return token_type::parse_error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error_message = "invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF";
|
||||
error_message = "invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF";
|
||||
return token_type::parse_error;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8201,13 +8201,13 @@ class lexer
|
|||
}
|
||||
else
|
||||
{
|
||||
error_message = "invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF";
|
||||
error_message = "invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF";
|
||||
return token_type::parse_error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error_message = "invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF";
|
||||
error_message = "invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF";
|
||||
return token_type::parse_error;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue