Example #1
0
 internal FunctionScopeImpl(CodeWorkspaceImpl ws, INamedScope parent, FunctionDefinition def)
     : this(ws, parent)
 {
     _fDef = def;
     SetName(_fDef.Key);
 }
Example #2
0
 public IFunctionScope CreateFunction(FunctionDefinition def) => _funcs.Create(Workspace, this, def);
Example #3
0
 public IFunctionScope CreateFunction(FunctionDefinition def) => PartOwner.CreateFunction(def);
Example #4
0
        public FunctionScopeImpl Create(CodeWorkspaceImpl ws, IFunctionDefinerScope h, FunctionDefinition def)
        {
            if (def == null)
            {
                throw new ArgumentNullException(nameof(def));
            }
            if (_funcs.ContainsKey(def.Key))
            {
                throw new ArgumentException($"Funcion or constructor with key {def.Key} already exists.", nameof(def));
            }
            FunctionScopeImpl f = new FunctionScopeImpl(ws, h, def);

            _funcs.Add(f.Name, f);
            return(f);
        }