aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Queiroz <sqmedeiros@gmail.com>2017-06-23 13:43:39 -0300
committerSergio Queiroz <sqmedeiros@gmail.com>2017-06-23 13:43:39 -0300
commitce152c9d10b57b8a7d33ea7ec695c037b0028f40 (patch)
treec2414538a5a17e2d0adebf507502e9f164b6122f
parentfc7fd10621ba6777fe961d1425e90c080d1f2617 (diff)
downloadlpeglabel-ce152c9d10b57b8a7d33ea7ec695c037b0028f40.tar.gz
lpeglabel-ce152c9d10b57b8a7d33ea7ec695c037b0028f40.tar.bz2
lpeglabel-ce152c9d10b57b8a7d33ea7ec695c037b0028f40.zip
Fixing bug when getting the length of a table
-rw-r--r--relabel.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/relabel.lua b/relabel.lua
index cf76e89..b02c95d 100644
--- a/relabel.lua
+++ b/relabel.lua
@@ -222,7 +222,7 @@ local function choicerec (...)
222 local p = t[1] 222 local p = t[1]
223 local i = 2 223 local i = 2
224 while i + 1 <= n do 224 while i + 1 <= n do
225 -- t[i] == nil when there are no labels 225 -- t[i] == false when there are no labels
226 p = t[i] and mm.Rec(p, t[i+1], unpack(t[i])) or mt.__add(p, t[i+1]) 226 p = t[i] and mm.Rec(p, t[i+1], unpack(t[i])) or mt.__add(p, t[i+1])
227 i = i + 2 227 i = i + 2
228 end 228 end
@@ -232,7 +232,7 @@ end
232 232
233local exp = m.P{ "Exp", 233local exp = m.P{ "Exp",
234 Exp = S * ( m.V"Grammar" 234 Exp = S * ( m.V"Grammar"
235 + (m.V"Seq" * (S * (("//" * m.Ct(m.V"Labels")) + ("/" * m.Cc(nil))) 235 + (m.V"Seq" * (S * (("//" * m.Ct(m.V"Labels")) + ("/" * m.Cc(false)))
236 * expect(S * m.V"Seq", "ExpPatt1") 236 * expect(S * m.V"Seq", "ExpPatt1")
237 )^0 237 )^0
238 ) / choicerec); 238 ) / choicerec);