@@ -1029,6 +1029,7 @@ left_gen_expression(lhs,rhs,rhs2) :: { Expr Span }
1029
1029
--
1030
1030
postfix_blockexpr (lhs) :: { Expr Span }
1031
1031
: lhs ' ?' { Try [] $1 ($1 # $>) }
1032
+ | lhs ' .' await { Await [] $1 ($1 # $>) }
1032
1033
| lhs ' .' ident %prec FIELD { FieldAccess [] $1 (unspan $3 ) ($1 # $>) }
1033
1034
| lhs ' .' ident ' (' sep_byT(expr,' ,' ) ' )'
1034
1035
{ MethodCall [] $1 (unspan $3 ) Nothing $5 ($1 # $>) }
@@ -1040,44 +1041,6 @@ postfix_blockexpr(lhs) :: { Expr Span }
1040
1041
_ -> parseError $3
1041
1042
}
1042
1043
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
-
1081
1044
-- Then, we instantiate this general production into the following families of rules:
1082
1045
--
1083
1046
-- [' 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
1899
1862
addAttrs as (BlockExpr as' b s) = BlockExpr (as ++ as' ) b s
1900
1863
addAttrs as (TryBlock as' b s) = TryBlock (as ++ as' ) b s
1901
1864
addAttrs as (Async as' c b s) = Async (as ++ as' ) c b s
1865
+ addAttrs as (Await as' e s) = Await (as ++ as' ) e s
1902
1866
addAttrs as (Assign as' e1 e2 s) = Assign (as ++ as' ) e1 e2 s
1903
1867
addAttrs as (AssignOp as' b e1 e2 s) = AssignOp (as ++ as' ) b e1 e2 s
1904
1868
addAttrs as (FieldAccess as' e i s) = FieldAccess (as ++ as' ) e i s
0 commit comments