diff options
author | Aki <please@ignore.pl> | 2023-12-14 01:32:26 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2023-12-14 01:32:26 +0100 |
commit | 02cb3c8b3cbd150522aa855cfc5cfaf0ec2269f0 (patch) | |
tree | f6bdafa713af35560aa8e2fd9b747f35be92f727 | |
parent | 4d3eabb6098be217f7dee0015f708d9264b69243 (diff) | |
download | lua-srcinfo-02cb3c8b3cbd150522aa855cfc5cfaf0ec2269f0.zip lua-srcinfo-02cb3c8b3cbd150522aa855cfc5cfaf0ec2269f0.tar.gz lua-srcinfo-02cb3c8b3cbd150522aa855cfc5cfaf0ec2269f0.tar.bz2 |
Added safety to match only the full string
-rw-r--r-- | srcinfo.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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) |