From 02cb3c8b3cbd150522aa855cfc5cfaf0ec2269f0 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 14 Dec 2023 01:32:26 +0100 Subject: Added safety to match only the full string --- srcinfo.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcinfo.lua b/srcinfo.lua index 2612fd4..9982a98 100644 --- a/srcinfo.lua +++ b/srcinfo.lua @@ -8,7 +8,7 @@ local definition = whitespace * lpeg.C(identifier) * whitespace * "=" * whitespa local emptylines = (whitespace * newline)^1 local comment = lpeg.P"#" * rest * newline local block = lpeg.Ct((lpeg.Ct(definition) + comment)^1) -local thing = emptylines^0 * block * (emptylines * block)^0 +local thing = emptylines^0 * block * (emptylines * block)^0 * emptylines^0 * -lpeg.P(1) local capture = lpeg.Ct(thing) -- cgit v1.1