diff options
| author | Ian Wrzesinski <133046678+wrzian@users.noreply.github.com> | 2025-02-26 15:10:36 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-26 20:10:36 +0000 |
| commit | cfb3b1a2709107f0f06f89ea25cabc939cec15e5 (patch) | |
| tree | f61f39cc3c1a6eec30d37aa4202d6c599e74b2f7 /crates/typst-eval/src/call.rs | |
| parent | 52f1f53973414be72bf22c3253ab365f8db067df (diff) | |
Improve clarity of `ast.rs` for newcomers to the codebase (#5784)
Co-authored-by: PgBiel <9021226+PgBiel@users.noreply.github.com>
Co-authored-by: T0mstone <39707032+T0mstone@users.noreply.github.com>
Diffstat (limited to 'crates/typst-eval/src/call.rs')
| -rw-r--r-- | crates/typst-eval/src/call.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/typst-eval/src/call.rs b/crates/typst-eval/src/call.rs index c68bef96..1ca7b4b8 100644 --- a/crates/typst-eval/src/call.rs +++ b/crates/typst-eval/src/call.rs @@ -466,7 +466,7 @@ impl<'a> CapturesVisitor<'a> { } // Code and content blocks create a scope. - Some(ast::Expr::Code(_) | ast::Expr::Content(_)) => { + Some(ast::Expr::CodeBlock(_) | ast::Expr::ContentBlock(_)) => { self.internal.enter(); for child in node.children() { self.visit(child); @@ -516,7 +516,7 @@ impl<'a> CapturesVisitor<'a> { // A let expression contains a binding, but that binding is only // active after the body is evaluated. - Some(ast::Expr::Let(expr)) => { + Some(ast::Expr::LetBinding(expr)) => { if let Some(init) = expr.init() { self.visit(init.to_untyped()); } @@ -529,7 +529,7 @@ impl<'a> CapturesVisitor<'a> { // A for loop contains one or two bindings in its pattern. These are // active after the iterable is evaluated but before the body is // evaluated. - Some(ast::Expr::For(expr)) => { + Some(ast::Expr::ForLoop(expr)) => { self.visit(expr.iterable().to_untyped()); self.internal.enter(); @@ -544,7 +544,7 @@ impl<'a> CapturesVisitor<'a> { // An import contains items, but these are active only after the // path is evaluated. - Some(ast::Expr::Import(expr)) => { + Some(ast::Expr::ModuleImport(expr)) => { self.visit(expr.source().to_untyped()); if let Some(ast::Imports::Items(items)) = expr.imports() { for item in items.iter() { |
