diff options
Diffstat (limited to 'server/src/parser')
-rw-r--r-- | server/src/parser/ast.lua | 8 | ||||
-rw-r--r-- | server/src/parser/grammar.lua | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua index a83f5abf..0be0027d 100644 --- a/server/src/parser/ast.lua +++ b/server/src/parser/ast.lua @@ -996,10 +996,14 @@ local Defs = { end return tags end, - Local = function (tags, keys, values) + LocalName = function (tags, name) + name.tags = tags + return name + end, + Local = function (keys, values) return { type = 'local', - keys, values, tags + keys, values, } end, DoBody = function (...) diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua index a923e5eb..aa44a3ce 100644 --- a/server/src/parser/grammar.lua +++ b/server/src/parser/grammar.lua @@ -493,10 +493,15 @@ RepeatBody <- REPEAT LocalTag <- (Sp '<' Sp MustName Sp LocalTagEnd)* -> LocalTag LocalTagEnd <- '>' / {} -> MissGT -Local <- (LOCAL LocalTag NameList (AssignOrEQ ExpList)?) +Local <- (LOCAL LocalNameList (AssignOrEQ ExpList)?) -> Local Set <- (SimpleList AssignOrEQ ExpList?) -> Set +LocalNameList + <- (LocalName (COMMA LocalName)*) + -> List +LocalName <- (LocalTag MustName) + -> LocalName Call <- Simple -> SimpleCall |