private InterpolatedStringInsertSyntax ParseInterpolatedStringInsert() { ExpressionSyntax expr; var commaToken = default(SyntaxToken); ExpressionSyntax alignmentExpression = null; var colonToken = default(SyntaxToken); var formatToken = default(SyntaxToken); expr = this.ParseExpression(); if (this.CurrentToken.Kind == SyntaxKind.CommaToken) { commaToken = this.EatToken(SyntaxKind.CommaToken); // require the width to be a literal (one token) of the negative of a literal (two tokens) var minusToken = (this.CurrentToken.Kind == SyntaxKind.MinusToken) ? this.EatToken(SyntaxKind.MinusToken) : null; var widthToken = this.EatToken(SyntaxKind.NumericLiteralToken); var widthExpression = SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression, widthToken); alignmentExpression = (minusToken != null) ? (ExpressionSyntax)SyntaxFactory.PrefixUnaryExpression(SyntaxKind.UnaryMinusExpression, minusToken, widthExpression) : widthExpression; } if (this.CurrentToken.Kind == SyntaxKind.ColonToken) { colonToken = this.EatToken(SyntaxKind.ColonToken); formatToken = this.EatToken(this.CurrentToken.Kind == SyntaxKind.IdentifierToken ? SyntaxKind.IdentifierToken : SyntaxKind.StringLiteralToken); } return(SyntaxFactory.InterpolatedStringInsert( expr, // expression commaToken, // , alignmentExpression, // -5 colonToken, // : formatToken)); // N2 }