-
Notifications
You must be signed in to change notification settings - Fork 683
Add functions for iterating utf-8 strings #293
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
Conversation
@@ -25,15 +25,81 @@ | |||
#define LIT_BYTE_NULL (0) | |||
|
|||
/** | |||
* For the formal definition of Unicode transformation formats (UTF) see Section 3.9, Unicode Encoding Forms in The | |||
* Unicode Standard (http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf#G7404, tables 3-6, 3-7). |
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.
Why do you use Unicode 7.0? Since @ruben-ayrapetyan used data from Unicode 3.0 tables, should we regenerate them for 7.0?
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.
"ECMAScript source text is represented as a sequence of characters in the Unicode character encoding, version 3.0 or later."
Definitions in this file are the same for both Unicode 3.0 and 7.0.
We can change this link to 3.0.
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.
Just add comment about it
0, | ||
buf_size, | ||
{ | ||
0, |
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.
Why 0
?
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.
Initial offset of iterator is 0.
I have some comments for the names. But anything is good for me. |
@sand1k please update naming and |
9ad76ba
to
4375ad0
Compare
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
4375ad0
to
ae3eea8
Compare
The functions provide the following:
lit_utf8_iterator_read_next
,lit_utf8_iterator_read_next_and_incr
,lit_utf8_iterator_incr
.lit_utf8_iterator_read_prev
,lit_utf8_iterator_read_prev_and_decr
,lit_utf8_iterator_decr
.lit_utf8_iterator_get_pos
,lit_utf8_iterator_restore_pos
.lit_utf8_iterator_get_index
.lit_utf8_iterator_is_eos
,lit_utf8_iterator_is_bos
.lit_utf8_iterator_set_to_bos
,lit_utf8_iterator_set_to_eos
.