summaryrefslogtreecommitdiff
path: root/server/src/parser
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/parser')
-rw-r--r--server/src/parser/ast.lua3
-rw-r--r--server/src/parser/grammar.lua8
2 files changed, 8 insertions, 3 deletions
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