From 2328680726eabe01279ab6c6e89cc1eca83ea443 Mon Sep 17 00:00:00 2001 From: Sarthak Shastri Date: Wed, 27 Dec 2023 11:30:19 +0530 Subject: [PATCH 1/2] Added multiline support --- syntaxes/coco.tmLanguage.json | 39 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/syntaxes/coco.tmLanguage.json b/syntaxes/coco.tmLanguage.json index 82fba46..ca853e1 100644 --- a/syntaxes/coco.tmLanguage.json +++ b/syntaxes/coco.tmLanguage.json @@ -402,29 +402,30 @@ "patterns": [ { "name": "string.quoted.other.multiline.coco", - "begin": "f\"", - "end": "\"", + "begin": "{", + "end": "}", "patterns": [ { - "name": "embedded-expression", - "begin": "\\{", - "end": "\\}", - "patterns": [ - { - "include": "source.coco" - } - ] - }, - { - "name": "punctuation.other.bracket.curly.coco", - "match": "\\{|\\}" - }, - { - "match": "(?=\")", - "name": "string.quoted.other.multiline.coco", - "pop": true + "include": "source.coco" } ] + }, + { + "name": "punctuation.other.bracket.curly.coco", + "match": "\\{|\\}" + }, + { + "match": "[^\"{\\\\}]+|\\{", + "name": "string.quoted.other.multiline.coco" + }, + { + "match": "\\\\.", + "name": "constant.character.escape.coco" + }, + { + "match": "(?=\")", + "name": "string.quoted.other.multiline.coco", + "pop": true } ] }, From 62501bb403bb8bccd76a9a330f6a904256afd884 Mon Sep 17 00:00:00 2001 From: Sarthak Shastri Date: Wed, 27 Dec 2023 11:41:27 +0530 Subject: [PATCH 2/2] Added support to regular strings as well --- syntaxes/coco.tmLanguage.json | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/syntaxes/coco.tmLanguage.json b/syntaxes/coco.tmLanguage.json index ca853e1..10fcac9 100644 --- a/syntaxes/coco.tmLanguage.json +++ b/syntaxes/coco.tmLanguage.json @@ -429,14 +429,16 @@ } ] }, - { - "name": "constant.character.escape.coco", - "match": "\\\\." - }, { "name": "string.quoted.double.coco", "begin": "\"", - "end": "\"" + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.coco", + "match": "\\\\." + } + ] } ] },