Merge pull request #1073 from ncarrezdev/ncarrezdev/synxtax-corrections
[chore]: Update syntax
This commit is contained in:
commit
2dac3667cb
|
@ -7,7 +7,7 @@ syntax.add {
|
||||||
comment = "//",
|
comment = "//",
|
||||||
block_comment = { "/*", "*/" },
|
block_comment = { "/*", "*/" },
|
||||||
patterns = {
|
patterns = {
|
||||||
{ pattern = "//.-\n", type = "comment" },
|
{ pattern = "//.*", type = "comment" },
|
||||||
{ pattern = { "/%*", "%*/" }, type = "comment" },
|
{ pattern = { "/%*", "%*/" }, type = "comment" },
|
||||||
{ pattern = { '"', '"', '\\' }, type = "string" },
|
{ pattern = { '"', '"', '\\' }, type = "string" },
|
||||||
{ pattern = { "'", "'", '\\' }, type = "string" },
|
{ pattern = { "'", "'", '\\' }, type = "string" },
|
||||||
|
@ -61,11 +61,11 @@ syntax.add {
|
||||||
{ pattern = "_?%u[%u_][%u%d_]*%f[%s%+%*%-%.%)%]}%?%^%%=/<>~|&;:,!]",
|
{ pattern = "_?%u[%u_][%u%d_]*%f[%s%+%*%-%.%)%]}%?%^%%=/<>~|&;:,!]",
|
||||||
type = "number"
|
type = "number"
|
||||||
},
|
},
|
||||||
-- Magic constants
|
-- Magic constants
|
||||||
{ pattern = "__[%u%l]+__", type = "number" },
|
{ pattern = "__[%u%l]+__", type = "number" },
|
||||||
-- all other functions
|
-- all other functions
|
||||||
{ pattern = "[%a_][%w_]*%f[(]", type = "function" },
|
{ pattern = "[%a_][%w_]*%f[(]", type = "function" },
|
||||||
-- Macros
|
-- Macros
|
||||||
{ pattern = "^%s*#%s*define%s+()[%a_][%a%d_]*",
|
{ pattern = "^%s*#%s*define%s+()[%a_][%a%d_]*",
|
||||||
type = { "keyword", "symbol" }
|
type = { "keyword", "symbol" }
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,7 +10,7 @@ syntax.add {
|
||||||
comment = "//",
|
comment = "//",
|
||||||
block_comment = { "/*", "*/" },
|
block_comment = { "/*", "*/" },
|
||||||
patterns = {
|
patterns = {
|
||||||
{ pattern = "//.-\n", type = "comment" },
|
{ pattern = "//.*", type = "comment" },
|
||||||
{ pattern = { "/%*", "%*/" }, type = "comment" },
|
{ pattern = { "/%*", "%*/" }, type = "comment" },
|
||||||
{ pattern = { '"', '"', '\\' }, type = "string" },
|
{ pattern = { '"', '"', '\\' }, type = "string" },
|
||||||
{ pattern = { "'", "'", '\\' }, type = "string" },
|
{ pattern = { "'", "'", '\\' }, type = "string" },
|
||||||
|
|
|
@ -7,7 +7,7 @@ syntax.add {
|
||||||
block_comment = { "/*", "*/" },
|
block_comment = { "/*", "*/" },
|
||||||
patterns = {
|
patterns = {
|
||||||
{ pattern = "\\.", type = "normal" },
|
{ pattern = "\\.", type = "normal" },
|
||||||
{ pattern = "//.-\n", type = "comment" },
|
{ pattern = "//.*", type = "comment" },
|
||||||
{ pattern = { "/%*", "%*/" }, type = "comment" },
|
{ pattern = { "/%*", "%*/" }, type = "comment" },
|
||||||
{ pattern = { '"', '"', '\\' }, type = "string" },
|
{ pattern = { '"', '"', '\\' }, type = "string" },
|
||||||
{ pattern = { "'", "'", '\\' }, type = "string" },
|
{ pattern = { "'", "'", '\\' }, type = "string" },
|
||||||
|
|
|
@ -3,7 +3,7 @@ local syntax = require "core.syntax"
|
||||||
|
|
||||||
syntax.add {
|
syntax.add {
|
||||||
name = "HTML",
|
name = "HTML",
|
||||||
files = { "%.html?$" },
|
files = { "%.html?$" },
|
||||||
block_comment = { "<!--", "-->" },
|
block_comment = { "<!--", "-->" },
|
||||||
patterns = {
|
patterns = {
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,7 @@ syntax.add {
|
||||||
comment = "//",
|
comment = "//",
|
||||||
block_comment = { "/*", "*/" },
|
block_comment = { "/*", "*/" },
|
||||||
patterns = {
|
patterns = {
|
||||||
{ pattern = "//.-\n", type = "comment" },
|
{ pattern = "//.*", type = "comment" },
|
||||||
{ pattern = { "/%*", "%*/" }, type = "comment" },
|
{ pattern = { "/%*", "%*/" }, type = "comment" },
|
||||||
{ pattern = { '/[^= ]', '/', '\\' },type = "string" },
|
{ pattern = { '/[^= ]', '/', '\\' },type = "string" },
|
||||||
{ pattern = { '"', '"', '\\' }, type = "string" },
|
{ pattern = { '"', '"', '\\' }, type = "string" },
|
||||||
|
|
|
@ -12,7 +12,7 @@ syntax.add {
|
||||||
{ pattern = { "'", "'", '\\' }, type = "string" },
|
{ pattern = { "'", "'", '\\' }, type = "string" },
|
||||||
{ pattern = { "%[%[", "%]%]" }, type = "string" },
|
{ pattern = { "%[%[", "%]%]" }, type = "string" },
|
||||||
{ pattern = { "%-%-%[%[", "%]%]"}, type = "comment" },
|
{ pattern = { "%-%-%[%[", "%]%]"}, type = "comment" },
|
||||||
{ pattern = "%-%-.-\n", type = "comment" },
|
{ pattern = "%-%-.*", type = "comment" },
|
||||||
{ pattern = "0x%x+%.%x*[pP][-+]?%d+", type = "number" },
|
{ pattern = "0x%x+%.%x*[pP][-+]?%d+", type = "number" },
|
||||||
{ pattern = "0x%x+%.%x*", type = "number" },
|
{ pattern = "0x%x+%.%x*", type = "number" },
|
||||||
{ pattern = "0x%.%x+[pP][-+]?%d+", type = "number" },
|
{ pattern = "0x%.%x+[pP][-+]?%d+", type = "number" },
|
||||||
|
|
|
@ -51,7 +51,7 @@ syntax.add {
|
||||||
type = { "function", "number", "function" }
|
type = { "function", "number", "function" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern = "^%s*%[%^?()["..in_squares_match.."]+()%]:%s+.+\n",
|
pattern = "^%s*%[%^?()["..in_squares_match.."]+()%]:%s+.*",
|
||||||
type = { "function", "number", "function" }
|
type = { "function", "number", "function" }
|
||||||
},
|
},
|
||||||
-- optimization
|
-- optimization
|
||||||
|
@ -154,9 +154,9 @@ syntax.add {
|
||||||
-- highlight
|
-- highlight
|
||||||
{ pattern = { "==", "==" }, type = "literal" },
|
{ pattern = { "==", "==" }, type = "literal" },
|
||||||
-- lines
|
-- lines
|
||||||
{ pattern = "^%-%-%-+\n", type = "comment" },
|
{ pattern = "^%-%-%-+$" , type = "comment" },
|
||||||
{ pattern = "^%*%*%*+\n", type = "comment" },
|
{ pattern = "^%*%*%*+$", type = "comment" },
|
||||||
{ pattern = "^___+\n", type = "comment" },
|
{ pattern = "^___+$", type = "comment" },
|
||||||
-- bold and italic
|
-- bold and italic
|
||||||
{ pattern = { "%*%*%*%S", "%*%*%*" }, type = "markdown_bold_italic" },
|
{ pattern = { "%*%*%*%S", "%*%*%*" }, type = "markdown_bold_italic" },
|
||||||
{ pattern = { "%*%*%S", "%*%*" }, type = "markdown_bold" },
|
{ pattern = { "%*%*%S", "%*%*" }, type = "markdown_bold" },
|
||||||
|
@ -175,7 +175,7 @@ syntax.add {
|
||||||
type = { "keyword", "function", "string", "function" }
|
type = { "keyword", "function", "string", "function" }
|
||||||
},
|
},
|
||||||
-- headings
|
-- headings
|
||||||
{ pattern = "^#+%s.+\n", type = "keyword" },
|
{ pattern = "^#+%s.+$", type = "keyword" },
|
||||||
-- superscript and subscript
|
-- superscript and subscript
|
||||||
{
|
{
|
||||||
pattern = "%^()%d+()%^",
|
pattern = "%^()%d+()%^",
|
||||||
|
|
|
@ -7,7 +7,7 @@ syntax.add {
|
||||||
headers = "^#!.*[ /]python",
|
headers = "^#!.*[ /]python",
|
||||||
comment = "#",
|
comment = "#",
|
||||||
patterns = {
|
patterns = {
|
||||||
{ pattern = { "#", "\n" }, type = "comment" },
|
{ pattern = "#.*", type = "comment" },
|
||||||
{ pattern = { '[ruU]?"""', '"""'; '\\' }, type = "string" },
|
{ pattern = { '[ruU]?"""', '"""'; '\\' }, type = "string" },
|
||||||
{ pattern = { "[ruU]?'''", "'''", '\\' }, type = "string" },
|
{ pattern = { "[ruU]?'''", "'''", '\\' }, type = "string" },
|
||||||
{ pattern = { '[ruU]?"', '"', '\\' }, type = "string" },
|
{ pattern = { '[ruU]?"', '"', '\\' }, type = "string" },
|
||||||
|
|
Loading…
Reference in New Issue