-
Notifications
You must be signed in to change notification settings - Fork 47
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
Support integer type declaration char #254
Support integer type declaration char #254
Conversation
@@ -792,6 +792,12 @@ describe('lexer', () => { | |||
}); | |||
|
|||
describe('long integer literals', () => { | |||
it('respects \'&\' suffix', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not directly impacted by this code, but the test for this was missing so I added it.
} | ||
|
||
if (designator === '!') { | ||
} else if (designator === '!') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I combined several separate if statements into one continuous if...else if...else if... block. This cleaned up the code by removing several return
statements and making it easier to follow the flow.
this.advance(); | ||
this.addToken(TokenKind.LongIntegerLiteral); | ||
|
||
} else if (designator === '%') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the core of the change. we just needed a separate if block for handling %
According to the BrightScript documentation, a
%
can be appended to an integer literal to enforce that it becomes an integer type.Currently bsc shows a syntax error on that trailing
%
, so this PR fixes that.Fixes #233