diff --git a/cclox_src/scanner/object.hh b/cclox_src/scanner/object.hh index 605cc6a..e32e85f 100644 --- a/cclox_src/scanner/object.hh +++ b/cclox_src/scanner/object.hh @@ -12,6 +12,7 @@ enum class StringObjectType : uint8_t { enum class ObjectType : uint8_t { NIL, + BOOL, IDENTIFIER, STRING_LIT, NUMBER, @@ -19,6 +20,7 @@ enum class ObjectType : uint8_t { struct Object { Object() : type{ObjectType::NIL}, value{std::monostate{}} {}; + Object(bool value) : type{ObjectType::BOOL}, value{value} {}; Object(double number) : type{ObjectType::NUMBER}, value{number} {}; Object(StringObjectType string_type, std::string value) : type{ @@ -29,7 +31,7 @@ struct Object { value{std::move(value)} {}; ObjectType type; - std::variant value; + std::variant value; }; std::ostream &operator<<(std::ostream &os, const ObjectType &type);