Skip to content

Modularize try statement parsing - #390

Merged
Razican merged 5 commits into
boa-dev:masterfrom
abhijeetbhagat:modularize-try-catch-finally-parsing
May 11, 2020
Merged

Razican merged 5 commits into
boa-dev:masterfrom
abhijeetbhagat:modularize-try-catch-finally-parsing

Conversation

@abhijeetbhagat

@abhijeetbhagat abhijeetbhagat commented May 10, 2020 •

Copy link
Copy Markdown
Contributor

This Pull Request fixes/closes #375.

  • Modularized the try statement parsing into separate modules as mentioned in the reply to the issue.
  • Haven't implemented the entire catch parameter grammar parsing. Just kept the existing identifier parsing as it is for now.
  • Added some tests for the try statement parsing.

@Razican

Razican commented May 10, 2020 •

Copy link
Copy Markdown
Member

Thanks for this contribution!
It seems that you need to re-base, since in #389 we added BindingIdentifier parsing. The change for this case was to parse the binding identifier like this:

// TODO: CatchParameter - BindingPattern
let catch_param = BindingIdentifier::new(self.allow_yield, self.allow_await)
    .parse(cursor)
    .map(Node::local)?;

This should just be used in the CatchParameter parser

@Razican Razican added A-Bug Something isn't working A-Enhancement New feature or request C-Parser Issues surrounding the parser labels May 10, 2020
@Razican Razican added this to the v0.8.0 milestone May 10, 2020

@Razican Razican left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks very good!
I think that CatchParameter should be in catch.rs, since it's directly related.

Check my other comments too, and see if they make sense.

@Razican
Razican merged commit 2851eb0 into boa-dev:master May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Bug Something isn't working A-Enhancement New feature or request C-Parser Issues surrounding the parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

catch statement causes syntax error

2 participants