summaryrefslogtreecommitdiff
path: root/server/src/macroparser.cc
diff options
context:
space:
mode:
authordeva <deva>2008-07-30 12:58:13 +0000
committerdeva <deva>2008-07-30 12:58:13 +0000
commit6c9a544e63e73c8aa3e990e9370ca9c582612f49 (patch)
tree76c2cdd65500116dc5b1539ef1baa0eedeacc01f /server/src/macroparser.cc
parent0da554ba6a55bbc195a30afa8f154af2ec2107a7 (diff)
Reenabled support for upload server. Currently only tested against local print-to-screen version.
Diffstat (limited to 'server/src/macroparser.cc')
-rw-r--r--server/src/macroparser.cc38
1 files changed, 19 insertions, 19 deletions
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;