Added support for creating a string outline of a bound script for debugging purposes
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
@@ -26,6 +26,7 @@ namespace Porygon{
|
||||
All,
|
||||
};
|
||||
|
||||
|
||||
class ScriptType{
|
||||
TypeClass _class;
|
||||
public:
|
||||
@@ -84,6 +85,26 @@ namespace Porygon{
|
||||
return CastResult::InvalidCast;
|
||||
return CastResult::InvalidCast;
|
||||
}
|
||||
|
||||
static std::string ToString(TypeClass c){
|
||||
switch (c){
|
||||
|
||||
case TypeClass::Error: return "error";
|
||||
case TypeClass::Nil: return "nil";
|
||||
case TypeClass::Number: return "number";
|
||||
case TypeClass::Bool: return "bool";
|
||||
case TypeClass::String: return "string";
|
||||
case TypeClass::Function: return "function";
|
||||
case TypeClass::UserData: return "userdata";
|
||||
case TypeClass::Table: return "table";
|
||||
case TypeClass::All: return "all";
|
||||
}
|
||||
throw exception();
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual std::string ToString() const{
|
||||
return ToString(this->_class);
|
||||
}
|
||||
};
|
||||
|
||||
class NumericScriptType : public ScriptType{
|
||||
|
||||
Reference in New Issue
Block a user