From 3f70105a937fa52f8827ccc9317724588e7e7d84 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sat, 17 Feb 2024 18:12:34 +0100 Subject: [PATCH] syntax/justfile: support command annotation, variable substitutions and captured outputs --- runtime/syntax/justfile.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/runtime/syntax/justfile.yaml b/runtime/syntax/justfile.yaml index 926edb21e2..9a2037fedc 100644 --- a/runtime/syntax/justfile.yaml +++ b/runtime/syntax/justfile.yaml @@ -9,6 +9,7 @@ rules: - preproc: "\\<(ifeq|ifdef|ifneq|ifndef|else|endif)\\>" - statement: "^(export|include|override)\\>" - symbol.operator: "^[^:= ]+:" + - symbol.operator: "^ *[@!-]" - symbol.operator: "([=,%]|\\+=|\\?=|:=|&&|\\|\\|)" - statement: "\\$\\((abspath|addprefix|addsuffix|and|basename|call|dir)[[:space:]]" - statement: "\\$\\((error|eval|filter|filter-out|findstring|firstword)[[:space:]]" @@ -25,12 +26,40 @@ rules: skip: "\\\\." rules: - constant.specialChar: "\\\\." + - symbol.operator: + start: "\\{\\{" + end: "\\}\\}" + rules: + - type: "." - constant.string: start: "'" end: "'" skip: "\\\\." rules: - constant.specialChar: "\\\\." + - symbol.operator: + start: "\\{\\{" + end: "\\}\\}" + rules: + - type: "." + - constant.string: + start: "```" + end: "```" + rules: + - type: "." + - include: "shell" + - constant.string: + start: "`" + end: "`" + skip: "\\\\." + rules: + - type: "." + - include: "shell" + - symbol.operator: + start: "\\{\\{" + end: "\\}\\}" + rules: + - type: "." - identifier: "\\$+(\\{[^} ]+\\}|\\([^) ]+\\))" - identifier: "\\$[@^<*?%|+]|\\$\\([@^<*?%+-][DF]\\)" - identifier: "\\$\\$|\\\\.?"