probleme avec les locations a l'ancienne (camlp4)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5816 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
d200cf6df1
commit
7373c5caec
|
@ -195,14 +195,13 @@ let (msg_file, msg_line, msg_chars, msg_to, msg_colon, msg_head) =
|
|||
|
||||
(* return file, line, char from the given position *)
|
||||
let get_pos_info pos =
|
||||
let fname = if pos.pos_fname <> "" then pos.pos_fname else !input_name in
|
||||
let (filename, linenum, linebeg) =
|
||||
if fname = "" then
|
||||
if pos.pos_fname = "" && !input_name = "" then
|
||||
("", -1, 0)
|
||||
else if pos.pos_lnum = -1 then
|
||||
Linenum.for_position fname pos.pos_cnum
|
||||
else if pos.pos_fname = "" then
|
||||
Linenum.for_position !input_name pos.pos_cnum
|
||||
else
|
||||
(fname, pos.pos_lnum, pos.pos_bol)
|
||||
(pos.pos_fname, pos.pos_lnum, pos.pos_bol)
|
||||
in
|
||||
(filename, linenum, pos.pos_cnum - linebeg)
|
||||
;;
|
||||
|
|
Loading…
Reference in New Issue