package lrgrep
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=e53de12e4c5cbe6bca00643593266b4f9fa2e3f6a138195eeff7a4329f5c1c75
sha512=7fd7c4d11506fea7cc11c9bbf5aea9142d905643553c0c90e1bb16b794106b0c14a266acf89ae91b6929008dc0ba6515f788642873e2e4ba6c3d49bd45d25127
doc/utils/Utils/Code_printer/index.html
Module Utils.Code_printerSource
Module for printing text with line tracking and location output. This is useful for compilers and preprocessors that need to generate code that refers to locations in external files. The module allows tracking of code positions and can output directives indicating where the code was originally located in the source files.
Opaque type representing the state of the code printer.
create ~filename ?line output_function creates a new code printer. filename is the name of the output file. line is the line number at which output starts to be appended (defaults to 1). output_function is called to append a string to the output file.
print t ?loc text appends text to t. If loc is provided, a directive # <loc.start_line> <loc.loc_file> is emitted to indicate that text was extracted from loc. If loc is not provided, a directive # <output filename> <output current line number> is emitted if necessary to indicate that text is code specific to the printed file.