diff --git a/syntaxes/noir.tmLanguage.json b/syntaxes/noir.tmLanguage.json index fd208a0..a59bc78 100644 --- a/syntaxes/noir.tmLanguage.json +++ b/syntaxes/noir.tmLanguage.json @@ -51,17 +51,52 @@ ] }, "strings": { - "name": "string.quoted.double.nr", - "begin": "\"", - "end": "\"", - "patterns": [{ - "include": "#escapes" - }] + "patterns": [ + { + "name": "string.quoted.double.nr", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "include": "#string-escapes" + } + ] + }, + { + "name": "string.interpolated.nr", + "begin": "f\"", + "end": "\"", + "patterns": [ + { + "include": "#interpolated-string-escapes" + }, + { + "include": "#interpolations" + } + ] + } + ] }, - "escapes": { + "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" + } + } + }, "numeric": { "patterns": [ {