package catala
Install
Dune Dependency
Authors
Maintainers
Sources
md5=5abd76e8c51a47670645e91b21b57fc5
sha512=9c6fbe50c0b5a60566e877eeddadca0a339e2ce35deb5c1beceb03bc40eb6af2d519313e71859d88645b53fad591d4fa5288c633b185c9d765603da0f5b7dd7b
doc/catala_utils.html
Compiler utilities
Unique identifiers
In the desugared representation or in the the scope language, a number of things are named using global identifiers. These identifiers use OCaml's type system to statically distinguish e.g. a scope identifier from a struct identifier.
The Catala_utils.Uid
module provides a generative functor whose output is a fresh sort of global identifiers.
Related modules:
Catala_utils.Uid
Global identifiers factories using a generative functor
Source code positions
This module is used throughout the compiler to annotate the abstract syntax trees with information about the position of the element in the original source code. These annotations are critical to produce readable error messages.
Related modules:
Catala_utils.Pos
Source code position
Error messages
Error handling is critical in a compiler. The Catala compiler uses an architecture of error messages inspired by the Rust compiler, where error messages all correspond to the same exception. This exception carries messages and positions that are displayed in the end in a nicely-formatted error message.
Hence, all error thrown by the compiler should use Catala_utils.Message
Related modules:
Catala_utils.Message
Interface for emitting compiler messages.
Other utilies
Related modules:
Catala_utils.File
Catala_utils.Mark
AST node annotations (used for position, type, etc.)Catala_utils.Cli
Catala_utils.String
Catala_utils.Suggestions