mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-07 15:38:49 +00:00
printing fixes
This commit is contained in:
parent
0bb72e0b10
commit
469cb3581f
23 changed files with 318 additions and 151 deletions
|
|
@ -53,15 +53,9 @@ public:
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::variant<double, long long, std::string, char, bool, unit, null> *
|
||||
get_any() {
|
||||
return &value_;
|
||||
}
|
||||
auto get_any() { return &value_; }
|
||||
|
||||
const std::variant<double, long long, std::string, char, bool, unit, null> *
|
||||
get_any() const {
|
||||
return &value_;
|
||||
}
|
||||
auto get_any() const { return &value_; }
|
||||
|
||||
private:
|
||||
std::variant<double, long long, std::string, char, bool, unit, null> value_;
|
||||
|
|
@ -86,7 +80,7 @@ public:
|
|||
Identifier(Node node, IdentifierType type, const std::string &value)
|
||||
: Node(node), type_(type), value_(value) {}
|
||||
|
||||
IdentifierType get_type() { return type_; }
|
||||
IdentifierType get_type() const { return type_; }
|
||||
|
||||
std::string *get() { return &value_; }
|
||||
|
||||
|
|
@ -97,4 +91,14 @@ private:
|
|||
std::string value_;
|
||||
};
|
||||
|
||||
class EmptyLines : public Node {
|
||||
public:
|
||||
EmptyLines(Node node, size_t size) : Node(node), size_(size) {}
|
||||
|
||||
size_t size() const { return size_; }
|
||||
|
||||
private:
|
||||
size_t size_;
|
||||
};
|
||||
|
||||
} // namespace nodes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue