Skip to content

Commit 40d169b

Browse files
committedSep 15, 2017
Hopefully fixed conditional lambda parsing.
1 parent 7accff7 commit 40d169b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

Diff for: ‎selene/lib/selene/parser.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ end
243243
local function split(self, sep, empty)
244244
local t = {}
245245
local i = 1
246-
for str in self:gmatch(string.format("([^%s]%s)", sep, empty and "*" or "+")) do
246+
for str in self:gmatch(string.format("([^%s]+)", sep)) do
247247
t[i] = trim(str)
248248
i = i + 1
249249
end
@@ -269,7 +269,7 @@ local function findLambda(tokens, i, part, line, stripcomments)
269269
local step = i - 1
270270
local inst, step = bracket(tokens, ")", "(", step, "", -1)
271271

272-
local cond = split(inst, "!", true)
272+
local cond = {string.match(inst, "([^!]*)!(.*)")}
273273
inst = cond[1] or inst
274274
local params = split(inst, ",")
275275

0 commit comments

Comments
 (0)