package rocq-runtime
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=a45280ab4fbaac7540b136a6b073b4a6db15739ec1e149bded43fa6f4fc25f20
doc/rocq-runtime.lib/Loc/index.html
Module LocSource
Basic types
Information about a source file.
type t = {fname : source;(*Filename or toplevel input.
*)line_nb : int;(*Start line number.
*)bol_pos : int;(*Position of the beginning of start line.
*)line_nb_last : int;(*End line number.
*)bol_pos_last : int;(*Position of the beginning of end line.
*)bp : int;(*Start position.
*)ep : int;(*End position.
*)
}Loc.t represents a range of positions in a source file. It is commonly used with 'a CAst.t.
Location manipulation
This is inherited from CAMPL4/5.
Create a location from a filename, a line number, a position of the beginning of the line, a start and end position
Merge locations, usually generating the largest possible span
sub loc sh len is the location loc shifted with sh characters and with length len. The previous ending position of the location is lost.
after loc sh len is the location just after loc (starting at the end position of loc) shifted with sh characters and of length len.
Answers true when the first location is more defined, or, when both defined, included in the second one
shift_loc loc n p shifts the beginning of location by n and the end by p; it is assumed that the shifts do not change the lines at which the location starts and ends
Located exceptions
Adding location to an exception
Retrieving the optional location of an exception