Skip to content

Fix RegExp literal parsing #554

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

Merged
merged 1 commit into from
Aug 12, 2015

Conversation

dbatyai
Copy link
Member

@dbatyai dbatyai commented Aug 10, 2015

No description provided.

@dbatyai dbatyai added bug Undesired behaviour ecma builtins Related to ECMA built-in routines labels Aug 10, 2015
@egavrin egavrin added this to the ECMA builtins milestone Aug 10, 2015
|| prev_non_lf_token.type == TOK_SMALL_INT
|| prev_non_lf_token.type == TOK_NUMBER
|| prev_non_lf_token.type == TOK_STRING
|| prev_non_lf_token.type == TOK_REGEXP))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TOK_CLOSE_PAREN and TOK_CLOSE_BRACE could precede regular expression, for example:

if (true) /abc/.exec("abc");
if (true) {} /abc/.exec("abc");

This case is harder to support, possibly, we could implement it in another patch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another case:

var a
/abc/.exec("abc");

Could you, please, create an issue for the mentioned tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue can be found here: #563

@sand1k sand1k assigned dbatyai and unassigned sand1k Aug 10, 2015
@dbatyai dbatyai added the parser Related to the JavaScript parser label Aug 11, 2015
@dbatyai dbatyai force-pushed the regexp-literal-parsing branch from c3acb74 to 6fc3e43 Compare August 11, 2015 16:01
@dbatyai
Copy link
Member Author

dbatyai commented Aug 11, 2015

@sand1k, I've updated the patch, it should work correctly now. Please check.

@dbatyai dbatyai assigned sand1k and unassigned dbatyai Aug 11, 2015
@sand1k
Copy link
Contributor

sand1k commented Aug 12, 2015

LGTM.

@sand1k sand1k assigned dbatyai and unassigned sand1k Aug 12, 2015
@zherczeg
Copy link
Member

LGTM

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
@dbatyai dbatyai force-pushed the regexp-literal-parsing branch from 6fc3e43 to 4ee30cb Compare August 12, 2015 09:49
@dbatyai dbatyai merged commit 4ee30cb into jerryscript-project:master Aug 12, 2015
@dbatyai dbatyai deleted the regexp-literal-parsing branch August 13, 2015 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behaviour ecma builtins Related to ECMA built-in routines parser Related to the JavaScript parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants