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

fix(parse): Restore nested block parsing #514

Merged
merged 1 commit into from
Aug 24, 2020
Merged

Conversation

sjbarag
Copy link
Owner

@sjbarag sjbarag commented Aug 22, 2020

I'd accidentally broken nested-block parsing in #510! This fixes that and ensures that block() always consumes the block-closing token.

@sjbarag sjbarag added bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser labels Aug 22, 2020
@sjbarag sjbarag force-pushed the fix-nested-loops-and-ifs branch 3 times, most recently from aa1d858 to 176d71f Compare August 24, 2020 21:01
Copy link
Collaborator

@lkipke lkipke left a comment

Choose a reason for hiding this comment

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

Awesome, looks great!

throw addError(peek(), "Expected 'end if' to terminate 'else' block");
}
elseBranch = maybeElseBranch.body;
endIfToken = maybeElseBranch.closingToken;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ooh nice does this mean the endIfToken is populated now? I ran into this when I was writing the coverage tool

Copy link
Owner Author

Choose a reason for hiding this comment

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

It does! That's where a few of the snapshot updates came into play 😃

src/parser/Parser.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@alimnios72 alimnios72 left a comment

Choose a reason for hiding this comment

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

Same questions as Levi but this is great stuff!

I'd accidentally broken nested-block parsing in #510!  This fixes that
and ensures that `block()` always consumes the block-closing token.
@sjbarag sjbarag merged commit d023bc2 into master Aug 24, 2020
@sjbarag sjbarag deleted the fix-nested-loops-and-ifs branch August 24, 2020 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants