@@ -43,8 +43,8 @@ export class IndexAccessExpression implements SlangNode {
4343 }
4444
4545 print ( path : AstPath < IndexAccessExpression > , print : PrintFunction ) : Doc {
46- let operandDoc : Doc = path . call ( print , 'operand' ) ;
47- let indexDoc : Doc = group ( [
46+ const operandDoc : Doc = path . call ( print , 'operand' ) ;
47+ const indexDoc : Doc = group ( [
4848 '[' ,
4949 indent ( [ softline , path . call ( print , 'start' ) , path . call ( print , 'end' ) ] ) ,
5050 softline ,
@@ -55,12 +55,12 @@ export class IndexAccessExpression implements SlangNode {
5555 // arguments accordingly.
5656 if ( isLabel ( operandDoc ) && operandDoc . label === 'MemberAccessChain' ) {
5757 const groupId = Symbol ( 'Slang.IndexAccessExpression.operand' ) ;
58- operandDoc = group ( operandDoc . contents , { id : groupId } ) ;
59-
60- indexDoc = indentIfBreak ( indexDoc , { groupId } ) ;
6158 // We wrap the expression in a label in case there is an IndexAccess or
6259 // a FunctionCall following this IndexAccess.
63- return label ( 'MemberAccessChain' , [ operandDoc , indexDoc ] ) ;
60+ return label ( 'MemberAccessChain' , [
61+ group ( operandDoc . contents , { id : groupId } ) ,
62+ indentIfBreak ( indexDoc , { groupId } )
63+ ] ) ;
6464 }
6565
6666 return [ operandDoc , indexDoc ] . flat ( ) ;
0 commit comments