Project

General

Profile

« Previous | Next » 

Revision fd19d190

Added by Pierre-Loïc Garoche almost 7 years ago

New function in Location to access to line number

View differences:

src/location.ml
78 78
  print_string ":";
79 79
  print_newline ()
80 80

  
81

  
81
let loc_line loc = loc.loc_start.Lexing.pos_lnum 
82
  
82 83
let pp_loc fmt loc =
83 84
  if loc == dummy_loc then () else
84 85
  let filename = loc.loc_start.Lexing.pos_fname in
85
  let line = loc.loc_start.Lexing.pos_lnum in
86
  let line = loc_line loc in
86 87
  let start_char =
87 88
    loc.loc_start.Lexing.pos_cnum - loc.loc_start.Lexing.pos_bol
88 89
  in

Also available in: Unified diff