From 64f7cf2da69c370ae62c40b80b6b601707ea1250 Mon Sep 17 00:00:00 2001 From: RedCMD <33529441+RedCMD@users.noreply.github.com> Date: Sun, 1 Sep 2024 09:47:56 +1200 Subject: [PATCH] Fix embedding in new YAML grammar (#17) * Fix embedding in new YAML grammar * Regenerated language files --------- Co-authored-by: Russ Schaaf --- ...-actions-workflow.embedded.tmLanguage.json | 62 +++++++++---------- syntaxes/yaml.embedded.tmLanguage.json | 62 +++++++++---------- utilities/syntax_templates/yaml_syntax.js | 2 +- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/syntaxes/github-actions-workflow.embedded.tmLanguage.json b/syntaxes/github-actions-workflow.embedded.tmLanguage.json index 2620e42..66ba785 100644 --- a/syntaxes/github-actions-workflow.embedded.tmLanguage.json +++ b/syntaxes/github-actions-workflow.embedded.tmLanguage.json @@ -36,7 +36,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -71,7 +71,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -106,7 +106,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -141,7 +141,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -176,7 +176,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -211,7 +211,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -246,7 +246,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -281,7 +281,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -316,7 +316,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -351,7 +351,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -386,7 +386,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -421,7 +421,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -456,7 +456,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -491,7 +491,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -526,7 +526,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -561,7 +561,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -596,7 +596,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -631,7 +631,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -666,7 +666,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -701,7 +701,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -736,7 +736,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -771,7 +771,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -806,7 +806,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -841,7 +841,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -876,7 +876,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -911,7 +911,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -946,7 +946,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -981,7 +981,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -1016,7 +1016,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -1051,7 +1051,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -1086,7 +1086,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { diff --git a/syntaxes/yaml.embedded.tmLanguage.json b/syntaxes/yaml.embedded.tmLanguage.json index bf9884e..3fef477 100644 --- a/syntaxes/yaml.embedded.tmLanguage.json +++ b/syntaxes/yaml.embedded.tmLanguage.json @@ -36,7 +36,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -71,7 +71,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -106,7 +106,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -141,7 +141,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -176,7 +176,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -211,7 +211,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -246,7 +246,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -281,7 +281,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -316,7 +316,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -351,7 +351,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -386,7 +386,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -421,7 +421,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -456,7 +456,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -491,7 +491,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -526,7 +526,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -561,7 +561,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -596,7 +596,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -631,7 +631,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -666,7 +666,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -701,7 +701,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -736,7 +736,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -771,7 +771,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -806,7 +806,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -841,7 +841,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -876,7 +876,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -911,7 +911,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -946,7 +946,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -981,7 +981,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -1016,7 +1016,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -1051,7 +1051,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { @@ -1086,7 +1086,7 @@ "end": "^(?=\\S)|(?!\\G)", "patterns": [ { - "begin": "^([ ]+)(?! )", + "begin": "(?>^|\\\\G)([ ]+)(?! )", "end": "^(?!\\1|\\s*$)", "patterns": [ { diff --git a/utilities/syntax_templates/yaml_syntax.js b/utilities/syntax_templates/yaml_syntax.js index fb5122a..4c87770 100644 --- a/utilities/syntax_templates/yaml_syntax.js +++ b/utilities/syntax_templates/yaml_syntax.js @@ -26,7 +26,7 @@ export function buildYamlSyntax(hostSpec, embeddedSpecs) { 'end': String.raw`^(?=\S)|(?!\G)`, 'patterns': [ { - 'begin': String.raw`^([ ]+)(?! )`, + 'begin': String.raw`(?>^|\\G)([ ]+)(?! )`, 'end': String.raw`^(?!\1|\s*$)`, 'patterns': [{ 'include': `${embedded.root_scope}` }], 'name': `meta.embedded.block.${embedded.vsname}.${hostSpec.vsname} ${embedded.root_scope}`,