diff options
author | Nadrieril Feneanar | 2019-11-11 17:01:02 +0100 |
---|---|---|
committer | GitHub | 2019-11-11 17:01:02 +0100 |
commit | 84cd6f386d6f4c7952fbc1da87dcd754f26ee404 (patch) | |
tree | d348f580a00c4b97f04f3a2e41ea2a23d67af824 /dhall_syntax/src/parser.rs | |
parent | f58ff637c8d53af1fcee43bfba5a9f8de799084c (diff) | |
parent | 8b566b2575096562c2e15d6ac9ee8750db2cf14f (diff) |
Merge pull request #114 from Nadrieril/nice-type-errors
Ground work for pretty type errors
Diffstat (limited to '')
-rw-r--r-- | dhall_syntax/src/parser.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/dhall_syntax/src/parser.rs b/dhall_syntax/src/parser.rs index 83f62ee..eaded50 100644 --- a/dhall_syntax/src/parser.rs +++ b/dhall_syntax/src/parser.rs @@ -650,7 +650,7 @@ impl DhallParser { final_expr, |acc, x| { spanned_union( - acc.span().unwrap(), + acc.span(), x.3, Let(x.0, x.1, x.2, acc) ) @@ -717,11 +717,7 @@ impl DhallParser { r => Err(op.error(format!("Rule {:?} isn't an operator", r)))?, }; - Ok(spanned_union( - l.span().unwrap(), - r.span().unwrap(), - BinOp(op, l, r), - )) + Ok(spanned_union(l.span(), r.span(), BinOp(op, l, r))) } fn Some_(_input: ParseInput) -> ParseResult<()> { @@ -739,8 +735,8 @@ impl DhallParser { first, |acc, e| { spanned_union( - acc.span().unwrap(), - e.span().unwrap(), + acc.span(), + e.span(), App(acc, e) ) } @@ -778,7 +774,7 @@ impl DhallParser { first, |acc, e| { spanned_union( - acc.span().unwrap(), + acc.span(), e.1, match e.0 { Either::Left(l) => Field(acc, l), |