Permalink
Browse files

Recognize both prefixed and unprefixed built-in attributes (e.g. ocam…

…l.deprecated or deprecated).

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14750 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
alainfrisch committed May 6, 2014
1 parent 27e9e78 commit 85a176334ea047ddda50f65232ec36b3d9de6ea6
Showing with 9 additions and 3 deletions.
  1. +5 −1 typing/typecore.ml
  2. +4 −2 typing/typetexp.ml
View
@@ -293,7 +293,11 @@ let extract_label_names sexp env ty =
assert false
let explicit_arity =
- List.exists (fun (s, _) -> s.txt = "ocaml.explicit_arity")
+ List.exists
+ (function
+ | ({txt="ocaml.explicit_arity"|"explicit_arity"; _}, _) -> true
+ | _ -> false
+ )
(* Typing of patterns *)
View
@@ -58,7 +58,9 @@ exception Error of Location.t * Env.t * error
let check_deprecated loc attrs s =
if
List.exists
- (function ({txt = "ocaml.deprecated"; _}, _) -> true | _ -> false)
+ (function
+ | ({txt = "ocaml.deprecated"|"deprecated"; _}, _) -> true
+ | _ -> false)
attrs
then
Location.prerr_warning loc (Warnings.Deprecated s)
@@ -67,7 +69,7 @@ let warning_attribute attrs =
let prev_warnings = ref None in
List.iter
(function
- | ({txt = "ocaml.warning"; loc}, payload) ->
+ | ({txt = "ocaml.warning"|"warning"; loc}, payload) ->
begin match payload with
| PStr [{pstr_desc=Pstr_eval
({pexp_desc=Pexp_constant(Const_string(s, _))}, _)}] ->

0 comments on commit 85a1763

Please sign in to comment.