.
This commit is contained in:
17
src/vm/value.cc
Normal file
17
src/vm/value.cc
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "value.hh"
|
||||
|
||||
#include "../common/overloaded.hh"
|
||||
|
||||
namespace tyche {
|
||||
|
||||
Type Value::type() const
|
||||
{
|
||||
return std::visit(overloaded {
|
||||
[](std::monostate) { return Type::Nil; },
|
||||
[](int32_t) { return Type::Integer; },
|
||||
[](float) { return Type::Float; },
|
||||
[](std::string const&) { return Type::String; },
|
||||
}, value_);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user