conlang: Import items into scope with use!
grammar: - Improve specification of `Path` - Add `Use` and `UseTree` rules - Add `Use` as a variant of ItemKind cl-token: - Add new keywords `use` and `as` cl-ast: - Add nodes for Use and UseTree - Add new ItemKind for Use - Implement traversal in Visit and Fold cl-interpret: - Mark ItemKind::Use with a todo cl-parser: - Update to match grammar cl-typeck: - Update to match changes in AST - Mark UseTrees as NameCollectable and TypeResolvable, but leave as todos
This commit is contained in:
@@ -36,6 +36,7 @@ impl Interpret for Item {
|
||||
ItemKind::Struct(item) => item.interpret(env),
|
||||
ItemKind::Enum(item) => item.interpret(env),
|
||||
ItemKind::Impl(item) => item.interpret(env),
|
||||
ItemKind::Use(_) => todo!("namespaces and imports in the interpreter"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user