First round of language_make improvements#564
First round of language_make improvements#564Guldoman wants to merge 4 commits intolite-xl:masterfrom
language_make improvements#564Conversation
|
Also wouldn't it be better to color the special targets (es. |
Didn't know that was a thing, we can definitely add that to the regexes for target definition.
Targets with a |
|
Also versioned numbers like |
To be honest I would just remove that rule, and simply match numbers by themselves. In general this syntax needs a lot of work, but we can at least properly highlight rules and assignments |
|
By the way, which existing reference are we going to use? VSCode? Or do we just use Make's syntax reference? |
|
For the moment I'm just looking at https://www.gnu.org/software/make/manual/make.html and https://www.gnu.org/software/make/manual/html_node/Quick-Reference.html. |
|
Ok, great! |
So you would remove |
|
Also we should add the language syntax references header comment: -- Language Syntax References
-- https://www.gnu.org/software/make/manual/make.html
-- https://www.gnu.org/software/make/manual/html_node/Quick-Reference.htmlright below -- mod-version:3
local syntax = require "core.syntax" |
|
|
|
So, the following should have all modifications: -- mod-version:3
local syntax = require "core.syntax"
-- Language Syntax References
-- https://www.gnu.org/software/make/manual/make.html
-- https://www.gnu.org/software/make/manual/html_node/Quick-Reference.html
syntax.add {
name = "Makefile",
files = { PATHSEP .. "[Mm]akefile$", "%.mk$" },
comment = "#",
patterns = {
{ pattern = "#.*", type = "comment" },
{ pattern = [[\.]], type = "normal" },
{ pattern = "$[@^<%%?+|*]", type = "keyword2" },
{ pattern = "$%(.-%)", type = "symbol" },
{ pattern = "v?[%d.?]+", type = "number" },
{ regex = [[^\s*+[^:#=\s]+\s*+()(?::{1,3}|[?+!])?=]], type = { "literal", "operator" } },
{ regex = [[^\s*+\.[^:=]+\s*+()::?]], type = { "keyword2", "operator" } },
{ regex = [[^\s*+[^:=]+\s*+()::?]], type = { "function", "operator" } },
{ pattern = "-?[^%s:#=+?!]+%f[%s]", type = "normal" },
},
symbols = {
["define"] = "keyword",
["endef"] = "keyword",
["undefine"] = "keyword",
["ifdef"] = "keyword",
["ifndef"] = "keyword",
["ifeq"] = "keyword",
["ifneq"] = "keyword",
["else"] = "keyword",
["endif"] = "keyword",
["include"] = "keyword",
["-include"] = "keyword",
["sinclude"] = "keyword",
["override"] = "keyword",
["export"] = "keyword",
["unexport"] = "keyword",
["private"] = "keyword",
["vpath"] = "keyword",
},
} |
|
Actually the |

Next thing to add is
${...},$(...).Related to #563.
@PerilousBooklet what do you think about this? It should fix the issue you found.