diff options
| author | Taylor Cramer <cramertj@google.com> | 2019-04-18 12:55:23 -0700 |
|---|---|---|
| committer | Taylor Cramer <cramertj@google.com> | 2019-05-07 14:45:53 -0700 |
| commit | fe8760cb848d45f5c83b41e689878b893b74e45d (patch) | |
| tree | 8042688119098da68322461411aa8c44cfdcb3d4 /src/libsyntax/util/parser.rs | |
| parent | c3b8ab5199af4a3c11d14b0cbdb17a641e8eee71 (diff) | |
| download | rust-fe8760cb848d45f5c83b41e689878b893b74e45d.tar.gz rust-fe8760cb848d45f5c83b41e689878b893b74e45d.zip | |
Implement built-in await syntax
Adds support for .await under the existing async_await feature gate. Moves macro-like await! syntax to the await_macro feature gate. Removes support for `await` as a non-keyword under the `async_await` feature.
Diffstat (limited to 'src/libsyntax/util/parser.rs')
| -rw-r--r-- | src/libsyntax/util/parser.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsyntax/util/parser.rs b/src/libsyntax/util/parser.rs index 5f15ede7b0b..80dabffaba9 100644 --- a/src/libsyntax/util/parser.rs +++ b/src/libsyntax/util/parser.rs @@ -267,6 +267,7 @@ pub enum ExprPrecedence { TryBlock, Struct, Async, + Await, Err, } @@ -301,6 +302,7 @@ impl ExprPrecedence { ExprPrecedence::Unary => PREC_PREFIX, // Unary, postfix + ExprPrecedence::Await | ExprPrecedence::Call | ExprPrecedence::MethodCall | ExprPrecedence::Field | @@ -346,6 +348,7 @@ pub fn contains_exterior_struct_lit(value: &ast::Expr) -> bool { // X { y: 1 } + X { y: 2 } contains_exterior_struct_lit(&lhs) || contains_exterior_struct_lit(&rhs) } + ast::ExprKind::Await(_, ref x) | ast::ExprKind::Unary(_, ref x) | ast::ExprKind::Cast(ref x, _) | ast::ExprKind::Type(ref x, _) | |
