printing fixes

This commit is contained in:
ProgramSnail 2023-07-25 21:33:57 +03:00
parent 0bb72e0b10
commit 469cb3581f
23 changed files with 318 additions and 151 deletions

View file

@ -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