scansion.parser: Ensure script objects always have tags, even if empty

Wed, 12 Sep 2018 11:36:06 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 12 Sep 2018 11:36:06 +0100
changeset 147
db39e8e9146c
parent 146
885fa9f5929d
child 148
e2c85e095a4c

scansion.parser: Ensure script objects always have tags, even if empty

scansion/parser.lua file | annotate | diff | comparison | revisions
--- a/scansion/parser.lua	Wed Sep 12 10:58:46 2018 +0100
+++ b/scansion/parser.lua	Wed Sep 12 11:36:06 2018 +0100
@@ -2,6 +2,7 @@
 	local parsed = {
 		objects = {};
 		actions = {};
+		tags = {};
 	};
 	
 	local line_number = 0;
@@ -37,9 +38,6 @@
 				if not parsed.title and not line:match("^#!") then
 					parsed.title = line:gsub("^[#-]+%s*", "");
 				elseif line:match("^##") then
-					if not parsed.tags then
-						parsed.tags = {};
-					end
 					local tag = line:gsub("^##%s*", "");
 					local k, v = tag:match("^([^:]+):%s*(.+)$");
 					if k then

mercurial