More work on binder, implements basic literal expressions
This commit is contained in:
40
src/ScriptType.hpp
Normal file
40
src/ScriptType.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
#ifndef PORYGONLANG_SCRIPTTYPE_HPP
|
||||
#define PORYGONLANG_SCRIPTTYPE_HPP
|
||||
|
||||
enum class TypeClass{
|
||||
Error,
|
||||
Nil,
|
||||
Number,
|
||||
Bool,
|
||||
String,
|
||||
Function,
|
||||
UserData,
|
||||
Table,
|
||||
};
|
||||
|
||||
class ScriptType{
|
||||
TypeClass _class;
|
||||
public:
|
||||
explicit ScriptType(TypeClass c){
|
||||
_class = c;
|
||||
}
|
||||
|
||||
explicit virtual operator TypeClass(){
|
||||
return _class;
|
||||
}
|
||||
};
|
||||
|
||||
class NumericScriptType : public ScriptType{
|
||||
// Are we aware of whether this is a float or not?
|
||||
bool _awareOfFloat;
|
||||
// Is this value a float?
|
||||
bool _isFloat;
|
||||
public:
|
||||
explicit NumericScriptType(bool floatAware, bool isFloat) : ScriptType(TypeClass::Number){
|
||||
_awareOfFloat = floatAware;
|
||||
_isFloat = isFloat;
|
||||
}
|
||||
};
|
||||
|
||||
#endif //PORYGONLANG_SCRIPTTYPE_HPP
|
||||
Reference in New Issue
Block a user