Commit 41a5fc79 authored by POTTIER Francois's avatar POTTIER Francois

Added [Positions.print]. A debugging utility.

parent b3ce45bf
...@@ -147,3 +147,11 @@ let two (pos1 : Lexing.position) (pos2 : Lexing.position) : positions = ...@@ -147,3 +147,11 @@ let two (pos1 : Lexing.position) (pos2 : Lexing.position) : positions =
let lexbuf (lexbuf : Lexing.lexbuf) : positions = let lexbuf (lexbuf : Lexing.lexbuf) : positions =
[ lex_join lexbuf.Lexing.lex_start_p lexbuf.Lexing.lex_curr_p ] [ lex_join lexbuf.Lexing.lex_start_p lexbuf.Lexing.lex_curr_p ]
let print (pos : Lexing.position) =
Printf.printf
"{ pos_fname = \"%s\"; pos_lnum = %d; pos_bol = %d; pos_cnum = %d }\n"
pos.pos_fname
pos.pos_lnum
pos.pos_bol
pos.pos_cnum
...@@ -116,3 +116,5 @@ val two: Lexing.position -> Lexing.position -> positions ...@@ -116,3 +116,5 @@ val two: Lexing.position -> Lexing.position -> positions
val lexbuf: Lexing.lexbuf -> positions val lexbuf: Lexing.lexbuf -> positions
(* Low-level printing function, for debugging. *)
val print: Lexing.position -> unit
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment