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

@ -57,25 +57,27 @@ public:
FunctionDefinition(Node node, SymbolDocs &&docs,
std::vector<Constraint> &&constraints,
ModifierType modifier, const Identifier &name,
std::vector<std::string> &&annotations,
std::vector<std::optional<std::string>> &&annotations,
std::vector<Identifier> &&arguments,
std::vector<ReferenceType> &&reference_types,
std::vector<TypeProxy> &&types)
std::vector<Modifier> &&reference_types,
std::vector<std::optional<TypeProxy>> &&types,
std::optional<ExpressionProxy> expression)
: Node(node), docs_(std::move(docs)),
constraints_(std::move(constraints)), modifier_(modifier), name_(name),
annotations_(std::move(annotations)), arguments_(std::move(arguments)),
reference_types_(std::move(reference_types)), types_(std::move(types)) {
}
reference_types_(std::move(reference_types)), types_(std::move(types)),
expression_(expression) {}
private:
SymbolDocs docs_;
std::vector<Constraint> constraints_;
ModifierType modifier_;
Identifier name_;
std::vector<std::string> annotations_;
std::vector<std::optional<std::string>> annotations_;
std::vector<Identifier> arguments_;
std::vector<ReferenceType> reference_types_;
std::vector<TypeProxy> types_;
std::vector<Modifier> reference_types_;
std::vector<std::optional<TypeProxy>> types_;
std::optional<ExpressionProxy> expression_;
// std::vector<bool> optional_arguments_; // ??
}; // IN PROGRESS
@ -83,7 +85,8 @@ class TypeDefinition : public Node {
public:
TypeDefinition(Node node, SymbolDocs &&docs, bool is_on_heap,
const Identifier &name, std::vector<Identifier> &&arguments,
VariantType &&type, std::vector<FunctionDefinition> &&methods)
std::optional<VariantType> &&type,
std::vector<FunctionDefinition> &&methods)
: Node(node), docs_(std::move(docs)), is_on_heap_(is_on_heap),
name_(name), arguments_(std::move(arguments)), type_(std::move(type)),
methods_(std::move(methods)) {}
@ -93,7 +96,7 @@ private:
bool is_on_heap_;
Identifier name_;
std::vector<Identifier> arguments_;
VariantType type_; // TupleType is VariantType with one variant
std::optional<VariantType> type_; // TupleType is VariantType with one variant
std::vector<FunctionDefinition> methods_;
}; // IN PROGRESS