Recognize [@@ocaml.immediate] in addition to [@@immediate].

master
alainfrisch 2016-07-11 13:27:44 +02:00
parent d86aa4cd26
commit a345b7307a
4 changed files with 13 additions and 4 deletions

View File

@ -188,3 +188,10 @@ let explicit_arity =
| ({txt="ocaml.explicit_arity"|"explicit_arity"; _}, _) -> true
| _ -> false
)
let immediate =
List.exists
(function
| ({txt="ocaml.immediate"|"immediate"; _}, _) -> true
| _ -> false
)

View File

@ -23,6 +23,7 @@
ocaml.explicit_arity (for camlp4/camlp5)
ocaml.warn_on_literal_pattern
ocaml.deprecated_mutable
ocaml.immediate
*)
@ -45,3 +46,6 @@ val emit_external_warnings: Ast_iterator.iterator
val warn_on_literal_pattern: Parsetree.attributes -> bool
val explicit_arity: Parsetree.attributes -> bool
val immediate: Parsetree.attributes -> bool

View File

@ -856,7 +856,7 @@ let rec tree_of_type_decl id decl =
Public
in
let immediate =
List.exists (fun (loc, _) -> loc.txt = "immediate") decl.type_attributes
Builtin_attributes.immediate decl.type_attributes
in
{ otype_name = name;
otype_params = args;

View File

@ -898,9 +898,7 @@ let is_hash id =
String.length s > 0 && s.[0] = '#'
let marked_as_immediate decl =
List.exists
(fun (loc, _) -> loc.txt = "immediate")
decl.type_attributes
Builtin_attributes.immediate decl.type_attributes
let compute_immediacy env tdecl =
match (tdecl.type_kind, tdecl.type_manifest) with