-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Raw string literals (more than one #
, grammar limitations prevent us from supporting escapes)
#3
Comments
I see the problem now could possibly add a single line but then you probably couldn't support |
Wow that's quite cursed, congrats 🫠 It's gonna take me a while to wrap my head around this. It's also been 4 years since I added raw string support so I've probably forgotten some context. Sounds like you've answered your question yourself but I believe the limitations I was referring to was that I didn't think it was possible to reference groups from Does your solution handle things like |
better exception handler "swift-raw-strings": {
"begin": "(#+)\"",
"end": "\"\\1(#*)",
"beginCaptures": { "0": { "name": "punctuation.definition.string.begin.raw.swift" } },
"endCaptures": {
"0": { "name": "punctuation.definition.string.end.raw.swift" },
"1": { "name": "invalid.illegal.extra-closing-delimiter.swift" }
},
"name": "string.quoted.double.single-line.raw.swift",
"patterns": [
{
"begin": "(?<=(?>[^#]|^)(#+)\")\\G(?!\\\\\\1(?!#))",
"end": "(?=\\\\\\1(?!#))|(?=\"\\1)",
"patterns": [
{
"name": "invalid.illegal.returns-not-allowed.swift",
"match": "\\r|\\n"
}
]
},
{
"begin": "(?=\\\\(#+)(?!#))",
"end": "(?!\\G)(?=\\\\\\1(?!#))|(?=\"\\1)",
"patterns": [
{
"name": "invalid.illegal.returns-not-allowed.swift",
"match": "\\r|\\n"
},
{ "include": "#literals-string-raw-string-guts" }
]
}
]
} |
swift-tmlanguage/Swift.tmLanguage.yaml
Line 2339 in 4028d24
syntax examples?
https://github.com/apple/swift-evolution/blob/main/proposals/0168-multi-line-string-literals.md
doesn't seem to say anything about hashtags
#
is it this section?
https://github.com/apple/swift-evolution/blob/main/proposals/0200-raw-string-escaping.md#customized-escape-delimiters
The text was updated successfully, but these errors were encountered: