mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +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
BIN
include/.interpreter_tree.hpp.kate-swp
Normal file
BIN
include/.interpreter_tree.hpp.kate-swp
Normal file
Binary file not shown.
|
|
@ -274,9 +274,20 @@ struct Namespace : public Node {
|
||||||
|
|
||||||
// ----------------- Definitions -----------------
|
// ----------------- Definitions -----------------
|
||||||
|
|
||||||
|
struct TypeclassExpression;
|
||||||
|
struct TypeExpression;
|
||||||
|
struct NameExpression;
|
||||||
|
|
||||||
|
using ImportSymbol = std::variant<
|
||||||
|
TypeclassExpression,
|
||||||
|
TypeExpression,
|
||||||
|
NameExpression>;
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
struct ImportStatement : public Node {
|
struct ImportStatement : public Node {
|
||||||
std::string module_name;
|
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 {
|
struct UsageDefinition : public Node {
|
||||||
|
|
@ -290,6 +301,7 @@ struct AliasDefinition : public Node {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct VariableDefinition : public Node {
|
struct VariableDefinition : public Node {
|
||||||
|
bool is_const; // default value ??
|
||||||
NameIdentifier name;
|
NameIdentifier name;
|
||||||
std::unique_ptr<SuperExpression> value;
|
std::unique_ptr<SuperExpression> value;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue