Extension of standard library's positions.
Abstract type for pairs of positions in the lexing stream.
Decoration of a value with a position.
value dv returns the raw value that underlies the decorated value dv.
value dv
dv
position dv returns the position that decorates the decorated value dv.
position dv
with_pos p v decorates v with a position p.
with_pos p v
v
p
map f v extends the decoration from v to f v.
map f v
f v
iter f dv applies f to the value inside dv.
iter f dv
f
mapd f v extends the decoration from v to both members of the pair f v.
mapd f v
This value is used when an object does not from a particular input location.
column p returns the number of characters from the beginning of the line of the Lexing.position p.
column p
column p returns the line number of to the Lexing.position p.
characters p1 p2 returns the character interval between p1 and p2 assuming they are located in the same line.
characters p1 p2
p1
p2
join p1 p2 returns a position that starts where p1 starts and stops where p2 stops.
join p1 p2
string_of_lex_pos p returns a string representation for the lexing position p.
string_of_lex_pos p
string_of_pos p returns the standard (Emacs-like) representation of the position p.
string_of_pos p
pos_or_undef po is the identity function except if po = None, in that case, it returns undefined_position.
pos_or_undef po
undefined_position
cpos lexbuf returns the current position of the lexer.
cpos lexbuf
string_of_cpos p returns a string representation of the lexer's current position.
string_of_cpos p