Parse inline const expressions

This commit is contained in:
Santiago Pastorino 2020-09-21 17:55:58 -03:00
parent 3c4ad55082
commit c3e8d7965c
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
10 changed files with 60 additions and 3 deletions

View file

@ -1152,6 +1152,7 @@ impl Expr {
match self.kind {
ExprKind::Box(_) => ExprPrecedence::Box,
ExprKind::Array(_) => ExprPrecedence::Array,
ExprKind::ConstBlock(_) => ExprPrecedence::ConstBlock,
ExprKind::Call(..) => ExprPrecedence::Call,
ExprKind::MethodCall(..) => ExprPrecedence::MethodCall,
ExprKind::Tup(_) => ExprPrecedence::Tup,
@ -1207,6 +1208,8 @@ pub enum ExprKind {
Box(P<Expr>),
/// An array (`[a, b, c, d]`)
Array(Vec<P<Expr>>),
/// Allow anonymous constants from an inline `const` block
ConstBlock(AnonConst),
/// A function call
///
/// The first field resolves to the function itself,