parent
03e439e449
commit
77af5b3a88
12
src/loc.ml
12
src/loc.ml
|
@ -51,17 +51,7 @@ let fail_opt t fmt =
|
||||||
| None -> die fmt
|
| None -> die fmt
|
||||||
| Some t -> fail t fmt
|
| Some t -> fail t fmt
|
||||||
|
|
||||||
let in_file fn =
|
let in_file = Usexp.Loc.in_file
|
||||||
let pos : Lexing.position =
|
|
||||||
{ pos_fname = fn
|
|
||||||
; pos_lnum = 1
|
|
||||||
; pos_cnum = 0
|
|
||||||
; pos_bol = 0
|
|
||||||
}
|
|
||||||
in
|
|
||||||
{ start = pos
|
|
||||||
; stop = pos
|
|
||||||
}
|
|
||||||
|
|
||||||
let of_pos (fname, lnum, cnum, enum) =
|
let of_pos (fname, lnum, cnum, enum) =
|
||||||
let pos : Lexing.position =
|
let pos : Lexing.position =
|
||||||
|
|
|
@ -240,7 +240,21 @@ let prepare_formatter ppf =
|
||||||
| _ -> n))
|
| _ -> n))
|
||||||
}
|
}
|
||||||
|
|
||||||
module Loc = Sexp_ast.Loc
|
module Loc = struct
|
||||||
|
include Sexp_ast.Loc
|
||||||
|
|
||||||
|
let in_file fn =
|
||||||
|
let pos : Lexing.position =
|
||||||
|
{ pos_fname = fn
|
||||||
|
; pos_lnum = 1
|
||||||
|
; pos_cnum = 0
|
||||||
|
; pos_bol = 0
|
||||||
|
}
|
||||||
|
in
|
||||||
|
{ start = pos
|
||||||
|
; stop = pos
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
module Ast = struct
|
module Ast = struct
|
||||||
type t = Sexp_ast.t =
|
type t = Sexp_ast.t =
|
||||||
|
|
|
@ -28,6 +28,8 @@ module Loc : sig
|
||||||
{ start : Lexing.position
|
{ start : Lexing.position
|
||||||
; stop : Lexing.position
|
; stop : Lexing.position
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val in_file : string -> t
|
||||||
end
|
end
|
||||||
|
|
||||||
(** The S-expression type *)
|
(** The S-expression type *)
|
||||||
|
|
Loading…
Reference in New Issue