_Core/Lang/AST/Statements/FunctionStmt.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ComLib.Lang.Docs;


namespace ComLib.Lang
{
    /// <summary>
    /// Represents a function call statement
    /// </summary>
    public class FunctionStmt : BlockStmt
    {
        private bool _continueRunning;
        private object _result = null;
        private bool _hasReturnValue;
        private FunctionMetaData _meta;


        /// <summary>
        /// Create new instance.
        /// </summary>
        public FunctionStmt() 
        {
            Init(null, null);
        }


        /// <summary>
        /// Create new instance with function name and argument names.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="argumentNames"></param>
        public FunctionStmt(string name, List<string> argumentNames)
        {
            Init(name, argumentNames);
        }


        /// <summary>
        /// Initialize
        /// </summary>
        /// <param name="name">name of function</param>
        /// <param name="argNames">names of the arguments.</param>
        public void Init(string name, List<string> argNames)
        {
            _meta = new FunctionMetaData(name, argNames);
            _meta.Doc = new DocTags();
            _meta.Version = new Version(1, 0, 0, 0);
            ExecutionCount = 0;
        }


        /// <summary>
        /// Name of the function.
        /// </summary>
        public string Name { get { return _meta.Name; } }

后面还有 118 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。