/// <summary> /// line_invoke_base_expr = get_expr [ invoke_line_args ] /// </summary> private NodeBase parseLineInvokeBaseExpr() { var expr = attempt(parseGetExpr); if (expr == null) return null; var args = parseInvokeLineArgs().ToList(); if (args.Count == 0) return expr; var node = new InvocationNode(); node.Expression = expr; node.Arguments = args; return node; }
/// <summary> /// invoke_pass = "******" identifier ( invoke_block_args | invoke_line_args ) /// </summary> private InvocationNode parseInvokePass() { if (!check(LexemType.PassRight)) return null; var getter = new GetMemberNode(); var invoker = new InvocationNode { Expression = getter }; getter.MemberName = ensure(LexemType.Identifier, ParserMessages.MemberNameExpected).Value; invoker.Arguments = parseInvokeBlockArgs().ToList(); if (invoker.Arguments.Count == 0) invoker.Arguments = parseInvokeLineArgs().ToList(); if (invoker.Arguments.Count == 0) error(ParserMessages.ArgumentsExpected); return invoker; }
protected bool Equals(InvocationNode other) { return(base.Equals(other) && Equals(Expression, other.Expression)); }
protected bool Equals(InvocationNode other) { return base.Equals(other) && Equals(Expression, other.Expression); }
/// <summary> /// invoke_pass = "******" identifier [ type_args ] ( invoke_block_args | invoke_line_args ) /// </summary> private InvocationNode parseInvokePass() { if (!check(LexemType.PassRight)) return null; var getter = new GetMemberNode(); var invoker = new InvocationNode { Expression = getter }; getter.MemberName = ensure(LexemType.Identifier, ParserMessages.MemberNameExpected).Value; var hints = attempt(parseTypeArgs); if(hints != null) getter.TypeHints = hints; var lambda = attempt(parseLambdaLineExpr); if (lambda != null) { invoker.Arguments = new List<NodeBase> { lambda }; } else { invoker.Arguments = parseInvokeBlockArgs().ToList(); if (invoker.Arguments.Count == 0) invoker.Arguments = parseInvokeLineArgs().ToList(); if (invoker.Arguments.Count == 0) error(ParserMessages.ArgumentsExpected); } return invoker; }