Skip to content

Commit b9a86d2

Browse files
authored
Ppx: switch to ast 408 (#826)
1 parent b88dbb7 commit b9a86d2

File tree

10 files changed

+22
-20
lines changed

10 files changed

+22
-20
lines changed

compiler/lib/js_output.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,8 @@ struct
990990
last_semi ();
991991
PP.end_group f;
992992
PP.end_group f
993-
(* There MUST be a space between the return and its
994-
argument. A line return will not work *)
993+
(* There MUST be a space between the return and its
994+
argument. A line return will not work *)
995995
)
996996
| Labelled_statement (i, s) ->
997997
PP.string f (Javascript.Label.to_string i);

js_of_ocaml-ppx.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build: [["dune" "build" "-p" name "-j" jobs]]
1616
depends: [
1717
"ocaml" {>= "4.02.0"}
1818
"dune" {build & >= "1.2"}
19-
"ocaml-migrate-parsetree" {>= "1.3.1"}
20-
"ppx_tools_versioned" {>= "5.2.2"}
19+
"ocaml-migrate-parsetree" {>= "1.4"}
20+
"ppx_tools_versioned" {>= "5.2.3"}
2121
"js_of_ocaml" {>= "3.0"}
2222
]

js_of_ocaml.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ build: [["dune" "build" "-p" name "-j" jobs]]
1818
depends: [
1919
"ocaml" {>= "4.02.0"}
2020
"dune" {build & >= "1.2"}
21-
"ocaml-migrate-parsetree" {>= "1.3.1"}
22-
"ppx_tools_versioned" {>= "5.2.2"}
21+
"ocaml-migrate-parsetree" {>= "1.4"}
22+
"ppx_tools_versioned" {>= "5.2.3"}
2323
"uchar"
2424
"js_of_ocaml-compiler"
2525
]

ppx/ppx_js/lib/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
ocaml-migrate-parsetree)
77
(ppx_runtime_libraries js_of_ocaml)
88
(kind ppx_rewriter)
9-
(preprocess (pps ppx_tools_versioned.metaquot_407)))
9+
(preprocess (pps ppx_tools_versioned.metaquot_408)))
1010

1111

1212
(rule

ppx/ppx_js/lib/ppx_js.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818

1919
(**/**)
2020

21-
val mapper : Migrate_parsetree.OCaml_407.Ast.Ast_mapper.mapper
21+
val mapper : Migrate_parsetree.OCaml_408.Ast.Ast_mapper.mapper

ppx/ppx_js/lib_internal/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
(libraries compiler-libs.common
44
ocaml-migrate-parsetree)
55
(kind ppx_rewriter)
6-
(preprocess (pps ppx_tools_versioned.metaquot_407)))
6+
(preprocess (pps ppx_tools_versioned.metaquot_408)))

ppx/ppx_js/lib_internal/ppx_js_internal.ml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
open StdLabels
2020
open Migrate_parsetree
21-
open OCaml_407.Ast
21+
open OCaml_408.Ast
2222
open Ast_helper
2323
open Asttypes
2424
open Parsetree
@@ -44,10 +44,6 @@ let tuple ?loc ?attrs = function
4444

4545
let str ?loc ?attrs s = Exp.constant ?loc ?attrs (Pconst_string (s, None))
4646

47-
module Pervasives = struct
48-
let ( ! ) = ( ! )
49-
end
50-
5147
(** Check if an expression is an identifier and returns it.
5248
Raise a Location.error if it's not.
5349
*)
@@ -87,7 +83,10 @@ let inside_Js =
8783
It turns out not to be working properly, just hiding location instead of the all
8884
ast node.
8985
*)
90-
let merlin_noloc = {txt = "merlin.loc"; loc = Location.none}, PStr []
86+
let merlin_noloc =
87+
{ attr_name = {txt = "merlin.loc"; loc = Location.none}
88+
; attr_payload = PStr []
89+
; attr_loc = Location.none }
9190

9291
module Js : sig
9392
val type_ :
@@ -501,7 +500,10 @@ let preprocess_literal_object mappper fields : [`Fields of field_desc list | `Er
501500
| false, _ -> None
502501
| true, _ -> Some (`Unkown x)
503502
in
504-
let jsoo_attributes = filter_map (fun ({txt; _}, _) -> parse_attribute txt) in
503+
let jsoo_attributes =
504+
filter_map (fun {attr_name = {txt; _}; attr_payload = _; attr_loc = _} ->
505+
parse_attribute txt)
506+
in
505507
let f (names, fields) exp =
506508
match exp.pcf_desc with
507509
| Pcf_val (id, mut, Cfk_concrete (bang, body)) ->
@@ -754,5 +756,5 @@ let mapper =
754756
let () =
755757
Driver.register
756758
~name:"ppx_js"
757-
Migrate_parsetree.Versions.ocaml_407
759+
Migrate_parsetree.Versions.ocaml_408
758760
(fun _config _cookies -> mapper)

ppx/ppx_js/lib_internal/ppx_js_internal.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020

2121
val wrapper : string option ref
2222

23-
val mapper : Migrate_parsetree.OCaml_407.Ast.Ast_mapper.mapper
23+
val mapper : Migrate_parsetree.OCaml_408.Ast.Ast_mapper.mapper

ppx/ppx_js/tests/main.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
let () =
22
let module Converter =
33
Migrate_parsetree.Versions.Convert
4-
(Migrate_parsetree.OCaml_407)
4+
(Migrate_parsetree.OCaml_408)
55
(Migrate_parsetree.OCaml_current)
66
in
77
let mapper = Converter.copy_mapper Ppx_js.mapper in

toplevel/examples/lwt_toplevel/ppx_enabled.ml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ open Migrate_parsetree
33
let init () =
44
let module Converter =
55
Migrate_parsetree.Versions.Convert
6-
(Migrate_parsetree.OCaml_407)
6+
(Migrate_parsetree.OCaml_408)
77
(Migrate_parsetree.OCaml_current)
88
in
99
let mapper = Converter.copy_mapper Ppx_js.mapper in

0 commit comments

Comments
 (0)