Skip to content

Commit 29d83b8

Browse files
committed
Begin preparing for source syntax.
See rescript-lang/syntax#600
1 parent 53b5950 commit 29d83b8

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

jscomp/frontend/ast_attributes.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ let is_inline : attr -> bool =
164164
let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline
165165

166166
let is_await : attr -> bool =
167-
fun ({ txt }, _) -> txt = "await"
167+
fun ({ txt }, _) -> txt = "await" || txt = "res.await"
168168

169169
let is_async : attr -> bool =
170-
fun ({ txt }, _) -> txt = "async"
170+
fun ({ txt }, _) -> txt = "async" || txt = "res.async"
171171

172172
let has_await_payload (attrs : t) = Ext_list.find_first attrs is_await
173173
let has_async_payload (attrs : t) = Ext_list.find_first attrs is_async

jscomp/ml/translcore.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ and transl_exp0 (e : Typedtree.expression) : Lambda.lambda =
696696
| Texp_let (rec_flag, pat_expr_list, body) ->
697697
transl_let rec_flag pat_expr_list (transl_exp body)
698698
| Texp_function { arg_label = _; param; cases; partial } ->
699-
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async") in
699+
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in
700700
let params, body, return_unit =
701701
let pl = push_defaults e.exp_loc [] cases partial in
702702
transl_function e.exp_loc partial param pl

lib/4.06.1/unstable/js_compiler.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -254556,10 +254556,10 @@ let is_inline : attr -> bool =
254556254556
let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline
254557254557

254558254558
let is_await : attr -> bool =
254559-
fun ({ txt }, _) -> txt = "await"
254559+
fun ({ txt }, _) -> txt = "await" || txt = "res.await"
254560254560

254561254561
let is_async : attr -> bool =
254562-
fun ({ txt }, _) -> txt = "async"
254562+
fun ({ txt }, _) -> txt = "async" || txt = "res.async"
254563254563

254564254564
let has_await_payload (attrs : t) = Ext_list.find_first attrs is_await
254565254565
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 =
270218270218
| Texp_let (rec_flag, pat_expr_list, body) ->
270219270219
transl_let rec_flag pat_expr_list (transl_exp body)
270220270220
| Texp_function { arg_label = _; param; cases; partial } ->
270221-
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async") in
270221+
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in
270222270222
let params, body, return_unit =
270223270223
let pl = push_defaults e.exp_loc [] cases partial in
270224270224
transl_function e.exp_loc partial param pl

lib/4.06.1/unstable/js_playground_compiler.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -256019,10 +256019,10 @@ let is_inline : attr -> bool =
256019256019
let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline
256020256020

256021256021
let is_await : attr -> bool =
256022-
fun ({ txt }, _) -> txt = "await"
256022+
fun ({ txt }, _) -> txt = "await" || txt = "res.await"
256023256023

256024256024
let is_async : attr -> bool =
256025-
fun ({ txt }, _) -> txt = "async"
256025+
fun ({ txt }, _) -> txt = "async" || txt = "res.async"
256026256026

256027256027
let has_await_payload (attrs : t) = Ext_list.find_first attrs is_await
256028256028
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 =
290827290827
| Texp_let (rec_flag, pat_expr_list, body) ->
290828290828
transl_let rec_flag pat_expr_list (transl_exp body)
290829290829
| Texp_function { arg_label = _; param; cases; partial } ->
290830-
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async") in
290830+
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in
290831290831
let params, body, return_unit =
290832290832
let pl = push_defaults e.exp_loc [] cases partial in
290833290833
transl_function e.exp_loc partial param pl

lib/4.06.1/whole_compiler.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -258607,10 +258607,10 @@ let is_inline : attr -> bool =
258607258607
let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline
258608258608

258609258609
let is_await : attr -> bool =
258610-
fun ({ txt }, _) -> txt = "await"
258610+
fun ({ txt }, _) -> txt = "await" || txt = "res.await"
258611258611

258612258612
let is_async : attr -> bool =
258613-
fun ({ txt }, _) -> txt = "async"
258613+
fun ({ txt }, _) -> txt = "async" || txt = "res.async"
258614258614

258615258615
let has_await_payload (attrs : t) = Ext_list.find_first attrs is_await
258616258616
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 =
273347273347
| Texp_let (rec_flag, pat_expr_list, body) ->
273348273348
transl_let rec_flag pat_expr_list (transl_exp body)
273349273349
| Texp_function { arg_label = _; param; cases; partial } ->
273350-
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async") in
273350+
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in
273351273351
let params, body, return_unit =
273352273352
let pl = push_defaults e.exp_loc [] cases partial in
273353273353
transl_function e.exp_loc partial param pl

0 commit comments

Comments
 (0)