package catala

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Surface.LexerSource

Concise syntax with English abbreviated keywords.

Sourceval is_code : bool ref

Boolean reference, used by the lexer as the mutable state to distinguish whether it is lexing code or law.

Sourceval code_string_acc : string ref

Mutable string reference that accumulates the string representation of the body of code being lexed. This string representation is used in the literate programming backends to faithfully capture the spacing pattern of the original program

Sourceval update_acc : Sedlexing.lexbuf -> unit

Updates code_string_acc with the current lexeme

Sourceval raise_lexer_error : Utils.Pos.t -> string -> 'a

Error-generating helper

Sourceval token_list_language_agnostic : (string * Parser.token) list

Associative list matching each punctuation string part of the Catala syntax with its Surface.Parser token. Same for all the input languages (English, French, etc.)

Sourceval token_list : (string * Parser.token) list

Same as token_list_language_agnostic, but with tokens whose string varies with the input language.

Main lexing function used in a code block

Main lexing function used outside code blocks

Entry point of the lexer, distributes to lex_code or lex_law depending of is_code.

OCaml

Innovation. Community. Security.