ppxlib
-
ppxlib
-
-
ppxlib.ast
-
-
ppxlib.astlib
-
-
ppxlib.metaquot
-
ppxlib.metaquot_lifters
-
ppxlib.print_diff
-
ppxlib.runner
-
ppxlib.runner_as_ppx
-
ppxlib.traverse
-
ppxlib.traverse_builtins
Library
Module
Module type
Parameter
Class
Class type
There are less functions in this module. However the API should be more stable than the Location module of OCaml.
type t = Astlib.Location.t = {
loc_start : Lexing.position; |
loc_end : Lexing.position; |
loc_ghost : bool; |
}
val in_file : string -> t
Return an empty ghost range located in a given file.
Set the pos_fname
both in loc_start
and loc_end
. Leave the rest as is.
val none : t
An arbitrary value of type t
; describes an empty ghost range.
val init : Lexing.lexbuf -> string -> unit
Set the file name and line number of the lexbuf
to be the start of the named file.
val raise_errorf :
?loc:t ->
( 'a, Stdppx.Caml.Format.formatter, unit, 'b ) format4 ->
'a
Raise a located error. Should be avoided as much as possible, in favor of error_extensionf
.
val of_lexbuf : Lexing.lexbuf -> t
Return the location corresponding to the last matched regular expression
val report_exception : Stdppx.Caml.Format.formatter -> exn -> unit
Report an exception on the given formatter
val print : Stdppx.Caml.Format.formatter -> t -> unit
Prints File "...", line ..., characters ...-...:
val compare_pos : Lexing.position -> Lexing.position -> int
val min_pos : Lexing.position -> Lexing.position -> Lexing.position
val max_pos : Lexing.position -> Lexing.position -> Lexing.position
module Error : sig ... end
val error_extensionf :
loc:t ->
( 'a,
Format.formatter,
unit,
string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload )
format4 ->
'a
Returns an error extension node. When encountered in the AST, the compiler recognizes it and displays the error properly.
exception Error of Error.t