aboutsummaryrefslogtreecommitdiff
path: root/relabel.lua
diff options
context:
space:
mode:
Diffstat (limited to 'relabel.lua')
-rw-r--r--relabel.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/relabel.lua b/relabel.lua
index 642b0fe..abb3c7f 100644
--- a/relabel.lua
+++ b/relabel.lua
@@ -45,7 +45,7 @@ local errinfo = {
45 45
46 {"ExpPattOrClose", "expected a pattern or closing '}' after '{'"}, 46 {"ExpPattOrClose", "expected a pattern or closing '}' after '{'"},
47 47
48 {"ExpNum", "expected a number after '^', '+' or '-' (no space)"}, 48 {"ExpNumName", "expected a number, '+', '-' or a name (no space) after '^'"},
49 {"ExpCap", "expected a string, number, '{}' or name after '->'"}, 49 {"ExpCap", "expected a string, number, '{}' or name after '->'"},
50 50
51 {"ExpName1", "expected the name of a rule after '=>'"}, 51 {"ExpName1", "expected the name of a rule after '=>'"},
@@ -245,7 +245,7 @@ local function getlab (f)
245 if not tlabels[f] then 245 if not tlabels[f] then
246 error("undefined label: " .. f) 246 error("undefined label: " .. f)
247 end 247 end
248 return mm.T(tlabels[f]) 248 return tlabels[f]
249end 249end
250 250
251local exp = m.P{ "Exp", 251local exp = m.P{ "Exp",
@@ -269,7 +269,7 @@ local exp = m.P{ "Exp",
269 + m.Cg(m.C(m.S"+-" * m.R"09"^1) * m.Cc(mt.__pow) 269 + m.Cg(m.C(m.S"+-" * m.R"09"^1) * m.Cc(mt.__pow)
270 + name * m.Cc"lab" 270 + name * m.Cc"lab"
271 ), 271 ),
272 "ExpNum") 272 "ExpNumName")
273 + "->" * expect(S * ( m.Cg((String + num) * m.Cc(mt.__div)) 273 + "->" * expect(S * ( m.Cg((String + num) * m.Cc(mt.__div))
274 + m.P"{}" * m.Cc(nil, m.Ct) 274 + m.P"{}" * m.Cc(nil, m.Ct)
275 + m.Cg(Def / getdef * m.Cc(mt.__div)) 275 + m.Cg(Def / getdef * m.Cc(mt.__div))
@@ -278,7 +278,7 @@ local exp = m.P{ "Exp",
278 + "=>" * expect(S * m.Cg(Def / getdef * m.Cc(m.Cmt)), 278 + "=>" * expect(S * m.Cg(Def / getdef * m.Cc(m.Cmt)),
279 "ExpName1") 279 "ExpName1")
280 ) 280 )
281 )^0, function (a,b,f) if f == "lab" then return a + getlab(b) else return f(a,b) end end ); 281 )^0, function (a,b,f) if f == "lab" then return a + mm.T(getlab(b)) else return f(a,b) end end );
282 Primary = "(" * expect(m.V"Exp", "ExpPatt4") * expect(S * ")", "MisClose1") 282 Primary = "(" * expect(m.V"Exp", "ExpPatt4") * expect(S * ")", "MisClose1")
283 + String / mm.P 283 + String / mm.P
284 + Class 284 + Class