Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disentangle refiner errors from elaborator errors
- Loading branch information
1 parent
a6bc7d6
commit a038a46
Showing
9 changed files
with
78 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
open Basis | ||
open Core | ||
|
||
module CS = ConcreteSyntax | ||
module S = Syntax | ||
|
||
type t = | ||
| MalformedCase | ||
| InvalidTypeExpression of CS.con | ||
| ExpectedSynthesizableTerm of CS.con_ | ||
| CannotEliminate of Pp.env * S.tp | ||
| ExpectedSimpleInductive of Pp.env * S.tp | ||
|
||
|
||
let pp fmt = | ||
function | ||
| ExpectedSynthesizableTerm orig -> | ||
Format.fprintf fmt | ||
"@[Type annotation required for@,@[<hv> %a@]@]" | ||
CS.pp_con_ orig | ||
| InvalidTypeExpression cs -> | ||
Format.fprintf fmt | ||
"Invalid type expression: %a" | ||
CS.pp_con cs | ||
| MalformedCase -> | ||
Format.fprintf fmt "Malformed case" | ||
| CannotEliminate (ppenv, tp) -> | ||
Format.fprintf fmt | ||
"Cannot eliminate element of type %a" | ||
(S.pp_tp ppenv) tp | ||
| ExpectedSimpleInductive (ppenv, tp) -> | ||
Format.fprintf fmt | ||
"Expected simple inductive type but found %a" | ||
(S.pp_tp ppenv) tp | ||
|
||
exception ElabError of t * LexingUtil.span option | ||
|
||
let _ = | ||
PpExn.install_printer @@ fun fmt -> | ||
function | ||
| ElabError (err, _loc) -> | ||
pp fmt err | ||
| _ -> | ||
raise PpExn.Unrecognized |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
open Basis | ||
open Core | ||
module CS := ConcreteSyntax | ||
module S := Syntax | ||
|
||
type t = | ||
| MalformedCase | ||
| InvalidTypeExpression of CS.con | ||
| ExpectedSynthesizableTerm of CS.con_ | ||
| CannotEliminate of Pp.env * S.tp | ||
| ExpectedSimpleInductive of Pp.env * S.tp | ||
|
||
val pp : Format.formatter -> t -> unit | ||
|
||
exception ElabError of t * LexingUtil.span option |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters