-
Notifications
You must be signed in to change notification settings - Fork 691
[API] Add RegExp C API #2542
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
[API] Add RegExp C API #2542
Conversation
5272d9d to
f5cb0d0
Compare
f5cb0d0 to
5dfc2c4
Compare
LaszloLango
left a comment
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.
Please fix the style issues.
|
I was thinking on a slightly different approach. I'd avoid using the flag's enum. I'd simply create RegExp objects from strings in RegExp literal form, like: jerry_value_t regexp = jerry_create_regexp("/a*/gim");What do you guys think? |
|
We would need syntax check then. That is complicated. |
|
@zherczeg it is not that complicated. The code is already there, just needs to be exposed. The only question is which API is better to use, which one is more intuitive. |
|
Code is there? I think it requires a full parser environment to do this. |
|
|
@LaszloLango First arg: |
|
@zherczeg don't stop reading on the first line :) All you need from this function is using only the source code pointer ( |
|
Regardless calling |
56e3ce8 to
a494dae
Compare
a494dae to
dd64a86
Compare
dd64a86 to
2e6b551
Compare
|
@akosthekiss I've updated the PR, thank you for your suggestions, it simplified the patch a lot. |
2e6b551 to
bec653e
Compare
bec653e to
0f38547
Compare
akosthekiss
left a comment
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
0f38547 to
8c47abf
Compare
|
@LaszloLango Do you have any other comments to the patch? |
|
I feel like my question is not really answered, but simply ignored. I am still questioning the form of this new API function. IMHO the literal form is easier to use and it is not difficult to implement. |
|
@LaszloLango I would like to see your proposal as a patch (you can copy it into here if it is small). It is hard for me to decide which one looks better. However if your new API is the same as |
|
@zherczeg you are right, it would be the same. I can accept your argument. I am good with the current approach. |
zherczeg
left a comment
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
c914759 to
7387577
Compare
LaszloLango
left a comment
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.
Only one minor thing before we merge the PR.
This patch supports creating a RegExp object through the C API. JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
7387577 to
34cf4b9
Compare
LaszloLango
left a comment
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
This patch supports creating a RegExp object through the C API.
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu