コード例 #1
0
        }         // func CompileLambdaAsync

        /// <summary></summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="xSource"></param>
        /// <param name="throwException"></param>
        /// <param name="argumentNames"></param>
        /// <returns></returns>
        public Task <T> CompileLambdaAsync <T>(XElement xSource, bool throwException, params string[] argumentNames)
            where T : class
        {
            var code = xSource.Value;
            var pos  = PpsXmlPosition.GetXmlPositionFromAttributes(xSource);

            return(CompileLambdaAsync <T>(code, pos.LineInfo ?? "dummy.lua", throwException, argumentNames));
        }         // func CompileAsync
コード例 #2
0
        }         // func CompileAsync

        /// <summary>Compiles a chunk in the background.</summary>
        /// <param name="xSource">Source element of the chunk. The Value is the source code, and the positions encoded in the tag (see GetXmlPositionFromAttributes).</param>
        /// <param name="throwException">If the compile fails, should be raised a exception.</param>
        /// <param name="arguments">Argument definition for the chunk.</param>
        /// <returns>Compiled chunk</returns>
        public Task <LuaChunk> CompileAsync(XElement xSource, bool throwException, params KeyValuePair <string, Type>[] arguments)
        {
            if (xSource == null)
            {
                throw new ArgumentNullException(nameof(xSource));
            }

            var code = xSource.Value;
            var pos  = PpsXmlPosition.GetXmlPositionFromAttributes(xSource);

            return(CompileAsync(code, pos.LineInfo ?? "dummy.lua", throwException, arguments));
        }         // func CompileAsync