-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Parse] Fix minor bug in #sourceLocation on lex error #19344
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
db31d6e
to
5976f0e
Compare
53c70cf
to
d7ecc8d
Compare
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.
Thanks! I'd still like @rintaro or someone more parsery to confirm the actual fix, but I'm glad it's testable.
d7ecc8d
to
e1868ce
Compare
Thanks for working on this! This is definitely an improvement. #sourceLocation(file: "test.swift", line: 1000)
0xG When the parser is at |
@swift-ci Please smoke test |
I think I’ll leave the bug you mention for another day but I was looking at making the “file:" optional in #sourceLocation. Do you think that would be worthwhile? That also can be a exercise for another day. Merge away... |
e1868ce
to
c337a20
Compare
@swift-ci Please smoke test |
ba1e6b0
to
a534129
Compare
@swift-ci Please smoke test |
a534129
to
a6c3861
Compare
a6c3861
to
2eb8201
Compare
@jrose-apple I think I may have pushed a commit after your Please smoke test |
@swift-ci Please smoke test |
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!
Thanks all, we got there there in the end. Any thoughts on the rather eccentric #19347? |
There seems to be a minor bug in the implementation of #sourceLocation when the directive is succeeded by token that gives an error during lexing. The error will be reported with the wrong location. This is because lexing of the next token occurs immediately on consuming the last token of the directive which is before the virtual file is set up to have the location take effect.
Resolved by moving consumption of directives last token to the end of the function.
Resolves SR-8772.