summaryrefslogtreecommitdiff
path: root/server/src/macroparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/macroparser.cc')
-rw-r--r--server/src/macroparser.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/server/src/macroparser.cc b/server/src/macroparser.cc
index bf6ff13..d1604b2 100644
--- a/server/src/macroparser.cc
+++ b/server/src/macroparser.cc
@@ -118,8 +118,7 @@ void MacroParser::characterData(std::string &data)
}
}
-void MacroParser::startTag(std::string name,
- std::map< std::string, std::string> attributes)
+void MacroParser::startTag(std::string name, attributes_t &attr)
{
// Create macro and enable parsing of queries, maps and widgets
if(name == "macro") {
@@ -129,7 +128,9 @@ void MacroParser::startTag(std::string name,
assert(!m); // A Macro has already been allocated, cannot create macro!
m = new Macro();
- m->attributes = attributes;
+
+ if(attr.find("name") != attr.end()) m->name = attr["name"];
+ if(attr.find("version") != attr.end()) m->version = attr["version"];
return;
}
@@ -139,7 +140,7 @@ void MacroParser::startTag(std::string name,
if(state != MACRO) error("resume found outside macro.");
state = RESUME;
- m->resume.attributes = attributes;
+ m->resume.attributes = attr;
assert(m); // No macro is currently available, cannot create resume!
@@ -164,7 +165,7 @@ void MacroParser::startTag(std::string name,
assert(m); // No macro is currently available, cannot create query!
Query q;
- q.attributes = attributes;
+ q.attributes = attr;
m->queries.push_back(q);
return;
@@ -188,7 +189,7 @@ void MacroParser::startTag(std::string name,
assert(m); // No macro is currently available, cannot create map!
Map map;
- map.attributes = attributes;
+ map.attributes = attr;
m->maps.push_back(map);
current_map = &(m->maps.back());
@@ -216,7 +217,7 @@ void MacroParser::startTag(std::string name,
state = SCRIPT;
Script s;
- s.attributes = attributes;
+ s.attributes = attr;
m->scripts.push_back(s);
current_script = &(m->scripts.back());
}
@@ -226,7 +227,7 @@ void MacroParser::startTag(std::string name,
state = RESUME_SCRIPT;
Script s;
- s.attributes = attributes;
+ s.attributes = attr;
m->resume_scripts.push_back(s);
current_resume_script = &(m->resume_scripts.back());
}
@@ -246,7 +247,7 @@ void MacroParser::startTag(std::string name,
assert(m); // No macro is currently available, cannot create widgets!
- m->widgets.attributes = attributes;
+ m->widgets.attributes = attr;
m->widgets.attributes["tagname"] = name;
Widget *current = &(m->widgets);
@@ -262,7 +263,7 @@ void MacroParser::startTag(std::string name,
assert(widgetstack.size()); // Widget stack is empty, cannot create!
Widget w;
- w.attributes = attributes;
+ w.attributes = attr;
w.attributes["tagname"] = name;
Widget *parent = widgetstack.back();