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(lex): Allow explicit double designator on literals > 10 characters #617

Merged
merged 2 commits into from
Jan 22, 2021

Conversation

sjbarag
Copy link
Owner

@sjbarag sjbarag commented Jan 22, 2021

RBI forces all literal numbers to double-precision if they're longer than characters, and also allows such a number to be explicitly designated a double with a trailing #. brs didn't. Look for a trailing # when lexing long numeric literals, to avoid treating it like a conditional compilation string.

fixes #616

RBI forces all literal numbers to double-precision if they're longer
than characters, and also allows such a number to be explicitly
designated a double with a trailing `#`.  `brs` didn't.  Look for a
trailing `#` when lexing long numeric literals, to avoid treating it
like a conditional compilation string.

fixes #616
@sjbarag sjbarag added bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior lexer Affects this project's lexer (aka scanner) labels Jan 22, 2021
@sjbarag
Copy link
Owner Author

sjbarag commented Jan 22, 2021

allow-explicit-double-designation-with-octothorp

ok i admit it i just wanted to use "octothorp" in a sentence. i don't get many chances.

src/lexer/Lexer.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.

All those "octothorps" look great

@sjbarag sjbarag merged commit 4137845 into main Jan 22, 2021
@sjbarag sjbarag deleted the allow-explicit-double-designation-with-octothorp branch January 22, 2021 19:01
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 lexer Affects this project's lexer (aka scanner)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Very large double-precision literals with a trailing # are treated like conditional compilation code
2 participants