diff options
Diffstat (limited to 'server/src/macroparser.cc')
-rw-r--r-- | server/src/macroparser.cc | 18 |
1 files changed, 18 insertions, 0 deletions
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; |