better errors

This commit is contained in:
nora 2021-10-31 12:55:39 +01:00
parent c6e5a5d686
commit 67e6dfccc2
4 changed files with 152 additions and 43 deletions

View file

@ -76,6 +76,7 @@ pub struct Break {
#[derive(Debug, Clone, PartialEq)]
pub enum Expr {
Ident(Symbol, Span),
Literal(Literal),
UnaryOp(Box<UnaryOp>),
BinaryOp(Box<BinaryOp>),
@ -87,6 +88,7 @@ impl Expr {
Expr::Literal(lit) => lit.span(),
Expr::UnaryOp(unary) => unary.span,
Expr::BinaryOp(binary) => binary.span,
Expr::Ident(_, span) => *span,
}
}
}