IronPython.Compiler.Parser.FinishArgListOrGenExpr C# (CSharp) Метод

FinishArgListOrGenExpr() приватный Метод

private FinishArgListOrGenExpr ( ) : IronPython.Compiler.Ast.Arg[]
Результат IronPython.Compiler.Ast.Arg[]
        private Arg[] FinishArgListOrGenExpr() {
            Arg a = null;
            
            if (_sink != null) {
                _sink.StartParameters(GetSourceSpan());
            }

            Token t = PeekToken();
            if (t.Kind != TokenKind.RightParenthesis && t.Kind != TokenKind.Multiply && t.Kind != TokenKind.Power) {
                var start = GetStart();
                Expression e = ParseExpression();
                if (e is ErrorExpression) {
                    return null;
                }

                if (MaybeEat(TokenKind.Assign)) {               //  Keyword argument
                    a = FinishKeywordArgument(e);

                    if (a == null) {                            // Error recovery
                        a = new Arg(e);
                        a.SetLoc(_globalParent, e.StartIndex, GetEnd());
                    }
                } else if (PeekToken(Tokens.KeywordForToken)) {    //  Generator expression
                    a = new Arg(ParseGeneratorExpression(e));
                    Eat(TokenKind.RightParenthesis);
                    a.SetLoc(_globalParent, start, GetEnd());
                    if (_sink != null) {
                        _sink.EndParameters(GetSourceSpan());
                    }
                    return new Arg[1] { a };       //  Generator expression is the argument
                } else {
                    a = new Arg(e);
                    a.SetLoc(_globalParent, e.StartIndex, e.EndIndex);
                }

                //  Was this all?
                //
                if (MaybeEat(TokenKind.Comma)) {
                    if (_sink != null) {
                        _sink.NextParameter(GetSourceSpan());
                    }
                } else {
                    Eat(TokenKind.RightParenthesis);
                    a.SetLoc(_globalParent, start, GetEnd());
                    if (_sink != null) {
                        _sink.EndParameters(GetSourceSpan());
                    }
                    return new Arg[1] { a };
                }
            }

            return FinishArgumentList(a);
        }
Parser