diff options
| author | deva <deva> | 2008-10-10 10:21:20 +0000 | 
|---|---|---|
| committer | deva <deva> | 2008-10-10 10:21:20 +0000 | 
| commit | a703bf6f8dd6cd5a75202266f769e3ef2e42bcb2 (patch) | |
| tree | 120486db55ca92bc9f2c5dd43412c7d7add5487b /server/src/macroparser.cc | |
| parent | 9b697d2d3e34962385cd85a14d4cb14d5b1763ce (diff) | |
Made resume a standalone tag istead of an attribute of the macro tag.
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; | 
