summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/parser/grammar.lua2
-rw-r--r--syntaxes/lua.tmLanguage.json18
2 files changed, 13 insertions, 7 deletions
diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua
index 7f8284a0..a876c3ba 100644
--- a/server/src/parser/grammar.lua
+++ b/server/src/parser/grammar.lua
@@ -482,7 +482,7 @@ RepeatBody <- REPEAT
BreakEnd
NeedUntil DirtyExp
-LocalTag <- (Sp '<' MustName LocalTagEnd)*
+LocalTag <- (Sp '<' Sp MustName Sp LocalTagEnd)*
-> LocalTag
LocalTagEnd <- '>' / {} -> MissGT
Local <- (LOCAL LocalTag NameList (ASSIGN ExpList)?)
diff --git a/syntaxes/lua.tmLanguage.json b/syntaxes/lua.tmLanguage.json
index b2ecc8eb..3fcbda67 100644
--- a/syntaxes/lua.tmLanguage.json
+++ b/syntaxes/lua.tmLanguage.json
@@ -225,16 +225,22 @@
"name": "keyword.control.lua"
},
{
- "match": "\\b(local)\\b(?:\\s*)*",
+ "match": "\\b(local)\\b",
"name": "keyword.local.lua"
},
{
- "captures": {
- "1": {
- "name": "string.tag.lua"
+ "begin": "(?<=local)",
+ "end": "(?=[a-zA-Z_=])",
+ "patterns": [
+ {
+ "match": "<\\s*([a-zA-Z_][a-zA-Z0-9_]*)",
+ "captures": {
+ "1": {
+ "name": "string.tag.lua"
+ }
+ }
}
- },
- "match": "<([a-zA-Z_][a-zA-Z0-9_]*)>"
+ ]
},
{
"match": "\\b(function)\\b",