From 29d83b8ab81b19f50169daf4615d5748e5f43698 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 124950d53..d35e6449e 100644 --- a/lib/4.06.1/unstable/js_compiler.ml +++ b/lib/4.06.1/unstable/js_compiler.ml @@ -254556,10 +254556,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 @@ -270218,7 +270218,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 d27b48713..cf9e0ac65 100644 --- a/lib/4.06.1/unstable/js_playground_compiler.ml +++ b/lib/4.06.1/unstable/js_playground_compiler.ml @@ -256019,10 +256019,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 @@ -290827,7 +290827,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 d66d97033..740022b1a 100644 --- a/lib/4.06.1/whole_compiler.ml +++ b/lib/4.06.1/whole_compiler.ml @@ -258607,10 +258607,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 @@ -273347,7 +273347,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