package catala

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

Module Surface.Parser_stateSource

Our parser crosses the bounds of LR parsing for two features:

  • attaching breadcrumbs to every position (leading titles, subtitles, etc.)
  • attaching attributes to the directly following node, notwithstanding the normal syntax hierarchy

for these purposes we maintain a little bit of state and contained side-effects.

Sourcetype t
Sourceval with_state : (Sedlexing.lexbuf -> 'a) -> Sedlexing.lexbuf -> 'a

Mandatory wrapper around parser calls

Sourceval new_heading : (string * string option * bool * int) -> (Lexing.position * Lexing.position) -> Ast.law_heading
Sourceval get_current_heading : unit -> string list