ce5464f9af
instead of a closed set of languages. I also removed the offsets: I simply use the current region to determine whether the preprocessing directie starts at the beginning of a line. I also removed scanning line indicators, to make the lexer simpler. |
||
---|---|---|
.. | ||
.E_LexerMain.tag | ||
.E_Parser.mly.tag | ||
.E_ParserMain.tag | ||
.gitignore | ||
.links | ||
.PreprocMain.ml | ||
.PreprocMain.tag | ||
dune | ||
dune-project | ||
E_AST.ml | ||
E_Lexer.mli | ||
E_Lexer.mll | ||
E_LexerMain.ml | ||
E_Parser.mly | ||
E_ParserMain.ml | ||
EvalOpt.ml | ||
EvalOpt.mli | ||
LICENSE | ||
Makefile.cfg | ||
Preproc.mli | ||
Preproc.mll | ||
Preprocessor.ml | ||
Preprocessor.opam | ||
PreprocMain.ml | ||
README.md |
A preprocessor a la C# in OCaml
The following preprocessing directives are supported
- #define
- #elif
- #else
- #endif
- #endregion
- #error
- #if
- #include
- #region
- #undef
Note: Because it is meant for LIGO, there is no error raised for
invalid preprocessing directives, as the symbol #
is valid in
PascaLIGO (cons operator for lists). Also, the preprocessor may report an error on some weird but valid PascaLIGO contracts, like
const include : list (int) = list [1] const l : list (int) = 0