
* Reverted [pos.mli] to the previous signature, except [Pos.min] that now takes a labelled parameter [file]. * Reverted [ParserAPI.ml] to the previous signature. * Reexported [shor_error] in [ParserUnit]. * Changed the modules [LexToken] so that they export one function to make attributes, the first, additional paramater being "[@" or "[@@" (and invalid in PascaLIGO). * Added support in all [ParserLog] for attributes (pretty-printings). * Added AST nodes [Attr] and [AttrDecl] to PascaLIGO. The simplifier takes care of hooking them with their respective declarations or discarding them. (In the future, we should issue a warning for detached attributes.)
40 lines
924 B
OCaml
40 lines
924 B
OCaml
|
|
module ParserLog = Parser_pascaligo.ParserLog
|
|
module ParErr = Parser_pascaligo.ParErr
|
|
module SSet = Utils.String.Set
|
|
|
|
(* Mock options. TODO: Plug in cmdliner. *)
|
|
|
|
let pre_options =
|
|
EvalOpt.make
|
|
~libs:[]
|
|
~verbose:SSet.empty
|
|
~offsets:true
|
|
~mode:`Point
|
|
~cmd:EvalOpt.Quiet
|
|
~mono:true (* Monolithic API of Menhir for now *)
|
|
(* ~input:None *)
|
|
(* ~expr:true *)
|
|
|
|
module Parser =
|
|
struct
|
|
type ast = AST.t
|
|
type expr = AST.expr
|
|
include Parser_pascaligo.Parser
|
|
end
|
|
|
|
module ParserLog =
|
|
struct
|
|
type ast = AST.t
|
|
type expr = AST.expr
|
|
include Parser_pascaligo.ParserLog
|
|
end
|
|
|
|
module PreUnit = ParserUnit.Make (Lexer)(AST)(Parser)(ParErr)(ParserLog)
|
|
module Front = ParserAPI.Make (Lexer)(Parser)(ParErr)
|
|
|
|
let issue_error point =
|
|
let error = Front.format_error ~offsets:true (* TODO: CLI *)
|
|
`Point (* TODO: CLI *) point
|
|
in Stdlib.Error error
|