aboutsummaryrefslogtreecommitdiff
path: root/relabel.lua
diff options
context:
space:
mode:
authorUndecidable Robot <undecidabot@gmail.com>2016-05-16 21:07:03 +0800
committerUndecidable Robot <undecidabot@gmail.com>2016-05-16 21:07:03 +0800
commit043f455b6ef018b7ee06829845fd7b1f9f08f74f (patch)
treecae9ac24866e766d0b11076cfaf69e4890bfabf4 /relabel.lua
parent977213610df9ca3065de4ae60c7cf012c46f2834 (diff)
downloadlpeglabel-043f455b6ef018b7ee06829845fd7b1f9f08f74f.tar.gz
lpeglabel-043f455b6ef018b7ee06829845fd7b1f9f08f74f.tar.bz2
lpeglabel-043f455b6ef018b7ee06829845fd7b1f9f08f74f.zip
Adding better handling of unterminated strings
Diffstat (limited to 'relabel.lua')
-rw-r--r--relabel.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/relabel.lua b/relabel.lua
index e3b7d48..0594777 100644
--- a/relabel.lua
+++ b/relabel.lua
@@ -129,8 +129,8 @@ local Def = name * m.Carg(1)
129 129
130local num = m.C(m.R"09"^1) * S / tonumber 130local num = m.C(m.R"09"^1) * S / tonumber
131 131
132local String = "'" * m.C((any - "'")^0) * ("'" + throw(31)) + 132local String = "'" * m.C((any - "'" - m.P"\n")^0) * ("'" + throw(31)) +
133 '"' * m.C((any - '"')^0) * ('"' + throw(30)) 133 '"' * m.C((any - '"' - m.P"\n")^0) * ('"' + throw(30))
134 134
135 135
136local defined = "%" * Def / function (c,Defs) 136local defined = "%" * Def / function (c,Defs)
@@ -195,7 +195,7 @@ local exp = m.P{ "Exp",
195 Stuff = m.V"GroupedStuff" + any; 195 Stuff = m.V"GroupedStuff" + any;
196 GroupedStuff = "(" * (-m.P")" * m.V"Stuff")^0 * ")" 196 GroupedStuff = "(" * (-m.P")" * m.V"Stuff")^0 * ")"
197 + "{" * (-m.P"}" * m.V"Stuff")^0 * "}"; 197 + "{" * (-m.P"}" * m.V"Stuff")^0 * "}";
198 SeqLC = m.Lc(m.V"Seq", m.V"SkipToSlash", 5, 6, 7, 8, 9, 10); 198 SeqLC = m.Lc(m.V"Seq", m.V"SkipToSlash", 5, 6, 7, 8, 9, 10, 31, 30);
199 Seq = m.Cf(m.Cc(m.P"") * m.V"Prefix"^1 , mt.__mul); 199 Seq = m.Cf(m.Cc(m.P"") * m.V"Prefix"^1 , mt.__mul);
200 Prefix = "&" * S * (m.V"Prefix" + throw(5)) / mt.__len 200 Prefix = "&" * S * (m.V"Prefix" + throw(5)) / mt.__len
201 + "!" * S * (m.V"Prefix" + throw(6)) / mt.__unm 201 + "!" * S * (m.V"Prefix" + throw(6)) / mt.__unm