Skip to content

Commit

Permalink
feat: better syntax highlighting for strings (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite authored Jan 9, 2025
1 parent d3a7475 commit 16d9956
Showing 1 changed file with 54 additions and 6 deletions.
60 changes: 54 additions & 6 deletions syntaxes/noir.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,64 @@
]
},
"strings": {
"name": "string.quoted.double.nr",
"match": "\"(.*?)(\n|(?<!\\\\)\")",
"captures": {
"1": {
"patterns": [
{
"name": "string.quoted.double.nr",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.nr",
"match": "\\\\."
"include": "#string-escapes"
}
]
},
{
"name": "string.quoted.double.nr",
"begin": "r(#*)\"",
"end": "\"(\\1)",
"beginCaptures": {
"1": {
"name": "string.quoted.byte.raw.nr"
}
},
"endCaptures": {
"1": {
"name": "string.quoted.byte.raw.nr"
}
}
},
{
"name": "string.interpolated.nr",
"begin": "f\"",
"end": "\"",
"patterns": [
{
"include": "#interpolated-string-escapes"
},
{
"include": "#interpolations"
}
]
}
]
},
"string-escapes": {
"name": "constant.character.escape.nr",
"match": "\\\\."
},
"interpolated-string-escapes": {
"name": "constant.character.escape.nr",
"match": "\\\\.|{{|}}"
},
"interpolations": {
"match": "({)[^\"{}]*(})",
"name": "variable.other.nr",
"captures": {
"1": {
"name": "constant.character.nr"
},
"2": {
"name": "constant.character.nr"
}
}
},
Expand Down

0 comments on commit 16d9956

Please sign in to comment.