From a202d2a2a3904006d33076ebae9a99810dae87da Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sun, 21 Apr 2024 11:53:36 -0400 Subject: Made {{ a thing. --- src/lpm.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lpm.lua b/src/lpm.lua index 457fa06..e39d1a9 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -2447,8 +2447,9 @@ not commonly used publically. if arg:sub(offset, offset) == "{" then s,e = arg:find("%b{}", offset) if not e then error(string.format("no end to chunk %s", arg:sub(offset))) end - local chunk = arg:sub(s + 1, e - 1) - local func, err = load("local addon = ... return " .. chunk) + local amount = arg:sub(offset+1, offset+1) == "{" and 2 or 1 + local chunk = arg:sub(s + amount, e - amount) + local func, err = load("local addon = ... " .. (amount == 2 and "return" or "") .. " " .. chunk) if err then error(string.format("can't parse chunk %s: %s", chunk, err)) end result[i] = func offset = e + 1 -- cgit v1.2.3