From: Pierre-Emmanuel Patry Date: Wed, 28 Jun 2023 11:12:07 +0000 (+0200) Subject: gccrs: collector: Change match arm format X-Git-Tag: basepoints/gcc-15~2389 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af07e6032f651d406c04255be68be2f9d1af0811;p=thirdparty%2Fgcc.git gccrs: collector: Change match arm format Match arm were not readable with previous format options. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Change formatting. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc index 8fc0f3dcc8df..aad948e02d8e 100644 --- a/gcc/rust/ast/rust-ast-collector.cc +++ b/gcc/rust/ast/rust-ast-collector.cc @@ -1481,10 +1481,13 @@ TokenCollector::visit (MatchArm &arm) void TokenCollector::visit (MatchCase &match_case) { + indentation (); visit (match_case.get_arm ()); push (Rust::Token::make (MATCH_ARROW, Location ())); visit (match_case.get_expr ()); + indentation (); push (Rust::Token::make (COMMA, Location ())); + newline (); } void @@ -1493,11 +1496,15 @@ TokenCollector::visit (MatchExpr &expr) push (Rust::Token::make (MATCH_TOK, expr.get_locus ())); visit (expr.get_scrutinee_expr ()); push (Rust::Token::make (LEFT_CURLY, Location ())); + newline (); + increment_indentation (); visit_items_as_lines (expr.get_inner_attrs ()); for (auto &arm : expr.get_match_cases ()) { visit (arm); } + decrement_indentation (); + indentation (); push (Rust::Token::make (RIGHT_CURLY, Location ())); }