summaryrefslogtreecommitdiff
path: root/crates/typst-syntax
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-09-16 20:38:27 +0200
committerLaurenz <laurmaedje@gmail.com>2023-09-16 20:41:44 +0200
commit25613cfaf3a20f737ac347f7d7144a5dcaa709a5 (patch)
tree150578e74ece5172133b990e9b900b8fedfecee7 /crates/typst-syntax
parentb7430f6da01550d8388d6a3bcccf0ef0aca9130c (diff)
Fix missing capturing of assignments
The previous commit was a bit overambitious. The left-hand side of assignments should actually be fully captured: Argument lists in `at` calls can contain captured variables. And if the assigned variable itself is captured, then the function is faulty anyway. (And we ensure the correct error message by capturing it.) Fixes #2169
Diffstat (limited to 'crates/typst-syntax')
-rw-r--r--crates/typst-syntax/src/ast.rs12
1 files changed, 0 insertions, 12 deletions
diff --git a/crates/typst-syntax/src/ast.rs b/crates/typst-syntax/src/ast.rs
index 0df3d6d3..cb1d05b2 100644
--- a/crates/typst-syntax/src/ast.rs
+++ b/crates/typst-syntax/src/ast.rs
@@ -1440,18 +1440,6 @@ impl BinOp {
})
}
- /// Whether this is an assignment operator.
- pub fn is_assignment(self) -> bool {
- matches!(
- self,
- Self::Assign
- | Self::AddAssign
- | Self::SubAssign
- | Self::MulAssign
- | Self::DivAssign
- )
- }
-
/// The precedence of this operator.
pub fn precedence(self) -> usize {
match self {