Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve localization of parsing errors
The `exprD` parser for function application was unnecessarily backtracking when parsing the first value in the chain. Removing the `try` for the first element greatly improves parsing error localization. For example, before this change the following Dhall expression: ``` { foo = 1, bar = '2' } ``` ... would give the following parse error: ``` (stdin):1:1: error: expected: "[", "\8704", "\955", "\\", "forall", "if", "let", "merge" { foo = 1, bar = '2' } ^ ``` After this change, you now get a much better error: ``` $ dist/build/Dhall/dhall { foo = 1, bar = '2' } (stdin):1:18: error: expected: "''", "(", "+", "-", "[", "\8704", "\955", "\\", "forall", "if", "let", "merge", built-in value, double, import, integer, label, list literal, natural, record literal, record type, string, union literal, union type { foo = 1, bar = '2' } ^ ```
- Loading branch information