mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Added some more classes for ScriptErrors;
Added split_text function, which is the 'opposite' of break_text; Script code "f\n(stuff)" now parses as "f;stuff" instead of a function call, "f(stuff)"; Fixed bug in cursor movement, which caused the closing > of a tag at end of input to be overwritten. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1175 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -108,6 +108,28 @@ class ScriptError : public Error {
|
||||
inline ScriptError(const String& str) : Error(str) {}
|
||||
};
|
||||
|
||||
/// "Variable not set"
|
||||
class ScriptErrorNoVariable : public ScriptError {
|
||||
public:
|
||||
inline ScriptErrorNoVariable(const String& var) : ScriptError(_("Variable not set: ") + var) {}
|
||||
};
|
||||
|
||||
/// "Can't convert from A to B"
|
||||
class ScriptErrorConversion : public ScriptError {
|
||||
public:
|
||||
inline ScriptErrorConversion(const String& a, const String& b)
|
||||
: ScriptError(_ERROR_2_("can't convert", a, b)) {}
|
||||
inline ScriptErrorConversion(const String& value, const String& a, const String& b)
|
||||
: ScriptError(_ERROR_3_("can't convert value", value, a, b)) {}
|
||||
};
|
||||
|
||||
/// "A has no member B"
|
||||
class ScriptErrorNoMember : public ScriptError {
|
||||
public:
|
||||
inline ScriptErrorNoMember(const String& type, const String& member)
|
||||
: ScriptError(_ERROR_2_("has no member", type, member)) {}
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------- : Error handling
|
||||
|
||||
/// Should errors be written to stdout?
|
||||
|
||||
Reference in New Issue
Block a user