@@ -3,6 +3,7 @@ import { doc } from 'prettier';
33import { isLabel } from '../slang-utils/is-label.js' ;
44import { printGroupAndIndentIfBreakPair } from '../slang-printers/print-group-and-indent-if-break-pair.js' ;
55import { printVariant } from '../slang-printers/print-variant.js' ;
6+ import { extractVariant } from '../slang-utils/extract-variant.js' ;
67import { SlangNode } from './SlangNode.js' ;
78import { Expression } from './Expression.js' ;
89import { ArgumentsDeclaration } from './ArgumentsDeclaration.js' ;
@@ -19,7 +20,7 @@ export class FunctionCallExpression extends SlangNode {
1920
2021 operand : Expression ;
2122
22- arguments : ArgumentsDeclaration ;
23+ arguments : ArgumentsDeclaration [ 'variant' ] ;
2324
2425 constructor (
2526 ast : ast . FunctionCallExpression ,
@@ -28,14 +29,16 @@ export class FunctionCallExpression extends SlangNode {
2829 super ( ast ) ;
2930
3031 this . operand = new Expression ( ast . operand , options ) ;
31- this . arguments = new ArgumentsDeclaration ( ast . arguments , options ) ;
32+ this . arguments = extractVariant (
33+ new ArgumentsDeclaration ( ast . arguments , options )
34+ ) ;
3235
3336 this . updateMetadata ( this . operand , this . arguments ) ;
3437 }
3538
3639 print ( path : AstPath < FunctionCallExpression > , print : PrintFunction ) : Doc {
3740 const operand = path . call ( printVariant ( print ) , 'operand' ) ;
38- const argumentsDoc = path . call ( printVariant ( print ) , 'arguments' ) ;
41+ const argumentsDoc = path . call ( print , 'arguments' ) ;
3942
4043 // If we are at the end of a MemberAccessChain we should indent the
4144 // arguments accordingly.
0 commit comments