From 6c9a544e63e73c8aa3e990e9370ca9c582612f49 Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 30 Jul 2008 12:58:13 +0000 Subject: Reenabled support for upload server. Currently only tested against local print-to-screen version. --- server/src/macroparser.cc | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'server/src/macroparser.cc') diff --git a/server/src/macroparser.cc b/server/src/macroparser.cc index 9175c07..356de1f 100644 --- a/server/src/macroparser.cc +++ b/server/src/macroparser.cc @@ -68,7 +68,7 @@ MacroParser::MacroParser(std::string macro) state = UNDEFINED; m = NULL; current_map = NULL; - current_luaprogram = NULL; + current_script = NULL; file = XML"/macros/" + macro + ".xml"; @@ -91,9 +91,9 @@ void MacroParser::characterData(std::string &data) current_map->attributes["lua"].append(data); } - if(state == LUAPROGRAM) { - assert(current_luaprogram); // No lua program present! - current_luaprogram->attributes["lua"].append(data); + if(state == SCRIPT) { + assert(current_script); // No script present! + current_script->attributes["code"].append(data); } } @@ -161,10 +161,10 @@ void MacroParser::startTag(std::string name, std::map< std::string, std::string> return; } - // Enable LUA Program parsing - if(name == "luaprograms") { - if(state != MACRO) error("luaprograms found outside macro."); - state = LUAPROGRAMS; + // Enable script parsing + if(name == "scripts") { + if(state != MACRO) error("scripts found outside macro."); + state = SCRIPTS; assert(m); // No macro is currently available, cannot create maps! @@ -172,16 +172,16 @@ void MacroParser::startTag(std::string name, std::map< std::string, std::string> } // Create Query - if(name == "luaprogram") { - if(state != LUAPROGRAMS) error("lua program found outside maps."); - state = LUAPROGRAM; + if(name == "script") { + if(state != SCRIPTS) error("script found outside scripts."); + state = SCRIPT; assert(m); // No macro is currently available, cannot create map! - LUAProgram l; - l.attributes = attributes; - m->luaprograms.push_back(l); - current_luaprogram = &(m->luaprograms.back()); + Script s; + s.attributes = attributes; + m->scripts.push_back(s); + current_script = &(m->scripts.back()); return; } @@ -243,10 +243,10 @@ void MacroParser::endTag(std::string name) current_map = NULL; state = MAPS; } - if(name == "luaprograms") state = MACRO; - if(name == "luaprogram") { - current_luaprogram = NULL; - state = LUAPROGRAMS; + if(name == "scripts") state = MACRO; + if(name == "script") { + current_script = NULL; + state = SCRIPTS; } if(name == "window") state = MACRO; -- cgit v1.2.3