From a703bf6f8dd6cd5a75202266f769e3ef2e42bcb2 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 10 Oct 2008 10:21:20 +0000 Subject: Made resume a standalone tag istead of an attribute of the macro tag. --- server/src/macroparser.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'server/src/macroparser.cc') diff --git a/server/src/macroparser.cc b/server/src/macroparser.cc index 356de1f..582c90c 100644 --- a/server/src/macroparser.cc +++ b/server/src/macroparser.cc @@ -86,6 +86,11 @@ MacroParser::~MacroParser() void MacroParser::characterData(std::string &data) { + if(state == RESUME) { + assert(m); // No macro present! + m->resume.attributes["format"].append(data); + } + if(state == MAP) { assert(current_map); // No map present! current_map->attributes["lua"].append(data); @@ -112,6 +117,18 @@ void MacroParser::startTag(std::string name, std::map< std::string, std::string> return; } + // Enable resume parsing + if(name == "resume") { + if(state != MACRO) error("resume found outside macro."); + state = RESUME; + + m->resume.attributes = attributes; + + assert(m); // No macro is currently available, cannot create queries! + + return; + } + // Enable Query parsing if(name == "queries") { if(state != MACRO) error("queries found outside macro."); @@ -236,6 +253,7 @@ void MacroParser::endTag(std::string name) if(name == "macro") { state = UNDEFINED; } + if(name == "resume") state = MACRO; if(name == "queries") state = MACRO; if(name == "query") state = QUERIES; if(name == "maps") state = MACRO; -- cgit v1.2.3