private Expression ToInvokeReverse(Pair <Expression, IEnumerable <Expression> > p) { var t = p.Value1; foreach (var exp in p.Value2) { t = new InvokeExpression() { TokenPosition = t.TokenPosition, Function = exp, Argument = t }; } return(t); }
private Expression ToOperator(Pair <Expression, IEnumerable <Pair <Lexer <TokenType> .Token, Expression> > > input) { Expression result = input.Value1; foreach (var op in input.Value2) { result = new InvokeExpression() { TokenPosition = op.Value1, Function = new InvokeExpression() { TokenPosition = op.Value1, Function = new IdentifierExpression() { TokenPosition = op.Value1, Name = "(" + op.Value1.Value + ")" }, Argument = result }, Argument = op.Value2 }; } return(result); }