statement builders finished

This commit is contained in:
ProgramSnail 2023-07-23 19:40:27 +03:00
parent 64a91299ff
commit 4470454838
19 changed files with 682 additions and 255 deletions

View file

@ -8,6 +8,8 @@ namespace nodes {
class SymbolDocs {
public:
SymbolDocs() {}
SymbolDocs(std::string &&description)
: description_(std::move(description)) {}
@ -22,9 +24,19 @@ public:
return false;
}
std::string *get_description() { return &description_; }
std::optional<std::string *> get_description() {
if (description_.has_value()) {
return &description_.value();
}
return std::nullopt;
}
const std::string *get_description() const { return &description_; }
std::optional<const std::string *> get_description() const {
if (description_.has_value()) {
return &description_.value();
}
return std::nullopt;
}
std::optional<std::string *>
get_annotation_info(const std::string &annotation) {
@ -45,7 +57,7 @@ public:
}
private:
std::string description_;
std::optional<std::string> description_;
std::unordered_map<std::string, std::string> annotations_info_;
};