コード例 #1
0
ファイル: Linq.cs プロジェクト: jiahao42/weverca
        internal override PhpTypeCode Emit(CodeGenerator /*!*/ codeGenerator)
        {
            ILEmitter   il      = codeGenerator.IL;
            LinqBuilder builder = new LinqBuilder(codeGenerator);

            builder.DefineContextType();
            builder.EmitNewLinqContext();

            codeGenerator.LinqBuilder = builder;

            LinqOpChain chain    = body.BuildChain();
            var         typecode = chain.Emit(codeGenerator);

            // the result is IEnumerable<object>, let's wrap it and pass out
            il.Emit(OpCodes.Call, Methods.ClrObject_WrapRealObject);

            builder.BakeContextType();

            return(PhpTypeCode.Object);
        }