Move ErrorAssignmentToUnknownLHS to ParseError.

This commit is contained in:
Stephen Chung
2020-10-28 10:26:36 +08:00
parent 4b087d0e69
commit 30e11f137b
5 changed files with 19 additions and 33 deletions

View File

@@ -2280,7 +2280,7 @@ fn make_assignment_stmt<'a>(
}
}
// expr[???] = rhs, expr.??? = rhs
_ => Err(PERR::AssignmentToCopy.into_err(x.lhs.position())),
_ => Err(PERR::AssignmentToInvalidLHS("".to_string()).into_err(x.lhs.position())),
},
// const_expr = rhs
expr if expr.is_constant() => {
@@ -2291,7 +2291,7 @@ fn make_assignment_stmt<'a>(
Err(PERR::BadInput("Possibly a typo of '=='?".to_string()).into_err(pos))
}
// expr = rhs
_ => Err(PERR::AssignmentToCopy.into_err(lhs.position())),
_ => Err(PERR::AssignmentToInvalidLHS("".to_string()).into_err(lhs.position())),
}
}