package grace
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=6948979d6ffb5e596773baead81e9ceef36726d6956261bdd62abb2666a45bfc
sha512=db8b39cc9a77d919ab3123bb4047bb6c672c61db9fc6810951e267b2b113c4ac07266ef57188c6db0c02cb4d43d054204cd66ebc91648dbd1da1228022b0e67b
doc/grace.source_reader/Grace_source_reader/index.html
Module Grace_source_readerSource
A source reader maintains a global table mapping source descriptors to their contents and their line starts.
A source descriptor is a handle for an open source
init () initializes the global source reader table.
clear () clears the global source reader table.
with_reader f runs f with an initialized reader table, clearing it once f returns.
open_source src opens the source, returning its descriptor.
line_starts sd returns the (possibly cached) line starts of the source sd.
length sd returns the length or size in bytes of src.
It is semantically equivalent to Source.length src.
unsafe_get sd i reads the ith byte of the source without performing any bounds checks on i.
slice sd range reads the slice of bytes defined by range.
lines sd returns an iterator over lines in source sd.
lines_in_range sd range returns an iterator over lines in the range in sd.