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
+6 -2
View File
@@ -75,10 +75,14 @@ class FileParseError : public ParseError {
/// Parse error in a script
class ScriptParseError : public ParseError {
public:
ScriptParseError(size_t pos, const String& str);
ScriptParseError(size_t pos, const String& expected, const String& found);
ScriptParseError(size_t pos, int line, const String& filename, const String& str);
ScriptParseError(size_t pos, int line, const String& filename, const String& expected, const String& found);
/// Position of the error
size_t start, end;
/// Line number of the error (the first line is 1)
int line;
/// Filename the error was in, or an empty string
String filename;
/// Return the error message
virtual String what() const;
};