Skip to content

Commit

Permalink
delete unused [is_erasable_jane_syntax] function
Browse files Browse the repository at this point in the history
this function had just one remaining use site, having to do with
currying attributes

Signed-off-by: David Vulakh <[email protected]>
  • Loading branch information
dvulakh committed Dec 30, 2024
1 parent d83dc4b commit 57debe8
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions lib/Normalize_std_ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ let is_doc = function
| {attr_name= {Location.txt= "ocaml.doc" | "ocaml.text"; _}; _} -> true
| _ -> false

let is_erasable_jane_syntax attr =
let name = attr.attr_name.txt in
String.is_prefix ~prefix:"jane.erasable." name
(* CR jane-syntax: When erasing jane syntax, [int -> (int -> int)] is
reformatted to [int -> int -> int]. This causes the removal of
[extension.curry] attributes, so these attributes should be considered
"erasable jane syntax" *)
|| String.equal "extension.curry" name

(* We rewrite both "[@immediate]" and "[@ocaml.immediate]" into ":
immediate", which is then turned into just "[@immediate]" if we are
erasing jane syntax. This means "[@ocaml.immediate]" get rewritten to
Expand Down Expand Up @@ -132,7 +123,13 @@ let make_mapper conf ~ignore_doc_comments ~erase_jane_syntax =
=
let atrs =
if erase_jane_syntax then
List.filter atrs ~f:(fun a -> not (is_erasable_jane_syntax a))
List.filter atrs ~f:(fun a ->
(* CR jane-syntax: When erasing jane syntax, [int -> (int ->
int)] is reformatted to [int -> int -> int]. This causes the
removal of [extension.curry] attributes, so these attributes
should be dropped when normalizing under jane syntax
erasure. *)
not (String.equal "extension.curry" a.attr_name.txt) )
else atrs
in
let atrs =
Expand Down

0 comments on commit 57debe8

Please sign in to comment.