package lambdapi
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=66d7d29f7a0d10493b8178c4c3aeb247971e24fab3eba1c54887e1b9a82fe005
sha512=69ecf2406e4c7225ab7f8ebe11624db5d2ab989c8f30f5b6e5d426fd8ef9102f142a2840af16fb9103bb712ebcf7d314635f8b413a05df66e7b7a38548867032
doc/lambdapi.common/Common/Pos/index.html
Module Common.PosSource
Source code position management. This module may be used to map sequences of characters in a source file to an abstract syntax tree.
type pos = {fname : string option;(*File name for the position.
*)start_line : int;(*Line number of the starting point.
*)start_col : int;(*Column number (utf8) of the starting point.
*)end_line : int;(*Line number of the ending point.
*)end_col : int;(*Column number (utf8) of the ending point.
*)
}Type of a position, corresponding to a continuous range of characters in a (utf8-encoded) source.
type 'a loc = {elt : 'a;(*The element that is being localised.
*)pos : popt;(*Position of the element in the source code.
*)
}Type constructor extending a type (e.g. a piece of abstract syntax) with a a source code position.
none elt wraps elt in a 'a loc structure without any specific source code position.
to_string ?print_fname pos transforms pos into a readable string. If print_fname is true (the default), the filename contained in pos is printed.
pp ppf pos prints the optional position pos on ppf.
pp_short ppf pos prints the optional position pos on ppf.
map f loc applies function f on the value of loc and keeps the position unchanged.
locate ?fname loc converts the pair of position loc and filename fname of the Lexing library into a pos.
make_pos lps elt creates a located element from the lexing positions lps and the element elt.