Resolver - Handle AST refactorings
This commit is contained in:
parent
0c588942bf
commit
b12c7a05cf
1 changed files with 5 additions and 12 deletions
|
@ -328,7 +328,7 @@ impl VarResolver for ExprNode {
|
||||||
'a: 'b,
|
'a: 'b,
|
||||||
{
|
{
|
||||||
match self {
|
match self {
|
||||||
ExprNode::Variable { name, id } => rs.resolve_use(id, name),
|
ExprNode::Variable(var_expr) => rs.resolve_use(&var_expr.id, &var_expr.token),
|
||||||
|
|
||||||
ExprNode::Assignment { name, value, id } => {
|
ExprNode::Assignment { name, value, id } => {
|
||||||
value.resolve(rs)?;
|
value.resolve(rs)?;
|
||||||
|
@ -339,17 +339,10 @@ impl VarResolver for ExprNode {
|
||||||
rs.with_scope(|rs| resolve_function(rs, params, body))
|
rs.with_scope(|rs| resolve_function(rs, params, body))
|
||||||
}
|
}
|
||||||
|
|
||||||
ExprNode::Logical {
|
ExprNode::Logical(binary_expr) | ExprNode::Binary(binary_expr) => binary_expr
|
||||||
left,
|
.left
|
||||||
operator: _,
|
.resolve(rs)
|
||||||
right,
|
.and_then(|_| binary_expr.right.resolve(rs)),
|
||||||
} => left.resolve(rs).and_then(|_| right.resolve(rs)),
|
|
||||||
|
|
||||||
ExprNode::Binary {
|
|
||||||
left,
|
|
||||||
operator: _,
|
|
||||||
right,
|
|
||||||
} => left.resolve(rs).and_then(|_| right.resolve(rs)),
|
|
||||||
|
|
||||||
ExprNode::Unary { operator: _, right } => right.resolve(rs),
|
ExprNode::Unary { operator: _, right } => right.resolve(rs),
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue