summaryrefslogtreecommitdiff
path: root/syntaxes
diff options
context:
space:
mode:
Diffstat (limited to 'syntaxes')
-rw-r--r--syntaxes/lua.tmLanguage.json96
1 files changed, 56 insertions, 40 deletions
diff --git a/syntaxes/lua.tmLanguage.json b/syntaxes/lua.tmLanguage.json
index 203603d5..7194cca5 100644
--- a/syntaxes/lua.tmLanguage.json
+++ b/syntaxes/lua.tmLanguage.json
@@ -16,13 +16,16 @@
"name": "meta.function.lua",
"patterns": [
{
+ "include": "#comment"
+ },
+ {
"begin": "(\\()",
"beginCaptures": {
"1": {
"name": "punctuation.definition.parameters.begin.lua"
}
},
- "end": "(?!.)",
+ "end": "(\\))|(?!.)",
"endCaptures": {
"1": {
"name": "punctuation.definition.parameters.finish.lua"
@@ -31,6 +34,9 @@
"name": "meta.parameter.lua",
"patterns": [
{
+ "include": "#comment"
+ },
+ {
"match": "[a-zA-Z_][a-zA-Z0-9_]*",
"name": "variable.parameter.function.lua"
},
@@ -157,45 +163,7 @@
"name": "comment.line.shebang.lua"
},
{
- "begin": "(^[ \\t]+)?(?=--)",
- "beginCaptures": {
- "1": {
- "name": "punctuation.whitespace.comment.leading.lua"
- }
- },
- "end": "(?!\\G)((?!^)[ \\t]+\\n)?",
- "endCaptures": {
- "1": {
- "name": "punctuation.whitespace.comment.trailing.lua"
- }
- },
- "patterns": [
- {
- "begin": "--\\[(=*)\\[",
- "beginCaptures": {
- "0": {
- "name": "punctuation.definition.comment.begin.lua"
- }
- },
- "end": "\\]\\1\\]",
- "endCaptures": {
- "0": {
- "name": "punctuation.definition.comment.end.lua"
- }
- },
- "name": "comment.block.lua"
- },
- {
- "begin": "--",
- "beginCaptures": {
- "0": {
- "name": "punctuation.definition.comment.lua"
- }
- },
- "end": "\\n",
- "name": "comment.line.double-dash.lua"
- }
- ]
+ "include": "#comment"
},
{
"captures": {
@@ -233,6 +201,9 @@
"end": "(?=[a-zA-Z_=])",
"patterns": [
{
+ "include": "#comment"
+ },
+ {
"match": "<\\s*([a-zA-Z_][a-zA-Z0-9_]*)",
"captures": {
"1": {
@@ -307,6 +278,51 @@
"name": "invalid.illegal.character.escape.lua"
}
]
+ },
+ "comment": {
+ "patterns": [
+ {
+ "begin": "(^[ \\t]+)?(?=--)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.whitespace.comment.leading.lua"
+ }
+ },
+ "end": "(?!\\G)((?!^)[ \\t]+\\n)?",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.whitespace.comment.trailing.lua"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "--\\[(=*)\\[",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.begin.lua"
+ }
+ },
+ "end": "\\]\\1\\]",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.end.lua"
+ }
+ },
+ "name": "comment.block.lua"
+ },
+ {
+ "begin": "--",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.lua"
+ }
+ },
+ "end": "\\n",
+ "name": "comment.line.double-dash.lua"
+ }
+ ]
+ }
+ ]
}
}
}