diff options
| author | Mel <einebeere@gmail.com> | 2022-08-18 20:04:24 +0000 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-08-18 20:04:24 +0000 |
| commit | 18c6d49cc9982ad4362e82730812e1134478ea64 (patch) | |
| tree | 35c27cae8a6c32a45e4cb88fb761d4e626c7b9cd /pkg/lang/compiler/scope/scopes.go | |
| parent | 73ac132294f3e659f1d769c961aa45bafdd19b45 (diff) | |
| download | jinx-18c6d49cc9982ad4362e82730812e1134478ea64.tar.zst jinx-18c6d49cc9982ad4362e82730812e1134478ea64.zip | |
Allow shadowing through function scopes
Diffstat (limited to 'pkg/lang/compiler/scope/scopes.go')
| -rw-r--r-- | pkg/lang/compiler/scope/scopes.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/lang/compiler/scope/scopes.go b/pkg/lang/compiler/scope/scopes.go index e1a7a9f..f62ab56 100644 --- a/pkg/lang/compiler/scope/scopes.go +++ b/pkg/lang/compiler/scope/scopes.go @@ -13,12 +13,16 @@ const ( ) type SymbolScope struct { + nameToSymbol map[string]SymbolID + variableSymbols []Symbol[SymbolVariable] - globalSymbols []Symbol[SymbolGlobal] + globalSymbols []Symbol[SymbolGlobal] } func NewSymbolScope() SymbolScope { return SymbolScope{ + nameToSymbol: make(map[string]SymbolID), + variableSymbols: make([]Symbol[SymbolVariable], 0), globalSymbols: make([]Symbol[SymbolGlobal], 0), } |
