Ignore shebangs at the top of a script

Sat, 06 Feb 2016 14:38:17 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 06 Feb 2016 14:38:17 +0000
changeset 77
38066f635004
parent 76
fecc1af937be
child 78
54bb54fe9ed2

Ignore shebangs at the top of a script

scansion/parser.lua file | annotate | diff | comparison | revisions
--- a/scansion/parser.lua	Thu Feb 04 17:22:28 2016 +0000
+++ b/scansion/parser.lua	Sat Feb 06 14:38:17 2016 +0000
@@ -34,7 +34,7 @@
 			-- Blank line or comment
 			local in_header = (next(parsed.objects) == nil) and (next(parsed.actions) == nil);
 			if in_header and #line > 0 then
-				if line_number == 1 then
+				if not parsed.title and not line:match("^#!") then
 					parsed.title = line:gsub("^[#-]+%s*", "");
 				else
 					parsed.summary = (parsed.summary and parsed.summary.."\n" or "")..line:gsub("^[#-]+%s*", "");

mercurial