public override IEnumerable <NodeBase> Expand(Context ctx, NodeBase expression, Label nextStatement) { foreach (var rule in KeyRule.Expand(ctx, Expr.GetMember(expression, "Key"), nextStatement)) { yield return(rule); } foreach (var rule in ValueRule.Expand(ctx, Expr.GetMember(expression, "Value"), nextStatement)) { yield return(rule); } }
public override IEnumerable <NodeBase> Expand(Context ctx, NodeBase expression, Label nextStatement) { // no need for temporary variable: field access is idempotent yield return(MakeJumpIf( nextStatement, Expr.Not( Expr.Is(expression, _type) ) )); var rules = LabelRule.Expand( ctx, Expr.GetMember( Expr.Cast(expression, _type), "Tag" ), nextStatement ); foreach (var rule in rules) { yield return(rule); } }