package catala

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

Module Clerk_lib.Clerk_scanSource

This module is responsible for scanning Catala files, extracting dependency and test information. It is based on the lightweight "line-parser" (Surface.Parser_driver.line)

Sourcetype item = {
  1. file_name : Catala_utils.File.t;
  2. module_def : string Catala_utils.Mark.pos option;
  3. extrnal : bool;
  4. used_modules : string Catala_utils.Mark.pos list;
  5. included_files : Catala_utils.File.t Catala_utils.Mark.pos list;
  6. has_inline_tests : bool;
  7. has_scope_tests : bool Lazy.t;
}

Contains all the data extracted from a single Catala file. Lists are in reverse file order.

Guesses Catala dialect from file-name and global options

Scans a single Catala file into an item

Recursively scans a directory, and returns the corresponding subdirectories and items in sequence, by directory.

Sourceval test_command_args : string -> string option

Parses a test command-line (in the form "$ catala <args>") and returns the arguments as a string, or None if there is no match

Sourceval find_test_scope : lang:Catala_utils.Global.backend_lang -> Catala_utils.File.t -> bool

Checks if the given file contains #test scope annotations, recursively through file includes. The file extension takes precendence over the ~lang argument.

Sourceval target_file_name : item -> Catala_utils.File.t

Returns the expected name (without extension) for artifacts based on this file: the module name is used if defined, otherwise the original file is used. In both case, it is normalised using String.to_id.