diff options
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/core/vm.lua | 4 | ||||
-rw-r--r-- | server/src/parser/ast.lua | 3 | ||||
-rw-r--r-- | server/src/parser/grammar.lua | 8 |
3 files changed, 12 insertions, 3 deletions
diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua index 36a8f21b..a17727d6 100644 --- a/server/src/core/vm.lua +++ b/server/src/core/vm.lua @@ -1383,6 +1383,10 @@ function mt:doLocalFunction(action) end function mt:doAction(action) + if not action then + -- Skip + return + end local tp = action.type if tp == 'do' then self:doDo(action) diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua index d08db694..993a4914 100644 --- a/server/src/parser/ast.lua +++ b/server/src/parser/ast.lua @@ -379,6 +379,9 @@ local defs = { Nothing = function () return nil end, + Skip = function () + return false + end, Set = function (keys, values) return { type = 'set', diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua index 133ffbbd..6dfbeed6 100644 --- a/server/src/parser/grammar.lua +++ b/server/src/parser/grammar.lua @@ -75,8 +75,8 @@ end local function errorpos(pos, err) return { type = 'UNKNOWN', - start = pos, - finish = pos, + start = pos or 0, + finish = pos or 0, err = err, } end @@ -351,7 +351,7 @@ Set <- END grammar 'Action' [[ Action <- Sp (CrtAction / UnkAction) -CrtAction <- SEMICOLON +CrtAction <- Semicolon / Do / Break / Return @@ -372,6 +372,8 @@ UnkAction <- ({} {Word+}) / ({} {. (!Sps !CrtAction .)*}) -> UnknownSymbol +Semicolon <- SEMICOLON + -> Skip SimpleList <- (Simple (COMMA Simple)*) -> List |