-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parser: parse Unicode escape sequences in keys #219
Conversation
@belochub can you please rebase it? I think removing the old |
b42cd4b
to
181161c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@belochub can you, please, rebase this PR on master? |
181161c
to
61f1efb
Compare
@aqrln, @lundibundi, ping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
src/jsrs_parser.cc
Outdated
|
||
if (isxdigit(str[0])) { | ||
result = ReadHexNumber(str, 4, ok); | ||
*size = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it check whether *ok
is true before changing *size
?
src/jsrs_parser.cc
Outdated
return 0xFFFD; | ||
} | ||
} | ||
result = ReadHexNumber(str + 1, hex_size, ok); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should check whether result
is a valid code point (i.e., something like \u{1234123412341234}
must be a syntax error).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I looked into it and decided to reimplement ReadHexNumber
overall, because it has some other problems.
d6c59bb
to
0a36841
Compare
0a36841
to
58bb604
Compare
@aqrln, I've updated |
* Implement surrogate Unicode pairs parsing. * Parse Unicode escape sequences in objects. * Rework ReadHexNumber function. * Improve key parsing performance by avoiding copying when possible. PR-URL: #219 Refs: https://github.com/metarhia/jstp/issues/152 Reviewed-By: Dmytro Nechai <nechaido@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Landed in bef3572. |
* Implement surrogate Unicode pairs parsing. * Parse Unicode escape sequences in objects. * Rework ReadHexNumber function. * Improve key parsing performance by avoiding copying when possible. PR-URL: #219 Refs: https://github.com/metarhia/jstp/issues/152 Reviewed-By: Dmytro Nechai <nechaido@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
* Implement surrogate Unicode pairs parsing. * Parse Unicode escape sequences in objects. * Rework ReadHexNumber function. * Improve key parsing performance by avoiding copying when possible. PR-URL: #219 Refs: https://github.com/metarhia/jstp/issues/152 Reviewed-By: Dmytro Nechai <nechaido@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
* Implement surrogate Unicode pairs parsing. * Parse Unicode escape sequences in objects. * Rework ReadHexNumber function. * Improve key parsing performance by avoiding copying when possible. PR-URL: metarhia/jstp#219 Refs: https://github.com/metarhia/jstp/issues/152 Reviewed-By: Dmytro Nechai <nechaido@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
* Implement surrogate Unicode pairs parsing. * Parse Unicode escape sequences in objects. * Rework ReadHexNumber function. * Improve key parsing performance by avoiding copying when possible. PR-URL: metarhia/jstp#219 Refs: https://github.com/metarhia/jstp/issues/152 Reviewed-By: Dmytro Nechai <nechaido@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
* Implement surrogate Unicode pairs parsing. * Parse Unicode escape sequences in objects. * Rework ReadHexNumber function. * Improve key parsing performance by avoiding copying when possible. PR-URL: metarhia/jstp#219 Refs: https://github.com/metarhia/jstp/issues/152 Reviewed-By: Dmytro Nechai <nechaido@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Also, add support for Unicode surrogate pairs and improve key parsing performance by avoiding copying when possible.
Refs: https://github.com/metarhia/jstp/issues/152