mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-06 06:58:45 +00:00
interpreter_tree: import statement extended to expressions
This commit is contained in:
parent
1ba132bb06
commit
8dcc3ce26f
2 changed files with 13 additions and 1 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue