Clerk_lib.Clerk_scanSourceThis module is responsible for scanning Catala files, extracting dependency and test information. It is based on the lightweight "line-parser" (Surface.Parser_driver.line)
type item = {file_name : Catala_utils.File.t;module_def : string Catala_utils.Mark.pos option;extrnal : bool;used_modules : string Catala_utils.Mark.pos list;included_files : Catala_utils.File.t Catala_utils.Mark.pos list;has_inline_tests : bool;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
val tree :
Catala_utils.File.t ->
(Catala_utils.File.t * Catala_utils.File.t list * item list) Seq.tRecursively scans a directory, and returns the corresponding subdirectories and items in sequence, by directory.
Parses a test command-line (in the form "$ catala <args>") and returns the arguments as a string, or None if there is no match
Checks if the given file contains #test scope annotations, recursively through file includes. The file extension takes precendence over the ~lang argument.
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.