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

Finds and includes more deeply embedded expressions #696

Merged

Conversation

markwpearce
Copy link
Collaborator

Does not give up so easily when an expression can't be parsed - will continue looking at further expressions.

Examples:

  • DottedGetExpressions ending in a . -> first part is parsed as an expression and added to the AST
  • CallExpressions -> if there is no closing ), or if an argument is unable to be parsed, the call expression is still added to the AST
  • ArrayLiteralExpression if there is no closing ], or if an element is unable to be parsed, the ArrayLiteralExpression is still added to the AST
  • etc. (see tests!)

This has the nice side effect of provide WAY more diagnostics - so diagnostics like "Unmatched Bracket" actually show up, instead of "Unexpected newline", as well as being able to provide diagnostics on multiple problem arguments in the same function call.

Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

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

Great PR! I appreciate that it's hyper-focused, and this will be a fantastic improvement to the parser. Just a few suggestions, and then this is good to go.

src/parser/Expression.ts Outdated Show resolved Hide resolved
src/files/BrsFile.spec.ts Show resolved Hide resolved
src/parser/Parser.ts Outdated Show resolved Hide resolved
markwpearce and others added 3 commits September 23, 2022 15:33
Co-authored-by: Bronley Plumb <bronley@gmail.com>
Co-authored-by: Bronley Plumb <bronley@gmail.com>
@markwpearce markwpearce merged commit 63b53bf into rokucommunity:master Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants