From 18c6d49cc9982ad4362e82730812e1134478ea64 Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 18 Aug 2022 20:04:24 +0000 Subject: Allow shadowing through function scopes --- pkg/lang/compiler/scope/scopes.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/lang/compiler/scope/scopes.go') 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), } -- cgit 1.4.1