summaryrefslogtreecommitdiff
path: root/src/model/func.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-01-03 12:29:35 +0100
committerLaurenz <laurmaedje@gmail.com>2023-01-03 12:32:17 +0100
commit29b31c4a5ac4cde311c4d38b3d70130e7d27ba76 (patch)
treefe4e5dbd2166a69af90e69578ad4602725cdb63c /src/model/func.rs
parent54962e6dcd002fd27918827996155fd7dc4e1cff (diff)
New import syntax
Diffstat (limited to 'src/model/func.rs')
-rw-r--r--src/model/func.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/model/func.rs b/src/model/func.rs
index 878b717f..98dc527c 100644
--- a/src/model/func.rs
+++ b/src/model/func.rs
@@ -443,8 +443,8 @@ impl<'a> CapturesVisitor<'a> {
// An import contains items, but these are active only after the
// path is evaluated.
Some(ast::Expr::Import(expr)) => {
- self.visit(expr.path().as_untyped());
- if let ast::Imports::Items(items) = expr.imports() {
+ self.visit(expr.source().as_untyped());
+ if let Some(ast::Imports::Items(items)) = expr.imports() {
for item in items {
self.bind(item);
}
@@ -525,8 +525,8 @@ mod tests {
test("#for x in y {} #x", &["x", "y"]);
// Import.
- test("#import x, y from z", &["z"]);
- test("#import x, y, z from x + y", &["x", "y"]);
+ test("#import z: x, y", &["z"]);
+ test("#import x + y: x, y, z", &["x", "y"]);
// Blocks.
test("{ let x = 1; { let y = 2; y }; x + y }", &["y"]);