Skip to content

Commit 6101661

Browse files
committed
Begin preparing for source syntax.
See rescript-lang/syntax#600
1 parent b90ac95 commit 6101661

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
@@ -254564,10 +254564,10 @@ let is_inline : attr -> bool =
254564254564
let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline
254565254565

254566254566
let is_await : attr -> bool =
254567-
fun ({ txt }, _) -> txt = "await"
254567+
fun ({ txt }, _) -> txt = "await" || txt = "res.await"
254568254568

254569254569
let is_async : attr -> bool =
254570-
fun ({ txt }, _) -> txt = "async"
254570+
fun ({ txt }, _) -> txt = "async" || txt = "res.async"
254571254571

254572254572
let has_await_payload (attrs : t) = Ext_list.find_first attrs is_await
254573254573
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 =
270226270226
| Texp_let (rec_flag, pat_expr_list, body) ->
270227270227
transl_let rec_flag pat_expr_list (transl_exp body)
270228270228
| Texp_function { arg_label = _; param; cases; partial } ->
270229-
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async") in
270229+
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in
270230270230
let params, body, return_unit =
270231270231
let pl = push_defaults e.exp_loc [] cases partial in
270232270232
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
@@ -256027,10 +256027,10 @@ let is_inline : attr -> bool =
256027256027
let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline
256028256028

256029256029
let is_await : attr -> bool =
256030-
fun ({ txt }, _) -> txt = "await"
256030+
fun ({ txt }, _) -> txt = "await" || txt = "res.await"
256031256031

256032256032
let is_async : attr -> bool =
256033-
fun ({ txt }, _) -> txt = "async"
256033+
fun ({ txt }, _) -> txt = "async" || txt = "res.async"
256034256034

256035256035
let has_await_payload (attrs : t) = Ext_list.find_first attrs is_await
256036256036
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 =
290837290837
| Texp_let (rec_flag, pat_expr_list, body) ->
290838290838
transl_let rec_flag pat_expr_list (transl_exp body)
290839290839
| Texp_function { arg_label = _; param; cases; partial } ->
290840-
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async") in
290840+
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in
290841290841
let params, body, return_unit =
290842290842
let pl = push_defaults e.exp_loc [] cases partial in
290843290843
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
@@ -258615,10 +258615,10 @@ let is_inline : attr -> bool =
258615258615
let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline
258616258616

258617258617
let is_await : attr -> bool =
258618-
fun ({ txt }, _) -> txt = "await"
258618+
fun ({ txt }, _) -> txt = "await" || txt = "res.await"
258619258619

258620258620
let is_async : attr -> bool =
258621-
fun ({ txt }, _) -> txt = "async"
258621+
fun ({ txt }, _) -> txt = "async" || txt = "res.async"
258622258622

258623258623
let has_await_payload (attrs : t) = Ext_list.find_first attrs is_await
258624258624
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 =
273355273355
| Texp_let (rec_flag, pat_expr_list, body) ->
273356273356
transl_let rec_flag pat_expr_list (transl_exp body)
273357273357
| Texp_function { arg_label = _; param; cases; partial } ->
273358-
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async") in
273358+
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in
273359273359
let params, body, return_unit =
273360273360
let pl = push_defaults e.exp_loc [] cases partial in
273361273361
transl_function e.exp_loc partial param pl

0 commit comments

Comments
 (0)