You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
local syntax = require "core.syntax"
|
|
|
|
syntax.add {
|
|
files = "%.fe$",
|
|
comment = ";",
|
|
patterns = {
|
|
{ pattern = ";.-\n", type = "comment" },
|
|
{ pattern = { '"', '"', '\\' }, type = "string" },
|
|
{ pattern = "0x[%da-fA-F]+", type = "number" },
|
|
{ pattern = "-?%d+[%d%.]*", type = "number" },
|
|
{ pattern = "-?%.?%d+", type = "number" },
|
|
{ pattern = "'", type = "symbol" },
|
|
{ pattern = "%f[^(][^()'%s\"]+", type = "function" },
|
|
{ pattern = "[^()'%s\"]+", type = "symbol" },
|
|
},
|
|
symbols = {
|
|
["if"] = "keyword2",
|
|
["let"] = "keyword2",
|
|
["do"] = "keyword2",
|
|
["fn"] = "keyword2",
|
|
["mac"] = "keyword2",
|
|
["'"] = "keyword2",
|
|
["print"] = "keyword",
|
|
["while"] = "keyword",
|
|
["car"] = "keyword",
|
|
["cdr"] = "keyword",
|
|
["not"] = "keyword",
|
|
["setcdr"] = "keyword",
|
|
["setcar"] = "keyword",
|
|
["nil"] = "literal",
|
|
["t"] = "literal",
|
|
}
|
|
}
|