XSpect.Yacq.Expressions.QuotedExpression.Unquote C# (CSharp) Method

Unquote() private static method

private static Unquote ( Expression expression, SymbolTable symbols, Int32 level ) : Expression
expression System.Linq.Expressions.Expression
symbols XSpect.Yacq.Symbols.SymbolTable
level System.Int32
return System.Linq.Expressions.Expression
        private static Expression Unquote(Expression expression, SymbolTable symbols, Int32 level)
        {
            return expression.List("unquote") != null
                ? EnumerableEx.Generate(
                      (ListExpression) expression,
                      _ => _ != null && _[0].Id() == "unquote",
                      _ => _[1] as ListExpression,
                      _ => _[1]
                  )
                      .ToArray()
                      .Let(es => Enumerable.Range(0, level - es.Length)
                          .Aggregate(es.Last(), (e, i) => Quote(symbols, e))
                          .If(e => !(e as IdentifierExpression).Null(_ => _.Type(symbols) == typeof(IdentifierExpression)),
                              e => e.Reduce(symbols).If(_ => !typeof(Expression).IsAppropriate(_.Type),
                                  _ => Function(symbols, "const", _)
                              )
                          )
                      )
                : ProcessQuasiquote(expression, symbols, level);
        }
    }