Skip to content

Commit cb467c1

Browse files
committed
Expose Lexer.comments in the Parse module
1 parent 5b12760 commit cb467c1

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

ast/import.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,6 @@ module Parse = struct
211211
let core_type lexbuf = core_type lexbuf |> Of_ocaml.copy_core_type
212212
let expression lexbuf = expression lexbuf |> Of_ocaml.copy_expression
213213
let pattern lexbuf = pattern lexbuf |> Of_ocaml.copy_pattern
214+
215+
let comments_in_last_parse = comments_in_last_parse
214216
end

astlib/parse.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
include Ocaml_common.Parse
2+
3+
let comments_in_last_parse = Ocaml_common.Lexer.comments

astlib/parse.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ val expression : Lexing.lexbuf -> Parsetree.expression
2020

2121
val pattern : Lexing.lexbuf -> Parsetree.pattern
2222
(** Parse a pattern *)
23+
24+
val comments_in_last_parse : unit -> (string * Location.t) list
25+
(** Get the comments from the last parse *)

0 commit comments

Comments
 (0)