
LexToken, AST: Tiny refactoring. Bug: Added the making of the AST node PBytes. Parser: The rule "pattern" was not properly stratified (the constructor "PCons" was always produced, even when no consing was done (now a fall-through to "core_pattern"). Bug: When sharing the lexers between Ligodity and Pascaligo, a regression was introduced with the lexing of symbols. Indeed, symbols specific to Ligodity (like "<>") and Pascaligo (like "=/=") were scanned, but the function "LexToken.mk_sym" for each only accepted their own, yielding to an assertion to be invalidated. Fix: I created an error "sym_err" now to gracefully handle that situation and provide a hint to the programmer (to wit, to check the LIGO syntax in use). WIP: Started to write pretty-printing functions for the nodes of the AST. CLI: The option "--verbose=ast" now calls that function instead of printing the tokens from the AST. When the pretty-printer is finished, the option for printing the tokens will likely be "--verbose=ast-tokens".
17 lines
538 B
OCaml
17 lines
538 B
OCaml
(* Printing the AST *)
|
|
|
|
val offsets : bool ref
|
|
val mode : [`Byte | `Point] ref
|
|
|
|
val print_tokens : Buffer.t -> AST.t -> unit
|
|
val print_path : Buffer.t -> AST.path -> unit
|
|
val print_pattern : Buffer.t -> AST.pattern -> unit
|
|
val print_instruction : Buffer.t -> AST.instruction -> unit
|
|
|
|
val tokens_to_string : AST.t -> string
|
|
val path_to_string : AST.path -> string
|
|
val pattern_to_string : AST.pattern -> string
|
|
val instruction_to_string : AST.instruction -> string
|
|
|
|
val pp_ast : Buffer.t -> AST.t -> unit
|