diff options
Diffstat (limited to 'pkg/lang/compiler/scope/scope_chain.go')
| -rw-r--r-- | pkg/lang/compiler/scope/scope_chain.go | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/pkg/lang/compiler/scope/scope_chain.go b/pkg/lang/compiler/scope/scope_chain.go index d0108ee..f4b9f46 100644 --- a/pkg/lang/compiler/scope/scope_chain.go +++ b/pkg/lang/compiler/scope/scope_chain.go @@ -137,35 +137,6 @@ func (sc *ScopeChain) Declare(name string) (int, bool) { return indexInScope, true } -func (sc *ScopeChain) DeclareFunction(name string, args uint) (code.Marker, bool) { - if _, ok := sc.nameToSymbol[name]; ok { - return "", false - } - - current := sc.Current() - index := len(current.functionSymbols) - - symbolID := SymbolID{ - symbolKind: SymbolKindFunction, - scopeID: sc.CurrentScopeID(), - indexInScope: index, - } - - unitName := sc.CreateFunctionSubUnit(name) - - current.functionSymbols = append(current.functionSymbols, Symbol[SymbolFunction]{ - name: name, - data: SymbolFunction{ - marker: unitName, - args: args, - }, - }) - - sc.nameToSymbol[name] = symbolID - - return unitName, true -} - func (sc *ScopeChain) DeclareAnonymous() int { current := sc.Current() index := len(current.variableSymbols) @@ -221,11 +192,3 @@ func (sc *ScopeChain) GetVariable(id SymbolID) Symbol[SymbolVariable] { return sc.symbolScopes[id.scopeID].variableSymbols[id.indexInScope] } - -func (sc *ScopeChain) GetFunction(id SymbolID) Symbol[SymbolFunction] { - if id.symbolKind != SymbolKindFunction { - panic("incorrect symbol id kind given") - } - - return sc.symbolScopes[id.scopeID].functionSymbols[id.indexInScope] -} |
