mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-07 15:38:49 +00:00
change in literals, literal types
This commit is contained in:
parent
17ff590048
commit
43dfa75b74
10 changed files with 168 additions and 39 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue