-
Notifications
You must be signed in to change notification settings - Fork 686
Improve lexer_expect_object_literal_id option handling #2436
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
Improve lexer_expect_object_literal_id option handling #2436
Conversation
| } | ||
|
|
||
| lexer_expect_object_literal_id (context_p, false); | ||
| lexer_expect_object_literal_id (context_p, LEXER_OBJ_IDENT_CLASS_METHOD | LEXER_OBJ_IDENT_NO_OPTS); |
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.
LEXER_OBJ_IDENT_NO_OPTS ?
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.
Good catch, it is unnecessary.
89e5115 to
2445998
Compare
| lexer_skip_spaces (context_p); | ||
|
|
||
| #ifndef CONFIG_DISABLE_ES2015_CLASS | ||
| int is_class_method = ((context_p->status_flags & PARSER_IS_CLASS) |
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.
Is this flag still used?
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's no longer needed so it had been removed here.
| #endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */ | ||
| #ifndef CONFIG_DISABLE_ES2015_CLASS | ||
| PARSER_IS_CLASS = (1u << 20), /**< statements parsed inside class body */ | ||
| PARSER_CLASS_CONSTRUCTOR = (1u << 21), /**< a class constructor is parsed */ |
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.
Change 21 to 20 here.
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.
Thanks, I've forgotten it.
This patch allows to add further options flags to `lexer_expect_object_literal_id` to handle unique behaviors more easily also substitutes `PARSER_IS_CLASS` flag hence it is removed. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2445998 to
4d4bec7
Compare
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
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
Refs: jerryscript-project/jerryscript#2431 Refs: jerryscript-project/jerryscript#2496 Refs: jerryscript-project/jerryscript#2485 Refs: jerryscript-project/jerryscript#2530 Refs: jerryscript-project/jerryscript#2547 Refs: jerryscript-project/jerryscript#2436 Refs: jerryscript-project/jerryscript#2467 Refs: jerryscript-project/jerryscript#2481 Refs: jerryscript-project/jerryscript#2408 Refs: jerryscript-project/jerryscript#2430 Refs: jerryscript-project/jerryscript#2439 Refs: jerryscript-project/jerryscript#2588
This patch allows to add further options flags to
lexer_expect_object_literal_idto handle unique behaviors more easilyalso substitutes
PARSER_IS_CLASSflag hence it is removed.JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu