-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[DNM] Parse /.../
regex literals
#41767
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
@rintaro The lexing logic is still WIP as:
But let me know if you have any initial thoughts |
9573ddb
to
e26bdb2
Compare
@swift-ci please test |
@swift-ci please test source compatibility |
What do you think are the issues sub-lexing might cause?
Could you elaborate? Any example? |
I don't think it currently causes any issues, e.g for delayed body parsing we start on the opening
String literals currently diagnose invisible ASCII characters they come across, we probably ought to do the same for regex literals. |
@swift-ci please test macOS |
@swift-ci please build toolchain macOS toolchain download: https://ci.swift.org/job/swift-PR-toolchain-macos/53/artifact/branch-main/swift-PR-41767-53-osx.tar.gz |
Try to lex regex literals with `/.../` delimiters.
Queue up diagnostics when lexing, waiting until `Lexer::lex` is called before emitting them. This allows us to re-lex without having to deal with previously invalid tokens.
Loudly error if `-enable-experimental-string-processing` is not used. This allows us to easily check for source compatibility conficts.
e26bdb2
to
88a55e2
Compare
Updated to re-lex regex literals from the parser |
@swift-ci please test |
@swift-ci please test source compatibility |
Continuing work on #42119 |
Try to lex regex literals with
/.../
delimiters when in an expression context in the parser, with a rule that it may not start with a space, tab or)
character.