internal FunctionScopeImpl(CodeWorkspaceImpl ws, INamedScope parent, FunctionDefinition def) : this(ws, parent) { _fDef = def; SetName(_fDef.Key); }
public IFunctionScope CreateFunction(FunctionDefinition def) => _funcs.Create(Workspace, this, def);
public IFunctionScope CreateFunction(FunctionDefinition def) => PartOwner.CreateFunction(def);
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); }