-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SR-1724][Lexer] Handle hex letters after '.' on hex number literal #3124
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
Conversation
CC: @jckarter |
while (isHexDigit(*CurPtr) || *CurPtr == '_') | ||
++CurPtr; | ||
if (*CurPtr != 'p' && *CurPtr != 'P') { | ||
if (letterAfterDot) { |
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.
The patch LGTM, but please simplify it by eliminating the "letterAfterDot" boolean. You should be able to change this condition to:
if (isDigit(PtrOnDot[1])) {
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.
Thank you! done.
The following case used to emit an error: extension Int { var asUiColor: UIColor { ... } } 0xfff.asUiColor
a6ea05c
to
a5eed38
Compare
Thanks! |
@swift-ci please test and merge |
Thank you! I will add these test cases in later commit:
|
Thanks! Can you add a test case for "hex letters but no 'p'"? |
Ah, missed that. Thanks! |
What's in this pull request?
This case used to emit an error:
If
[a-fA-F]
follows.
, it can be valid int literal followed by dot expression: e.g.0xff.description
,0xff.fpValue
Resolved bug number: (SR-1724)
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
Validation Testing
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.