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

feat(lex,parse,interp,e2e): Implement global LINE_NUM variable #242

Merged
merged 9 commits into from
May 23, 2019

Conversation

sjbarag
Copy link
Owner

@sjbarag sjbarag commented May 23, 2019

The LINE_NUM global variable is always equal to the current source file's line number. Now it's available at runtime and doesn't cause parse failures either!

fixes #232

We only ever use it for inclusion checking, so no need to iterate across
the entire thing every time!
It's not a keyword but is _definitely_ reserved!
The JavaScript inheritance chain will work well enough for us in this
case, so no need to add a `.kind` property to custom errors!
I wasn't providing the correct type for the tokens object! :(
Implementing this check in the environment itself feels not-unreasonable
at worst, and like the correct place at best.
@sjbarag sjbarag added bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior enhancement Any addition to this project's existing capabilities lexer Affects this project's lexer (aka scanner) parser Affects this project's token parser interpreter Affects this project's tree-walking interpreter e2e Affects this project's end-to-end test cases (the BrightScript sample files executed during testing) labels May 23, 2019
@sjbarag sjbarag merged commit 4caa4a2 into master May 23, 2019
@sjbarag sjbarag deleted the add-global-line_num-variable branch May 23, 2019 15:26
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 e2e Affects this project's end-to-end test cases (the BrightScript sample files executed during testing) enhancement Any addition to this project's existing capabilities interpreter Affects this project's tree-walking interpreter lexer Affects this project's lexer (aka scanner) parser Affects this project's token parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use of LINE_NUM variable causes a parse failure
1 participant