Skip to content
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

Support labelled statements #153

Merged
merged 3 commits into from
Jun 8, 2015

Conversation

ruben-ayrapetyan
Copy link
Contributor

Related issue: #52

@ruben-ayrapetyan ruben-ayrapetyan added normal parser Related to the JavaScript parser development Feature implementation labels Jun 4, 2015
@ruben-ayrapetyan ruben-ayrapetyan added this to the Core ECMA features milestone Jun 4, 2015
extern void jsp_label_push (jsp_label_t *out_label_p, jsp_label_type_flag_t type_mask, token id);
extern void jsp_label_rewrite_jumps_and_pop (jsp_label_t *label_p, opcode_counter_t break_tgt_oc);

extern jsp_label_t* jsp_label_find (jsp_label_type_flag_t type_mask, token id, bool *out_is_simply_jumpable_p);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please align the * to the function name (just like in the parameter list)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

@ruben-ayrapetyan ruben-ayrapetyan force-pushed the Ruben-support-labelled-statements branch from 8918a89 to ba55848 Compare June 5, 2015 11:15
…ment.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
Related issue: #52

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
@ruben-ayrapetyan ruben-ayrapetyan force-pushed the Ruben-support-labelled-statements branch from ba55848 to 791ef80 Compare June 5, 2015 16:11
@ruben-ayrapetyan
Copy link
Contributor Author

@galpeter, I've updated pull request according to your comments.

Additionally, I've added two test cases with multiple jumps on same label, and added two commits:

  • fix of 'case' / 'default' statements skip during parse of SwitchStatement (blocks main commit of the pull request, as otherwise test for labelled statements is parsed incorrectly);
  • remove of 'nestings' from parser (the change is related to the main changes, as nestings become unused after main commit, but it seems better to place the removal to separate commit).

Please, review.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
@ruben-ayrapetyan ruben-ayrapetyan force-pushed the Ruben-support-labelled-statements branch from 791ef80 to 2270db9 Compare June 5, 2015 17:18
@egavrin egavrin assigned galpeter and unassigned egavrin Jun 5, 2015
@egavrin
Copy link
Contributor

egavrin commented Jun 5, 2015

Good to me.

@galpeter
Copy link
Contributor

galpeter commented Jun 8, 2015

lgtm

@egavrin
Copy link
Contributor

egavrin commented Jun 8, 2015

make push

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Feature implementation normal parser Related to the JavaScript parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants