aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse.h
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2023-05-09 12:53:33 +0100
committerCohenArthur <arthur.cohen@embecosm.com>2023-05-15 14:48:41 +0000
commit4cd88c4cd60bce7a2fd14191334a56ab08ea5181 (patch)
tree059e2a37d4ab5b4c5728a952c5da12149a2c7a2a /gcc/rust/parse/rust-parse.h
parent142b84e3c56252004348f57c0822dca39d437395 (diff)
downloadgcc-4cd88c4cd60bce7a2fd14191334a56ab08ea5181.zip
gcc-4cd88c4cd60bce7a2fd14191334a56ab08ea5181.tar.gz
gcc-4cd88c4cd60bce7a2fd14191334a56ab08ea5181.tar.bz2
ast: Remove ExprStmtWithBlock / ExprStmtWithoutBlock distinction
This distinction isn't very helpful and makes correct parsing harder. gcc/rust/ChangeLog: * ast/rust-ast-full-decls.h (class ExprStmtWithoutBlock): Remove. (class ExprStmtWithBlock): Remove. * ast/rust-stmt.h (class ExprStmtWithoutBlock): Remove. (class ExprStmtWithBlock): Remove. (class ExprStmt): Make non-abstract, add common functionality from removed base classes. * ast/rust-ast.h: Move to_stmt to base class. * ast/rust-ast.cc (ExprStmtWithBlock::as_string): Remove. * ast/rust-macro.h: Use new signature for to_stmt. (ExprStmt::as_string): New method. (ExprStmtWithoutBlock::as_string): Remove. (BlockExpr::strip_tail_expr): Update for removed classes. (ExprStmtWithoutBlock::accept_vis): Remove. (ExprStmtWithBlock::accept_vis): Remove. (ExprStmt::accept_vis): New method. * ast/rust-ast-dump.cc (Dump::visit): Update for removed classes. * ast/rust-ast-dump.h: Likewise. * ast/rust-ast-collector.h: Likewise. * ast/rust-ast-collector.cc (TokenStream::visit): Likewise. * ast/rust-ast-visitor.h: Likewise. * checks/errors/rust-feature-gate.h: Likewise. * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise. * expand/rust-expand-visitor.h: Likewise. * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise. * expand/rust-cfg-strip.h: Likewise. * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise. * hir/rust-ast-lower-base.h: Likewise. * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Likewise. * hir/rust-ast-lower-stmt.h: Likewise. * util/rust-attributes.cc (AttributeChecker::visit): Likewise. * util/rust-attributes.h: Likewise. * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise. * resolve/rust-ast-resolve-base.h: Likewise. * resolve/rust-ast-resolve-stmt.h: Likewise. * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise. * resolve/rust-early-name-resolver.h: Likewise. * parse/rust-parse-impl.h (Parser::parse_match_expr): Likewise. (Parser::parse_stmt_or_expr_without_block): Likewise. * parse/rust-parse.h: Likewise. Signed-off-by: Matthew Jasper <mjjasper1@gmail.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse.h')
-rw-r--r--gcc/rust/parse/rust-parse.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h
index 71f0ff1..a092290 100644
--- a/gcc/rust/parse/rust-parse.h
+++ b/gcc/rust/parse/rust-parse.h
@@ -637,9 +637,9 @@ private:
std::unique_ptr<AST::ExprStmt> parse_expr_stmt (AST::AttrVec outer_attrs,
ParseRestrictions restrictions
= ParseRestrictions ());
- std::unique_ptr<AST::ExprStmtWithBlock>
+ std::unique_ptr<AST::ExprStmt>
parse_expr_stmt_with_block (AST::AttrVec outer_attrs);
- std::unique_ptr<AST::ExprStmtWithoutBlock>
+ std::unique_ptr<AST::ExprStmt>
parse_expr_stmt_without_block (AST::AttrVec outer_attrs,
ParseRestrictions restrictions
= ParseRestrictions ());