add toggle-block-comment

This commit is contained in:
takase1121
2021-12-25 12:57:00 +08:00
parent 4be8a8b582
commit 4d31b1bc40
9 changed files with 71 additions and 15 deletions
+1
View File
@@ -5,6 +5,7 @@ syntax.add {
name = "C",
files = { "%.c$", "%.h$", "%.inl$" },
comment = "//",
multiline_comment = { "/*", "*/" },
patterns = {
{ pattern = "//.-\n", type = "comment" },
{ pattern = { "/%*", "%*/" }, type = "comment" },
+1
View File
@@ -10,6 +10,7 @@ syntax.add {
"%.c++$", "%.hh$", "%.H$", "%.hxx$", "%.hpp$", "%.h++$"
},
comment = "//",
multiline_comment = { "/*", "*/" },
patterns = {
{ pattern = "//.-\n", type = "comment" },
{ pattern = { "/%*", "%*/" }, type = "comment" },
+1
View File
@@ -4,6 +4,7 @@ local syntax = require "core.syntax"
syntax.add {
name = "CSS",
files = { "%.css$" },
multiline_comment = { "/*", "*/" },
patterns = {
{ pattern = "\\.", type = "normal" },
{ pattern = "//.-\n", type = "comment" },
+16 -15
View File
@@ -4,28 +4,29 @@ local syntax = require "core.syntax"
syntax.add {
name = "HTML",
files = { "%.html?$" },
multiline_comment = { "<!--", "-->" },
patterns = {
{
pattern = {
{
pattern = {
"<%s*[sS][cC][rR][iI][pP][tT]%s+[tT][yY][pP][eE]%s*=%s*" ..
"['\"]%a+/[jJ][aA][vV][aA][sS][cC][rR][iI][pP][tT]['\"]%s*>",
"<%s*/[sS][cC][rR][iI][pP][tT]>"
},
syntax = ".js",
type = "function"
},
{
pattern = {
"<%s*[sS][cC][rR][iI][pP][tT]%s*>",
"<%s*/%s*[sS][cC][rR][iI][pP][tT]>"
"<%s*/[sS][cC][rR][iI][pP][tT]>"
},
syntax = ".js",
type = "function"
},
{
pattern = {
"<%s*[sS][tT][yY][lL][eE][^>]*>",
"<%s*/%s*[sS][tT][yY][lL][eE]%s*>"
{
pattern = {
"<%s*[sS][cC][rR][iI][pP][tT]%s*>",
"<%s*/%s*[sS][cC][rR][iI][pP][tT]>"
},
syntax = ".js",
type = "function"
},
{
pattern = {
"<%s*[sS][tT][yY][lL][eE][^>]*>",
"<%s*/%s*[sS][tT][yY][lL][eE]%s*>"
},
syntax = ".css",
type = "function"
+1
View File
@@ -5,6 +5,7 @@ syntax.add {
name = "JavaScript",
files = { "%.js$", "%.json$", "%.cson$" },
comment = "//",
multiline_comment = { "/*", "*/" },
patterns = {
{ pattern = "//.-\n", type = "comment" },
{ pattern = { "/%*", "%*/" }, type = "comment" },
+1
View File
@@ -6,6 +6,7 @@ syntax.add {
files = "%.lua$",
headers = "^#!.*[ /]lua",
comment = "--",
multiline_comment = { "--[[", "]]" },
patterns = {
{ pattern = { '"', '"', '\\' }, type = "string" },
{ pattern = { "'", "'", '\\' }, type = "string" },
+1
View File
@@ -5,6 +5,7 @@ syntax.add {
name = "XML",
files = { "%.xml$" },
headers = "<%?xml",
multiline_comment = { "<!--", "-->" },
patterns = {
{ pattern = { "<!%-%-", "%-%->" }, type = "comment" },
{ pattern = { '%f[^>][^<]', '%f[<]' }, type = "normal" },