class cursor : ?c:counter -> string ->
object
.. end
A class derived from
Cf_parser.cursor
that intercepts newline characters
to track the row and column of a cursor position. Use
new cursor ~c s
to
construct an initial cursor position, optionally with the counter
c
(default:
counter_zero
), and a string
s
containing the character
sequence that is recognized as a newline, e.g. "\013\010" indicates that
newline is a CR LF sequence.
Inherits
val row_ : int
The current row number
val col_ : int
The current column number
val nl0_ : char list
The newline sequence as a char list
.
val nlz_ : char list
The current tail of the newline.
method private next : char -> int * int * char list
self#next c
is called in the advance
method to return a new
values for the row_
, col_
and nlz_
members.
method counter : counter
Returns a new counter object containing the row, column and index
of the current cursor position.
method row : int
Returns the row_
member.
method col : int
Returns the col_
member.