@@ -1029,6 +1029,7 @@ left_gen_expression(lhs,rhs,rhs2) :: { Expr Span }
10291029--
10301030postfix_blockexpr (lhs) :: { Expr Span }
10311031 : lhs ' ?' { Try [] $1 ($1 # $>) }
1032+ | lhs ' .' await { Await [] $1 ($1 # $>) }
10321033 | lhs ' .' ident %prec FIELD { FieldAccess [] $1 (unspan $3 ) ($1 # $>) }
10331034 | lhs ' .' ident ' (' sep_byT(expr,' ,' ) ' )'
10341035 { MethodCall [] $1 (unspan $3 ) Nothing $5 ($1 # $>) }
@@ -1040,44 +1041,6 @@ postfix_blockexpr(lhs) :: { Expr Span }
10401041 _ -> parseError $3
10411042 }
10421043
1043- -- Postfix expressions that can come after an expression block, in a ' stmt'
1044- --
1045- -- * `{ 1 }[0 ]` isn' t here because it is treated as `{ 1 }; [0]`
1046- -- * `{ 1 }(0)` isn' t here because it is treated as `{ 1 }; (0 )`
1047- --
1048- postfix_blockexpr (lhs) :: { Expr Span }
1049- : lhs ' ?' { Try [] $1 ($1 # $>) }
1050- | lhs ' .' ident %prec FIELD { FieldAccess [] $1 (unspan $3 ) ($1 # $>) }
1051- | lhs ' .' ident ' (' sep_byT(expr,' ,' ) ' )'
1052- { MethodCall [] $1 (unspan $3 ) Nothing $5 ($1 # $>) }
1053- | lhs ' .' ident ' ::' ' <' sep_byT(ty,' ,' ) ' >' ' (' sep_byT(expr,' ,' ) ' )'
1054- { MethodCall [] $1 (unspan $3 ) (Just $6 ) $9 ($1 # $>) }
1055- | lhs ' .' int {%
1056- case lit $3 of
1057- Int Dec i Unsuffixed _ -> pure (TupField [] $1 (fromIntegral i) ($1 # $3 ))
1058- _ -> parseError $3
1059- }
1060-
1061- -- Postfix expressions that can come after an expression block, in a ' stmt'
1062- --
1063- -- * `{ 1 }[0 ]` isn' t here because it is treated as `{ 1 }; [0]`
1064- -- * `{ 1 }(0)` isn' t here because it is treated as `{ 1 }; (0 )`
1065- --
1066- postfix_blockexpr (lhs) :: { Expr Span }
1067- : lhs ' ?' { Try [] $1 ($1 # $>) }
1068- | lhs ' .' ident %prec FIELD { FieldAccess [] $1 (unspan $3 ) ($1 # $>) }
1069- | lhs ' .' ident ' (' sep_byT(expr,' ,' ) ' )'
1070- { MethodCall [] $1 (unspan $3 ) Nothing $5 ($1 # $>) }
1071- | lhs ' .' ident ' ::' ' <' sep_byT(ty,' ,' ) ' >' ' (' sep_byT(expr,' ,' ) ' )'
1072- { MethodCall [] $1 (unspan $3 ) (Just $6 ) $9 ($1 # $>) }
1073- | lhs ' .' int {%
1074- case lit $3 of
1075- Int Dec i Unsuffixed _ -> pure (TupField [] $1 (fromIntegral i) ($1 # $3 ))
1076- _ -> parseError $3
1077- }
1078-
1079-
1080-
10811044-- Then, we instantiate this general production into the following families of rules:
10821045--
10831046-- [' expr' ] Most general class of expressions, no restrictions
@@ -1899,6 +1862,7 @@ addAttrs as (Closure as' c a m f e s) = Closure (as ++ as') c a m f e s
18991862addAttrs as (BlockExpr as' b s) = BlockExpr (as ++ as' ) b s
19001863addAttrs as (TryBlock as' b s) = TryBlock (as ++ as' ) b s
19011864addAttrs as (Async as' c b s) = Async (as ++ as' ) c b s
1865+ addAttrs as (Await as' e s) = Await (as ++ as' ) e s
19021866addAttrs as (Assign as' e1 e2 s) = Assign (as ++ as' ) e1 e2 s
19031867addAttrs as (AssignOp as' b e1 e2 s) = AssignOp (as ++ as' ) b e1 e2 s
19041868addAttrs as (FieldAccess as' e i s) = FieldAccess (as ++ as' ) e i s
0 commit comments