package ppx_expect
Install
Dune Dependency
Authors
Maintainers
Sources
md5=bc426d44bd413aa231e484c7c3378185
sha512=036b039cf069b2a283135bdb1d7643719bec2eaca59debd0b20d7b87742d4404c0db2259ef46ad7ecc77520f3272b02e2af5f83a740fdb0fc0d0479dfe3af9bb
doc/ppx_expect.runtime/Ppx_expect_runtime/Compact_loc/index.html
Module Ppx_expect_runtime.Compact_loc
Source
type t = {
start_bol : Base.int;
(*Index of the first character of the first line in the range.
*)start_pos : Base.int;
(*Index of the first character in the range.
*)end_pos : Base.int;
(*Index of the last character in the range.
*)
}
A range of characters in a source file.
Notably, Compact_loc.t
does not store the name of the file itself; it only represents the range of characters.
Consider this diagram, where the characters /[a-b]/
represent the included range, and the characters /[.0]/
represent the surrounding text:
....... 0.........a----- ------------ -----b .........
Then start_bol
is the position of 0
, start_pos
of a
, and end_pos
of b
.
This record corresponds to a Ppxlib.Location.t
restricted to just the loc_start.pos_cbol
, loc_start.pos_cnum
, and loc_end.pos_cnum
fields.
Compact_loc.t
satisfies the natural definition of equality. We write it by hand only to minimize external dependencies.