]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: dump: Fix spacing with dots and references
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 28 Jun 2023 09:13:15 +0000 (11:13 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:49:32 +0000 (18:49 +0100)
A space was output around dots as well as after references, this made
things kinda horrible to look at and clearly not usual.

gcc/rust/ChangeLog:

* ast/rust-ast-dump.cc (Dump::require_spacing): Add a rule to
remove spaces around dots and after references.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast-dump.cc

index ba8b0badfafd67745f91348bc873c10768f82099..a1e153ac89419a34d3e6b8bd49e5c988a294ee00 100644 (file)
@@ -46,6 +46,7 @@ Dump::require_spacing (TokenPtr previous, TokenPtr current)
     case DOLLAR_SIGN:
     case SEMICOLON:
     case COMMA:
+    case DOT:
       return false;
     default:
       break;
@@ -56,6 +57,8 @@ Dump::require_spacing (TokenPtr previous, TokenPtr current)
     case SCOPE_RESOLUTION:
     case LEFT_SQUARE:
     case LEFT_PAREN:
+    case AMP:
+    case DOT:
       return false;
     default:
       return true;