sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
type pos = {
name : string;
file's name
*)line : int;
line number
*)col : int;
column number
*)phantom : bool;
is the postion a "phantom", i.e. not really in the file
*)}
Type to represent position
type t = pos
Abbreviation
val phantom : pos
a phantom position, used for grammar accepting the empty input
val get_pos : Input.buffer -> Input.pos -> pos
Get a position from an input buffer and a column number
val print_buf_pos :
?style:style ->
unit ->
Stdlib.out_channel ->
(Input.buffer * Input.pos) ->
unit
print_buf_pos () ch (buf,pos) = print_pos () ch (get_pos buf pos)
exception Parse_error of Input.buffer * Input.pos * string list
Exception raised by the function below when parsing fails
val handle_exception :
?error:(exn -> 'b) ->
?style:style ->
('a -> 'b) ->
'a ->
'b
handle_exception fn v
applies the function fn
to v
and handles the Parse_error
exception. In particular, a parse error message is presented to the user in case of a failure, then error e
is called where e is the raised exception. The default error
is fun _ -> exit 1
. raise
is another possibility.