diff options
Diffstat (limited to 'srcinfo.lua')
-rw-r--r-- | srcinfo.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/srcinfo.lua b/srcinfo.lua index 40ae7d1..ef40cd9 100644 --- a/srcinfo.lua +++ b/srcinfo.lua @@ -22,7 +22,7 @@ local whitespace = lpeg.S" \t"^0 local newline = lpeg.P"\r\n" + "\n" local rest = (1 - newline)^0 local definition = lpeg.Cc"definition" * whitespace * lpeg.C(identifier) * whitespace * "=" * whitespace * lpeg.C(rest) -local comment = lpeg.Cc"comment" * lpeg.P"#" * whitespace * lpeg.C(rest) +local comment = lpeg.Cc"comment" * whitespace * lpeg.P"#" * lpeg.C(rest) local empty = lpeg.Cc"empty" * whitespace local invalid = lpeg.Cc"invalid" * lpeg.C(rest) local line = lpeg.Carg(1) * (definition + comment + empty + invalid) / apply * newline @@ -32,12 +32,11 @@ local capture = lpeg.Ct(line^0) * -lpeg.P(1) local function srcinfo (text, options) options = options or {} - mode = modes[options.mode] or PKGNAME return capture:match( text, nil, { - mode = mode, + mode = modes[options.mode] or PKGNAME, base = nil, current = nil, definition = function (self, name, value) |