File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -612,6 +612,9 @@ final class AlignAttribute : BaseNode
612612 }
613613 mixin OpEquals;
614614 /* * */ ExpressionNode assignExpression;
615+ /* * */ bool isExplicitDefault() inout @property @safe nothrow @nogc pure {
616+ return tokens.length > 2 && tokens[2 ] == tok! " default" ;
617+ }
615618}
616619
617620// /
Original file line number Diff line number Diff line change @@ -206,7 +206,9 @@ class Formatter(Sink)
206206 **/
207207
208208 put(" align" );
209- if (alignAttribute.assignExpression ! is null )
209+ if (alignAttribute.isExplicitDefault)
210+ put(" (default)" );
211+ else if (alignAttribute.assignExpression ! is null )
210212 {
211213 put(" (" );
212214 format(alignAttribute.assignExpression);
@@ -4407,4 +4409,5 @@ z /// Documentation for z
44074409 testFormatNode! (VariableDeclaration)(" auto x = i` $(b) is $(b)!`;" );
44084410 testFormatNode! (VariableDeclaration)(" auto x = iq{ $(b) is $(b)!};" );
44094411 testFormatNode! (VariableDeclaration)(" auto x = iq{{$('$')}};" );
4412+ testFormatNode! (AlignAttribute)(` align(default) struct S {}` , ` align(default)` );
44104413}
You can’t perform that action at this time.
0 commit comments