about summary refs log tree commit diff
path: root/pkg/lang/compiler/symbol.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-07-12 00:29:56 +0200
committerMel <einebeere@gmail.com>2022-07-12 00:29:56 +0200
commite5ae4ea1288a555c4019dad43ee27e960eec46b9 (patch)
treeb0c92bae8bd7d58be9c5b42dc0b06081f4a1d780 /pkg/lang/compiler/symbol.go
parent74dd678dfd1aae9e655fd13cb65278ea9ba307e2 (diff)
downloadjinx-e5ae4ea1288a555c4019dad43ee27e960eec46b9.tar.zst
jinx-e5ae4ea1288a555c4019dad43ee27e960eec46b9.zip
Extract scopes and scope chain from compiler
Diffstat (limited to 'pkg/lang/compiler/symbol.go')
-rw-r--r--pkg/lang/compiler/symbol.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/pkg/lang/compiler/symbol.go b/pkg/lang/compiler/symbol.go
deleted file mode 100644
index 453cb2b..0000000
--- a/pkg/lang/compiler/symbol.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package compiler
-
-import "jinx/pkg/lang/vm/code"
-
-type SymbolKind int
-
-const (
-	SymbolKindVariable SymbolKind = iota
-	SymbolKindFunction
-)
-
-func (s SymbolKind) String() string {
-	switch s {
-	case SymbolKindVariable:
-		return "variable"
-	case SymbolKindFunction:
-		return "function"
-	default:
-		panic("unknown symbol kind")
-	}
-}
-
-type Symbol[D SymbolData] struct {
-	name string
-	data D
-}
-
-type SymbolData interface {
-	SymbolVariable | SymbolFunction
-}
-
-type SymbolVariable struct {
-	localIndex int
-}
-
-type SymbolFunction struct {
-	marker code.Marker
-	args   uint
-}