-
Notifications
You must be signed in to change notification settings - Fork 114
First round of language_make
improvements
#564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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.html right 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.