From 6101661a889752a9c70cb37285a533f784501b39 Mon Sep 17 00:00:00 2001 From: Cristiano Calcagno Date: Thu, 7 Jul 2022 08:40:38 +0200 Subject: [PATCH] Begin preparing for source syntax. See https://github.com/rescript-lang/syntax/pull/600 --- jscomp/frontend/ast_attributes.ml | 4 ++-- jscomp/ml/translcore.ml | 2 +- lib/4.06.1/unstable/js_compiler.ml | 6 +++--- lib/4.06.1/unstable/js_playground_compiler.ml | 6 +++--- lib/4.06.1/whole_compiler.ml | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/jscomp/frontend/ast_attributes.ml b/jscomp/frontend/ast_attributes.ml index 54887e66c..b6e3e35ab 100644 --- a/jscomp/frontend/ast_attributes.ml +++ b/jscomp/frontend/ast_attributes.ml @@ -164,10 +164,10 @@ let is_inline : attr -> bool = let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline let is_await : attr -> bool = - fun ({ txt }, _) -> txt = "await" + fun ({ txt }, _) -> txt = "await" || txt = "res.await" let is_async : attr -> bool = - fun ({ txt }, _) -> txt = "async" + fun ({ txt }, _) -> txt = "async" || txt = "res.async" let has_await_payload (attrs : t) = Ext_list.find_first attrs is_await let has_async_payload (attrs : t) = Ext_list.find_first attrs is_async diff --git a/jscomp/ml/translcore.ml b/jscomp/ml/translcore.ml index 5b081f39c..d4431eb89 100644 --- a/jscomp/ml/translcore.ml +++ b/jscomp/ml/translcore.ml @@ -696,7 +696,7 @@ and transl_exp0 (e : Typedtree.expression) : Lambda.lambda = | Texp_let (rec_flag, pat_expr_list, body) -> transl_let rec_flag pat_expr_list (transl_exp body) | Texp_function { arg_label = _; param; cases; partial } -> - let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async") in + let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in let params, body, return_unit = let pl = push_defaults e.exp_loc [] cases partial in transl_function e.exp_loc partial param pl diff --git a/lib/4.06.1/unstable/js_compiler.ml b/lib/4.06.1/unstable/js_compiler.ml index 19241a6d1..9d9fc538a 100644 --- a/lib/4.06.1/unstable/js_compiler.ml +++ b/lib/4.06.1/unstable/js_compiler.ml @@ -254564,10 +254564,10 @@ let is_inline : attr -> bool = let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline let is_await : attr -> bool = - fun ({ txt }, _) -> txt = "await" + fun ({ txt }, _) -> txt = "await" || txt = "res.await" let is_async : attr -> bool = - fun ({ txt }, _) -> txt = "async" + fun ({ txt }, _) -> txt = "async" || txt = "res.async" let has_await_payload (attrs : t) = Ext_list.find_first attrs is_await let has_async_payload (attrs : t) = Ext_list.find_first attrs is_async @@ -270226,7 +270226,7 @@ and transl_exp0 (e : Typedtree.expression) : Lambda.lambda = | Texp_let (rec_flag, pat_expr_list, body) -> transl_let rec_flag pat_expr_list (transl_exp body) | Texp_function { arg_label = _; param; cases; partial } -> - let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async") in + let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in let params, body, return_unit = let pl = push_defaults e.exp_loc [] cases partial in transl_function e.exp_loc partial param pl diff --git a/lib/4.06.1/unstable/js_playground_compiler.ml b/lib/4.06.1/unstable/js_playground_compiler.ml index 649b972c9..50ff08eff 100644 --- a/lib/4.06.1/unstable/js_playground_compiler.ml +++ b/lib/4.06.1/unstable/js_playground_compiler.ml @@ -256027,10 +256027,10 @@ let is_inline : attr -> bool = let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline let is_await : attr -> bool = - fun ({ txt }, _) -> txt = "await" + fun ({ txt }, _) -> txt = "await" || txt = "res.await" let is_async : attr -> bool = - fun ({ txt }, _) -> txt = "async" + fun ({ txt }, _) -> txt = "async" || txt = "res.async" let has_await_payload (attrs : t) = Ext_list.find_first attrs is_await let has_async_payload (attrs : t) = Ext_list.find_first attrs is_async @@ -290837,7 +290837,7 @@ and transl_exp0 (e : Typedtree.expression) : Lambda.lambda = | Texp_let (rec_flag, pat_expr_list, body) -> transl_let rec_flag pat_expr_list (transl_exp body) | Texp_function { arg_label = _; param; cases; partial } -> - let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async") in + let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in let params, body, return_unit = let pl = push_defaults e.exp_loc [] cases partial in transl_function e.exp_loc partial param pl diff --git a/lib/4.06.1/whole_compiler.ml b/lib/4.06.1/whole_compiler.ml index 732c5f599..2973f71bb 100644 --- a/lib/4.06.1/whole_compiler.ml +++ b/lib/4.06.1/whole_compiler.ml @@ -258615,10 +258615,10 @@ let is_inline : attr -> bool = let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline let is_await : attr -> bool = - fun ({ txt }, _) -> txt = "await" + fun ({ txt }, _) -> txt = "await" || txt = "res.await" let is_async : attr -> bool = - fun ({ txt }, _) -> txt = "async" + fun ({ txt }, _) -> txt = "async" || txt = "res.async" let has_await_payload (attrs : t) = Ext_list.find_first attrs is_await let has_async_payload (attrs : t) = Ext_list.find_first attrs is_async @@ -273355,7 +273355,7 @@ and transl_exp0 (e : Typedtree.expression) : Lambda.lambda = | Texp_let (rec_flag, pat_expr_list, body) -> transl_let rec_flag pat_expr_list (transl_exp body) | Texp_function { arg_label = _; param; cases; partial } -> - let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async") in + let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in let params, body, return_unit = let pl = push_defaults e.exp_loc [] cases partial in transl_function e.exp_loc partial param pl