diff options
Diffstat (limited to 'script/parser/newparser.lua')
-rw-r--r-- | script/parser/newparser.lua | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua index 0b721a7a..0132350b 100644 --- a/script/parser/newparser.lua +++ b/script/parser/newparser.lua @@ -487,7 +487,13 @@ end local function skipComment(isAction) local token = Tokens[Index + 1] if token == '--' - or (token == '//' and isAction) then + or ( + token == '//' + and ( + isAction + or State.options.nonstandardSymbol['//'] + ) + ) then local start = Tokens[Index] local left = getPosition(start, 'left') local chead = false @@ -1527,7 +1533,7 @@ local function parseTable() local index = 0 local wantSep = false while true do - skipSpace() + skipSpace(true) local token = Tokens[Index + 1] if token == '}' then Index = Index + 2 @@ -2094,6 +2100,7 @@ local function parseParams(params) start = getPosition(Tokens[Index], 'left'), finish = getPosition(Tokens[Index] + 2, 'right'), parent = params, + [1] = '...', } local chunk = Chunk[#Chunk] chunk.vararg = vararg @@ -2161,7 +2168,7 @@ local function parseFunction(isLocal, isAction) Index = Index + 2 local LastLocalCount = LocalCount LocalCount = 0 - skipSpace() + skipSpace(true) local hasLeftParen = Tokens[Index + 1] == '(' if not hasLeftParen then local name = parseName() @@ -2191,7 +2198,7 @@ local function parseFunction(isLocal, isAction) finish = simple.finish, } end - skipSpace() + skipSpace(true) hasLeftParen = Tokens[Index + 1] == '(' end end @@ -2222,7 +2229,7 @@ local function parseFunction(isLocal, isAction) params.parent = func func.args = params end - skipSpace() + skipSpace(true) if Tokens[Index + 1] == ')' then local parenRight = getPosition(Tokens[Index], 'right') func.finish = parenRight @@ -2230,7 +2237,7 @@ local function parseFunction(isLocal, isAction) params.finish = parenRight end Index = Index + 2 - skipSpace() + skipSpace(true) else func.finish = lastRightPosition() if params then @@ -2339,6 +2346,9 @@ local function parseBinaryOP(asAction, level) if not symbol then return nil end + if symbol == '//' and State.options.nonstandardSymbol['//'] then + return nil + end local myLevel = BinarySymbol[symbol] if level and myLevel < level then return nil |