package catala

  1. Overview
  2. Docs
Low-level language for tax code specification

Install

Dune Dependency

Authors

Maintainers

Sources

0.2.0.tar.gz
md5=4c6f725ef4d21c5ff91f60d74b454ef7
sha512=98806e03daa6f33740b80a0f78a37320fb70ebea8cb927ea8fed022673459189c32e2389ccba0fa25d93f754b0fa0128a5ee28e1bb9abefa330deb4be8cc7d95

doc/catala.utils/Utils/Pos/index.html

Module Utils.PosSource

Source code position

A position in the source code is a file, as well as begin and end location of the form col:line

Constructor and getters

Sourceval from_info : string -> int -> int -> int -> int -> t
Sourceval get_start_line : t -> int
Sourceval get_start_column : t -> int
Sourceval get_end_line : t -> int
Sourceval get_end_column : t -> int
Sourceval get_file : t -> string

Formatters

Sourceval to_string : t -> string

Formats a position like this:

in file <file>, from <start_line>:<start_col> to <end_line>:<end_col>
Sourceval to_string_short : t -> string

Formats a position like this:

<file>;<start_line>:<start_col>--<end_line>:<end_col>
Sourceval retrieve_loc_text : t -> string

Open the file corresponding to the position and retrieves the text concerned by the position

AST markings

Sourcetype 'a marked = 'a * t

Everything related to the source code should keep its position stored, to improve error messages

Sourceval no_pos : t

Placeholder position

Sourceval unmark : 'a marked -> 'a
Sourceval get_position : 'a marked -> t
Sourceval map_under_mark : ('a -> 'b) -> 'a marked -> 'b marked
Sourceval same_pos_as : 'a -> 'b marked -> 'a marked
Sourceval unmark_option : 'a marked option -> 'a option
OCaml

Innovation. Community. Security.