* I added CLI option "--mono" to select the monolithic API of Menhir.
* I added a field "win" to the state of the lexer (a two-token
window for error reporting).
* I escaped LIGO strings before making them OCaml strings (for
example for printing).
I also had to remove the keywords [Down], [Fail] and [Step] in
PascaLIGO that made a mysterious and unwanted come back. (I did not
bother with [git blame]).
I also had to remove the keywords [Down], [Fail] and [Step] in
PascaLIGO that made a mysterious and unwanted come back. (I did not
bother with [git blame]).
* [CameLIGO/ReasonLIGO] The AST node [EAnnot] (expressions
annotated by a type) now records the region in the source
code for the colon.
* [CameLIGO/ReasonLIGO/PascaLIGO] I added the syntax
%token <...> TOKEN "lexeme"
* [ReasonLIGO] I changed the AST nodes [Mtz] and [Str] to
[Mutez] and [String], respectively (in accordance with the
PascaLIGO front-end). I changed token [DOTDOTDOT] to
[ELLIPSIS].
* [ReasonLIGO] I added what was missing to make a loca build
with my Makefile.
Refactoring of parsing command-line arguments
* The type [options] is now abstract and implemented as an
object type to avoid struggling with scoping and type
inference when record types share some common field names.
Refactoring of ParserLog for PascaLIGO and CameLIGO
* The immediate motivation behind that refactoring was to
remove the use of a couple of global references. A
consequence is that we have a nicer and more compact code, by
threading a state. The files [pascaligo/Tests/pp.ligo] and
[ligodity/Tests/pp.mligo].
* Another consequence is that the choice of making strings from
AST nodes depends on the CLI (offsets? mode?). After this
refactoring, that choice is hardcoded in the simplifiers in a
few places (TODO), waiting for a general solution that would
have all CL options flow through the compiler.
* I removed the use of vendors [x_option.ml], [x_map.ml] and
[x_list.ml] when handling optional values. (Less dependencies
this way.)
Refactoring of the ASTs
* I removed the node [local_decl], which was set to [[]]
already in a previous commit (which removed local
declarations as being redundant, as statements could already
be instructions or declarations).
* I changed [StrLit] to [String] in the AST of CameLIGO and
ReasonLIGO.
* I also changed the type [fun_expr] so now either a block is
present, and therefore followed by the [with] keyword, or it
is not. (Before, the presence of a block was not enforced in
the type with the presence of the keyword.)
Notes
* [LexerMain.ml] and [ParserMain.ml] for CameLIGO and PascaLIGO
are almost identical and differ in the same way (language
name and file extension), which suggests that they should be
in the [shared] folder and instanciated as a functor in the
future (TODO).
* I removed the blank characters at the end of many lines in
the parser of ReasonLIGO.