package catala

  1. Overview
  2. Docs
Compiler and library for the literate programming language for tax code specification

Install

Dune Dependency

Authors

Maintainers

Sources

0.6.0.tar.gz
md5=b22e238d5d5c8452067109e9c7c0f427
sha512=ccc8c557c67c2f9d1bed4b957b2367f0f6afc0ef9b8b83237cf2a2912b3e8829b7e8af78ea7fe00b20ecf28b436ad04b591e5fff4f82fd08725d40a18c9924d0

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

Module Utils.PosSource

Source code position

Sourcetype t

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

Custom visitor for the Pos.marked type

Constructor and getters

Sourceval from_lpos : (Lexing.position * Lexing.position) -> t
Sourceval from_info : string -> int -> int -> int -> int -> t
Sourceval overwrite_law_info : t -> string list -> t
Sourceval get_law_info : t -> string list
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
Sourcetype input_file =
  1. | FileName of string
  2. | Contents of 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 mark : t -> 'a -> 'a marked
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

Visitors

Sourceclass 'self marked_map : object ... end
Sourceclass 'self marked_iter : object ... end
OCaml

Innovation. Community. Security.