From 93451f254e5109c9f3720d8e94639a4ecca2b2b2 Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Thu, 1 Dec 2022 23:49:52 +0900 Subject: [PATCH] Fix string interpolation syntax --- package.json | 2 +- syntaxes/erg.tmLanguage.json | 152 ++++++++++++----------------------- 2 files changed, 54 insertions(+), 100 deletions(-) diff --git a/package.json b/package.json index 94056c6..e8caee5 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "vscode-erg", "description": "Erg language support for Visual Studio Code", "publisher": "erg-lang", - "version": "0.1.5", + "version": "0.1.6", "engines": { "vscode": "^1.70.0" }, diff --git a/syntaxes/erg.tmLanguage.json b/syntaxes/erg.tmLanguage.json index d56e228..1155db5 100644 --- a/syntaxes/erg.tmLanguage.json +++ b/syntaxes/erg.tmLanguage.json @@ -170,7 +170,7 @@ "interpolated": { "patterns": [ { - "begin": "\\{", + "begin": "\\\\\\{", "beginCaptures": { "0": { "name": "punctuation.section.embedded.begin.erg" @@ -199,7 +199,7 @@ "nest_curly_and_self": { "patterns": [ { - "begin": "\\{", + "begin": "\\\\\\{", "captures": { "0": { "name": "punctuation.section.scope.erg" @@ -532,62 +532,11 @@ "name": "string.quoted.triple.double.erg", "comment": "multi-line string with triple double quotes", "patterns": [ - { - "include": "#string_escaped_char" - } - ] - }, - { - "begin": "(fmt) *(\"\"\")", - "beginCaptures": { - "1": { - "name": "support.function.builtin.erg" - }, - "2": { - "name": "punctuation.definition.string.multiline.begin.erg" - } - }, - "end": "\"\"\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.multiline.end.erg" - } - }, - "name": "string.formatted.quoted.triple.double.erg", - "comment": "formatted multi-line string with triple double quotes", - "patterns": [ - { - "include": "#string_escaped_char" - }, { "include": "#interpolated" - } - ] - }, - { - "name": "string.formatted.quoted.double.erg", - "begin": "(fmt) *(\")", - "beginCaptures": { - "1": { - "name": "support.function.builtin.erg" }, - "2": { - "name": "punctuation.definition.string.begin.erg" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.erg" - } - }, - "comment": "String with single pair of double quotes. Regex matches isolated double quote", - "patterns": [ { "include": "#string_escaped_char" - }, - { - "include": "#interpolated" } ] }, @@ -607,6 +556,9 @@ }, "comment": "String with single pair of double quotes. Regex matches isolated double quote", "patterns": [ + { + "include": "#interpolated" + }, { "include": "#string_escaped_char" } @@ -645,8 +597,7 @@ } }, "name": "source.other.raw.erg", - "patterns": [ - ] + "patterns": [] }, "symbolized-operator": { "patterns": [ @@ -713,25 +664,25 @@ } }, "procedural": { - "patterns": [ + "patterns": [ { "name": "support.function.procedural.builtin.erg", "match": "(dir!|for!|globals!|id!|if!|input!|locals!|open!|match!|print!|while!|with!)" }, - { - "name": "constant.other.procedural.erg", - "match": "(([a-z_][A-Za-z0-9_]*!)|([A-Z_][A-Za-z0-9_]*!))", - "captures": { - "2": { - "name": "entity.name.function.procedural.erg" - }, - "3": { - "name": "entity.name.type.procedural.erg" - } - } - } - ] - }, + { + "name": "constant.other.procedural.erg", + "match": "(([a-z_][A-Za-z0-9_]*!)|([A-Z_][A-Za-z0-9_]*!))", + "captures": { + "2": { + "name": "entity.name.function.procedural.erg" + }, + "3": { + "name": "entity.name.type.procedural.erg" + } + } + } + ] + }, "type_decl": { "patterns": [ { @@ -752,39 +703,42 @@ ] }, "special-variables": { - "match": "(?x)\n \\b (?