about summary refs log tree commit diff
path: root/pkg/lang/compiler/scope/scopes.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-07-26 03:54:06 +0200
committerMel <einebeere@gmail.com>2022-07-26 03:54:06 +0200
commit20bd5570465c73b89458de58c9fb8cd4e5919b44 (patch)
tree21bb690611853a1863a0364045c93ece53b8c280 /pkg/lang/compiler/scope/scopes.go
parent917e721ca612cdc5ba6b4b1ab3fc969d55b728b3 (diff)
downloadjinx-20bd5570465c73b89458de58c9fb8cd4e5919b44.tar.zst
jinx-20bd5570465c73b89458de58c9fb8cd4e5919b44.zip
Compile function environments
Diffstat (limited to 'pkg/lang/compiler/scope/scopes.go')
-rw-r--r--pkg/lang/compiler/scope/scopes.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/lang/compiler/scope/scopes.go b/pkg/lang/compiler/scope/scopes.go
index e34b45a..7a1b20c 100644
--- a/pkg/lang/compiler/scope/scopes.go
+++ b/pkg/lang/compiler/scope/scopes.go
@@ -26,6 +26,8 @@ type FunctionScope struct {
 	id           ScopeID
 	unit         code.Marker
 	subUnitCount int
+
+	outsideSymbolsInEnv []SymbolID
 }
 
 func NewFunctionScope(id ScopeID, unit code.Marker) FunctionScope {
@@ -33,6 +35,8 @@ func NewFunctionScope(id ScopeID, unit code.Marker) FunctionScope {
 		id:           id,
 		unit:         unit,
 		subUnitCount: 0,
+
+		outsideSymbolsInEnv: make([]SymbolID, 0),
 	}
 }
 
@@ -44,6 +48,10 @@ func (sf FunctionScope) Unit() code.Marker {
 	return sf.unit
 }
 
+func (sf FunctionScope) OutsideSymbolsInEnv() []SymbolID {
+	return sf.outsideSymbolsInEnv
+}
+
 func (sf FunctionScope) IsRootScope() bool {
 	return sf.ID() == ScopeID(0)
 }