aboutsummaryrefslogtreecommitdiff
path: root/testlabel.lua
diff options
context:
space:
mode:
authorSergio Queiroz <sqmedeiros@gmail.com>2016-09-09 16:26:44 -0300
committerSergio Queiroz <sqmedeiros@gmail.com>2016-09-09 16:26:44 -0300
commita9c5a38994074d2c9c5da4cf081c4ca9fa8b3271 (patch)
tree3f060fb9f4280cd06a0c1ad376af1b36f95a8219 /testlabel.lua
parent7757aac333c5a37181f942d5f20223023cbdc207 (diff)
downloadlpeglabel-a9c5a38994074d2c9c5da4cf081c4ca9fa8b3271.tar.gz
lpeglabel-a9c5a38994074d2c9c5da4cf081c4ca9fa8b3271.tar.bz2
lpeglabel-a9c5a38994074d2c9c5da4cf081c4ca9fa8b3271.zip
Updating implementation of Recovery to follow Fabio's idea. Not compatible with labeled ordered choice
Diffstat (limited to 'testlabel.lua')
-rw-r--r--testlabel.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/testlabel.lua b/testlabel.lua
index cbe623c..8cfb671 100644
--- a/testlabel.lua
+++ b/testlabel.lua
@@ -1,4 +1,4 @@
1local m = require 'lpeglabel' 1local m = require 'lpeglabelrec'
2 2
3local p, r, l, s, serror 3local p, r, l, s, serror
4 4
@@ -557,6 +557,7 @@ print("+")
557p = m.Rec("a", "b") 557p = m.Rec("a", "b")
558assert(p:match("a") == 2) 558assert(p:match("a") == 2)
559--assert(p:match("b") == 2) 559--assert(p:match("b") == 2)
560checkeqlab({nil, 0, "b"}, p:match("b"))
560checkeqlab({nil, 0, "c"}, p:match("c")) 561checkeqlab({nil, 0, "c"}, p:match("c"))
561 562
562p = m.Rec("a", "b", 3) 563p = m.Rec("a", "b", 3)
@@ -607,7 +608,7 @@ C -> c+
607]] 608]]
608g = m.P{ 609g = m.P{
609 "S", 610 "S",
610 S = m.Rec(m.V"A", (-m.P"c" * m.P(1))^0) * m.V"C", 611 S = m.Rec(m.V"A", (-m.P"c" * m.P(1))^0, 0) * m.V"C", --explicitly put 0 in Rec
611 A = m.P"a"^0 * m.P"b" + m.T(0), 612 A = m.P"a"^0 * m.P"b" + m.T(0),
612 C = m.P"c"^1, 613 C = m.P"c"^1,
613} 614}