change in literals, literal types

This commit is contained in:
ProgramSnail 2023-08-12 15:55:33 +03:00
parent 17ff590048
commit 43dfa75b74
10 changed files with 168 additions and 39 deletions

View file

@ -79,6 +79,14 @@ protected:
struct unit {};
struct null {};
struct unicode_string {
std::string str;
};
struct unicode {
std::string ch;
};
class Literal : public Node {
public:
template <typename T>
@ -103,7 +111,9 @@ public:
auto get_any() const { return &value_; }
private:
std::variant<double, long long, std::string, char, bool, unit, null> value_;
std::variant<float, double, int32_t, int64_t, size_t, std::string,
unicode_string, char, unicode, bool, unit, null>
value_;
};
class Identifier : public Node {