Skip to content

Commit 46dad5b

Browse files
authored
flambda-backend: Regulate access to [Language_extension] from within Jane Syntax (#1768)
* Regulate access to [Language_extension] from within Jane Syntax * Update ocaml/parsing/jane_syntax.ml
1 parent a0f8d0c commit 46dad5b

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

parsing/jane_syntax.ml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@ open Asttypes
22
open Parsetree
33
open Jane_syntax_parsing
44

5+
(** We carefully regulate which bindings we import from [Language_extension]
6+
to ensure that we can import this file into the Jane Street internal
7+
repo with no changes.
8+
*)
9+
module Language_extension = struct
10+
include Language_extension_kernel
11+
include (
12+
Language_extension
13+
: Language_extension_kernel.Language_extension_for_jane_syntax)
14+
end
15+
16+
(* Suppress the unused module warning so it's easy to keep around the
17+
shadowing even if we delete use sites of the module. *)
18+
module _ = Language_extension
19+
520
(****************************************)
621
(* Helpers used just within this module *)
722

@@ -767,14 +782,15 @@ module N_ary_functions = struct
767782
List.iter (fun mode_annotation ->
768783
assert_extension_enabled ~loc
769784
(match (mode_annotation.txt : mode_annotation) with
770-
| Local -> Language_extension.Local
771-
| Unique | Once -> Language_extension.Unique)
785+
| Local -> Local
786+
| Unique | Once -> Unique)
772787
())
773788
mode_annotations;
774789
Mode_constraint mode_annotations)
775790
| [ "layout_annotation" ] ->
776791
Payload (fun payload ~loc ->
777-
assert_extension_enabled ~loc Layouts Language_extension.Stable;
792+
assert_extension_enabled ~loc Layouts
793+
(Stable : Language_extension.maturity);
778794
let layout_annotation =
779795
Layout_annotation.Decode.from_payload payload ~loc
780796
in

0 commit comments

Comments
 (0)