on ca34dec help sign in
17 lines 561 B history raw
1module Debug.Error
3import Language.Reflection
4import System
6||| Terminate the program after printing a user-specified error message.
7|||
8||| @ loc The source location to display for the error
9||| @ message The error to print
10partial export
11error : {default (%runElab sourceLocation) loc : SourceLocation} ->
12 (message : String) ->
13 a
14error {loc = FileLoc filename (line, col) _} message =
15 let place = filename ++ " line " ++ show line ++ " column " ++ show col
16 message' = place ++ ": " ++ message in
17 idris_crash message'