interpreter_tree: import statement extended to expressions

This commit is contained in:
ProgramSnail 2023-03-26 15:26:56 +03:00
parent 1ba132bb06
commit 8dcc3ce26f
2 changed files with 13 additions and 1 deletions

Binary file not shown.

View file

@ -274,9 +274,20 @@ struct Namespace : public Node {
// ----------------- Definitions -----------------
struct TypeclassExpression;
struct TypeExpression;
struct NameExpression;
using ImportSymbol = std::variant<
TypeclassExpression,
TypeExpression,
NameExpression>;
//
struct ImportStatement : public Node {
std::string module_name;
std::vector<AnyIdentifier> symbols; // TODO parametric import support
std::vector<std::unique_ptr<ImportSymbol>> symbols; // TODO parametric import support
};
struct UsageDefinition : public Node {
@ -290,6 +301,7 @@ struct AliasDefinition : public Node {
};
struct VariableDefinition : public Node {
bool is_const; // default value ??
NameIdentifier name;
std::unique_ptr<SuperExpression> value;
};