X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Fmakefile.yaml;h=7e90cdeb76aac90646299dbc6a0cb13f0d8673f6;hb=54c23cae72d7237bc898a59f79aad0acffdf0ffe;hp=a729dee470bb4679af248cdf323c1387ecc72ccc;hpb=b977bf5cca84f7dc762fe8d9967831502ee5cc87;p=micro.git diff --git a/runtime/syntax/makefile.yaml b/runtime/syntax/makefile.yaml index a729dee4..7e90cdeb 100644 --- a/runtime/syntax/makefile.yaml +++ b/runtime/syntax/makefile.yaml @@ -1,14 +1,14 @@ filetype: makefile -detect: +detect: filename: "([Mm]akefile|\\.ma?k)$" header: "^#!.*/(env +)?[bg]?make( |$)" rules: - - preproc: "\\b(ifeq|ifdef|ifneq|ifndef|else|endif)\\b" - - preproc: "^(export|include|override)\\b" + - 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:]]" - statement: "\\$\\((flavor|foreach|if|info|join|lastword|notdir|or)[[:space:]]" @@ -16,9 +16,23 @@ rules: - statement: "\\$\\((value|warning|wildcard|word|wordlist|words)[[:space:]]" - identifier: "^.+:" - identifier: "[()$]" - - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - constant.string: + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + - constant.string: + start: "'" + end: "'" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." - identifier: "\\$+(\\{[^} ]+\\}|\\([^) ]+\\))" - identifier: "\\$[@^<*?%|+]|\\$\\([@^<*?%+-][DF]\\)" - identifier: "\\$\\$|\\\\.?" - - comment: "(^|[[:space:]])#([^{].*)?$" - - comment: "^ @#.*" + - comment: + start: "#" + end: "$" + rules: [] +