Fixed bug in script parser/compiler: "x[if a then b else c]" was incorrectly optimized;

Sciript parse errors in include files now get reported for the right file and line number.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@458 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-07-01 18:11:48 +00:00
parent 68e48e8b81
commit 86393f33dc
6 changed files with 118 additions and 73 deletions
+4 -4
View File
@@ -24,12 +24,12 @@ String Error::what() const {
// ----------------------------------------------------------------------------- : Parse errors
ScriptParseError::ScriptParseError(size_t pos, const String& error)
: start(pos), end(pos)
ScriptParseError::ScriptParseError(size_t pos, int line, const String& filename, const String& error)
: start(pos), end(pos), line(line), filename(filename)
, ParseError(error)
{}
ScriptParseError::ScriptParseError(size_t pos, const String& exp, const String& found)
: start(pos), end(pos + found.size())
ScriptParseError::ScriptParseError(size_t pos, int line, const String& filename, const String& exp, const String& found)
: start(pos), end(pos + found.size()), line(line), filename(filename)
, ParseError(_("Expected '") + exp + _("' instead of '") + found + _("'"))
{}
String ScriptParseError::what() const {