summaryrefslogtreecommitdiff
path: root/server/src/macroparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/macroparser.cc')
-rw-r--r--server/src/macroparser.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/server/src/macroparser.cc b/server/src/macroparser.cc
index 0f7ed76..921e4f0 100644
--- a/server/src/macroparser.cc
+++ b/server/src/macroparser.cc
@@ -80,15 +80,14 @@ void MacroParser::error(const char* fmt, ...)
}
-MacroParser::MacroParser(std::string macro, bool abspath)
+MacroParser::MacroParser(std::string macrofile)
{
state = UNDEFINED;
m = NULL;
current_map = NULL;
current_script = NULL;
- if(!abspath) file = Conf::xml_basedir + "/macros/" + macro + ".xml";
- else file = macro;
+ file = macrofile;
PRACRO_DEBUG(macro, "Using macro file: %s\n", file.c_str());
@@ -341,7 +340,8 @@ void print_attributes(std::string prefix,
int main()
{
- MacroParser parser("example");
+ try {
+ MacroParser parser("../xml/macros/example.xml");
parser.parse();
Macro *m = parser.getMacro();
@@ -362,7 +362,11 @@ int main()
print_attributes("\t\t\t\t\t-", (*mi).attributes);
mi++;
}
-
+ } catch(Exception &e) {
+ printf("ERROR: %s\n", e.what());
+ return 1;
+ }
+
return 0;
}