diff options
author | Undecidable Robot <undecidabot@gmail.com> | 2016-05-16 21:07:03 +0800 |
---|---|---|
committer | Undecidable Robot <undecidabot@gmail.com> | 2016-05-16 21:07:03 +0800 |
commit | 043f455b6ef018b7ee06829845fd7b1f9f08f74f (patch) | |
tree | cae9ac24866e766d0b11076cfaf69e4890bfabf4 /relabel.lua | |
parent | 977213610df9ca3065de4ae60c7cf012c46f2834 (diff) | |
download | lpeglabel-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.lua | 6 |
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 | ||
130 | local num = m.C(m.R"09"^1) * S / tonumber | 130 | local num = m.C(m.R"09"^1) * S / tonumber |
131 | 131 | ||
132 | local String = "'" * m.C((any - "'")^0) * ("'" + throw(31)) + | 132 | local 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 | ||
136 | local defined = "%" * Def / function (c,Defs) | 136 | local 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 |