public ReduceOnce ( |
||
symbols | The additional symbol table for reducing. | |
expectedType | The type which is expected as the type of reduced expression. | |
return |
public Expression ReduceOnce(SymbolTable symbols = null, Type expectedType = null)
{
symbols = this.CreateSymbolTable(symbols);
var hash = symbols.AllHash
^ (expectedType != null ? expectedType.GetHashCode() : 0);
return this._reducedExpressions.GetValue(hash)
?? (this.ReduceImpl(symbols, expectedType) ?? this)
.If(e => e != this && !(e is YacqExpression), e =>
ImplicitConvert(e, expectedType)
)
.If(e => e != this, e =>
this._reducedExpressions[hash] = e
);
}