fix: print module name instead of file name
This commit is contained in:
parent
7f878eeb95
commit
5801e0e65a
2 changed files with 4 additions and 3 deletions
|
|
@ -29,5 +29,5 @@ unsafe def unsafeCast {α : Type u} {β : Type v} [Inhabited β] (a : α) : β :
|
|||
constant panic {α : Type u} [Inhabited α] (msg : String) : α := default _
|
||||
|
||||
@[neverExtract]
|
||||
def panicWithPos {α : Type u} [Inhabited α] (fname : String) (line col : Nat) (msg : String) : α :=
|
||||
panic ("PANIC at " ++ fname ++ ":" ++ toString line ++ ":" ++ toString col ++ ": " ++ msg)
|
||||
def panicWithPos {α : Type u} [Inhabited α] (modName : String) (line col : Nat) (msg : String) : α :=
|
||||
panic ("PANIC at " ++ modName ++ ":" ++ toString line ++ ":" ++ toString col ++ ": " ++ msg)
|
||||
|
|
|
|||
|
|
@ -802,7 +802,8 @@ static expr parse_tparser(parser & p, unsigned, expr const *, pos_info const & p
|
|||
|
||||
static expr parse_panic(parser & p, unsigned, expr const *, pos_info const & pos) {
|
||||
expr e = p.parse_expr();
|
||||
expr r = mk_app(mk_constant(get_panic_with_pos_name()), quote(p.get_file_name()), quote(pos.first), quote(pos.second), e);
|
||||
std::string mod = p.env().get_main_module().to_string();
|
||||
expr r = mk_app(mk_constant(get_panic_with_pos_name()), quote(mod.c_str()), quote(pos.first), quote(pos.second), e);
|
||||
return save_pos(r, pos);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue