diff --git a/ast/import.ml b/ast/import.ml index d281f178..c4b242ad 100644 --- a/ast/import.ml +++ b/ast/import.ml @@ -211,4 +211,6 @@ module Parse = struct let core_type lexbuf = core_type lexbuf |> Of_ocaml.copy_core_type let expression lexbuf = expression lexbuf |> Of_ocaml.copy_expression let pattern lexbuf = pattern lexbuf |> Of_ocaml.copy_pattern + + let comments_in_last_parse = comments_in_last_parse end diff --git a/astlib/parse.ml b/astlib/parse.ml index d82ef0aa..e1620903 100644 --- a/astlib/parse.ml +++ b/astlib/parse.ml @@ -1 +1,3 @@ include Ocaml_common.Parse + +let comments_in_last_parse = Ocaml_common.Lexer.comments diff --git a/astlib/parse.mli b/astlib/parse.mli index 2181d5ae..c407ae47 100644 --- a/astlib/parse.mli +++ b/astlib/parse.mli @@ -20,3 +20,6 @@ val expression : Lexing.lexbuf -> Parsetree.expression val pattern : Lexing.lexbuf -> Parsetree.pattern (** Parse a pattern *) + +val comments_in_last_parse : unit -> (string * Location.t) list +(** Get the comments from the last parse *)