Skip to content

Commit 31bc49b

Browse files
committed
fix(bundle): handle ]] case
1 parent a0d2759 commit 31bc49b

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package.preload["plugin.submodule"] = assert(load([=[
2+
return [[
3+
some text
4+
]]
5+
6+
]=], "plugin.submodule"))
7+
8+
local submodule = require("plugin.submodule")
9+
10+
return submodule .. "!"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
local submodule = require("plugin.submodule")
2+
3+
return submodule .. "!"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
return [[
2+
some text
3+
]]

src/luarocks/build/lls-addon/bundle.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ local function formatPreloadFile(path, moduleName)
2424
local text = assertContext("when reading from bundled file", f:read("a"))
2525

2626
local maxChainEqs = -1
27-
for chain in string.gmatch(text, "%](%=+)%]") do
27+
for chain in string.gmatch(text, "%](%=*)%]") do
2828
maxChainEqs = math.max(maxChainEqs, string.len(chain))
2929
end
3030

0 commit comments

Comments
 (0)