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

AST parser refactoring #244

Merged

Conversation

elsassph
Copy link
Contributor

@elsassph elsassph commented Nov 18, 2020

  • Make ElseIf into an ElseIfStatement so that elseif's condition expression is in the context of an obvious statement,
  • Refactored statement parsing wrt newline/colon,
  • Improved error recovery with unclosed blocks when reaching end sub/function.

@elsassph elsassph force-pushed the feature/elseif-statement branch from 7b9a864 to 0d6925e Compare November 18, 2020 12:11
@elsassph elsassph force-pushed the feature/elseif-statement branch 2 times, most recently from 03c1eef to 1861f54 Compare November 27, 2020 17:25
@elsassph elsassph force-pushed the feature/elseif-statement branch from 1861f54 to e0eb219 Compare November 27, 2020 19:57
@elsassph elsassph changed the title AST expression walking is out of context for elseif condition AST parser refactoring Nov 27, 2020
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.

Nice job in the parser lifting the statement separators out of each individual statement/expression! Also I love all the extra unit tests for if statement variations, and thanks for fixing my broken try/catch tests.

I have a few questions and have request a few changes. But awesome work!

src/lexer/TokenKind.ts Outdated Show resolved Hide resolved
src/parser/Parser.spec.ts Outdated Show resolved Hide resolved
src/parser/Parser.ts Show resolved Hide resolved
src/parser/Parser.ts Show resolved Hide resolved
src/parser/Parser.ts Outdated Show resolved Hide resolved
src/parser/Parser.ts Outdated Show resolved Hide resolved
src/parser/Parser.ts Outdated Show resolved Hide resolved
src/parser/Parser.ts Outdated Show resolved Hide resolved
src/parser/Parser.ts Show resolved Hide resolved
src/parser/Parser.ts Show resolved Hide resolved
@TwitchBronBron TwitchBronBron merged commit cbdcce4 into rokucommunity:master Dec 18, 2020
@elsassph elsassph deleted the feature/elseif-statement branch February 3, 2021 23:12
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.

2 participants