mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2026-01-25 21:17:11 +00:00
statement builders finished
This commit is contained in:
parent
64a91299ff
commit
4470454838
19 changed files with 682 additions and 255 deletions
|
|
@ -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_;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue