package catala
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=2615968670ac21b1d00386a9b04b3843
sha512=eff292fdd75012f26ce7b17020f5a8374eef37cd4dd6ba60338dfbe89fbcad3443d1b409e44c182b740da9f58dff7e76dcb8ddefe47f9b2b160666d1c6930143
doc/catala.surface/Surface/Lexer_common/index.html
Module Surface.Lexer_common
Source
Auxiliary functions used by all lexers.
Initialises the lexing context during the call of the supplied function, which is required for using the lexer. Calls can be nested. Upon termination, emits a warning if the lexer is not in a consistent state (Law
context, no pending code content)
Reference, used by the lexer as the mutable state to distinguish whether it is lexing code or law.
The position of the opening token of the last opened context
Updates the current code buffer with the current lexeme. The underlying buffer is used to accumulate 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
Flushes the code buffer and returns its contents (see update_acc
)
Error-generating helper
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.)
Calculates the precedence according a matched regex of the form : '#
+'
Gets the LAW_HEADING
token from the current lexbuf
type line_token =
| LINE_INLINE_TEST
(*```catala-test-cli
*)| LINE_BLOCK_END
(*```
*)| LINE_INCLUDE of string
(*> Include foo.catala_en
*)| LINE_MODULE_DEF of string * bool
(*> Module Xxx
*)external
| LINE_MODULE_USE of string
(*> Using Xxx
*)as Yyy
| LINE_TEST_ATTRIBUTE
(*any line containing a #
*)test
attribute| LINE_ANY
(*anything else
*)
Simplified tokens for dependency extraction