/// <summary>
 /// argument_list = "(" [ argument *( "," argument ) ] ")"
 /// argument      = expression
 /// </summary>
 /// <param name="openParen"></param>
 /// <param name="arguments"></param>
 /// <param name="closeParen"></param>
 public ArmArgumentListAst(OpenParenToken openParen, IList <ArmExpressionAst> arguments, CloseParenToken closeParen)
 {
     this.OpenParen    = openParen ?? throw new ArgumentNullException(nameof(openParen));
     this.ArgumentList = new ReadOnlyCollection <ArmExpressionAst>(
         arguments ?? throw new ArgumentNullException(nameof(arguments))
         );
     this.CloseParen = closeParen ?? throw new ArgumentNullException(nameof(closeParen));
 }
 public void TestNoParams_SpaceInParams_NoAtTrivia()
 => Verify(
     @"ConsoleApp4.MyClass.M(  )",
     methodDeclaration: MethodDeclaration(
         QualifiedName("ConsoleApp4.MyClass.M"),
         argumentList: ParameterList(
             OpenParenToken.With(trailingTrivia: ImmutableArray.Create(SpaceTrivia(2))),
             CloseParenToken))
     );
        public static ArmExpressionAst ParseArmExpressionAst(TokenStream stream)
        {
            var peek = stream.Peek();

            return(peek switch
            {
                OpenParenToken _ => ArmExpressionParser.ParseArmSubexpressionAst(stream),
                IdentifierToken _ => ArmExpressionParser.ParseDottedNotationExpressionAst(stream),
                StringLiteralToken _ => ArmExpressionParser.ParseArmStringLiteralExpressionAst(stream),
                IntegerToken _ => ArmExpressionParser.ParseArmNumericLiteralExpressionAst(stream),
                _ => throw new InvalidOperationException(),
            });
        public void TestMethodOneParamSpacing()
        => Verify(
            @"at ConsoleApp4.MyClass.M( string s )",
            methodDeclaration: MethodDeclaration(
                QualifiedName(
                    QualifiedName(
                        Identifier("ConsoleApp4", leadingTrivia: AtTrivia),
                        Identifier("MyClass")),
                    Identifier("M")),

                argumentList: ParameterList(
                    OpenParenToken.With(trailingTrivia: SpaceTrivia().ToImmutableArray()),
                    CloseParenToken,
                    Parameter(
                        Identifier("string"),
                        IdentifierToken("s", leadingTrivia: SpaceTrivia(), trailingTrivia: SpaceTrivia())))
                )
            );