-
Notifications
You must be signed in to change notification settings - Fork 30
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
Tagged literal support #304
Conversation
With the tests passing, I'm removing the WIP status. |
When #295 is merged in, we should make a copy of magic pythons regexp and add an early bailout pattern of That should prevent the issue described in MagicStack/MagicPython#27 (comment) which is present with the PR as well. |
Based on microsoft/vscode#1751 (comment) |
So does this require that the string start with "re" for it to be regex and the string start with "SQL" to be sql? |
For regex: _r, re, regex |
Wouldn't that mess up the regex pattern though?
|
Yes, that would not get syntax highlighting because it's not tagged. As discussed in #236 tagging of generic raw strings requires support from vscode. |
Wow, I need to do a better job of reading. Thanks for this feature 👍 |
Implements #236.
This PR adds a generic way of supporting tagged raw string literals. Currently, only regex patterns are supported. The regex grammar comes from embedding MagicPython's regex grammar.
raw_string literals were moved to a separate file to be able to support many different types of tagged literals without cluttering the main grammar.
Example Image: