This repository was archived by the owner on Oct 3, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package object
22
3- import "github.com/looplanguage/loop/models/ast"
3+ import (
4+ "fmt"
5+ "github.com/looplanguage/loop/models/ast"
6+ )
47
58type Function struct {
69 Parameters []* ast.Identifier
@@ -10,3 +13,10 @@ type Function struct {
1013
1114func (f * Function ) Type () string { return FUNCTION }
1215func (f * Function ) Inspect () string { return "function" }
16+
17+ type CompiledFunction struct {
18+ Instructions []byte
19+ }
20+
21+ func (cf * CompiledFunction ) Type () string { return COMPILED_FUNCTION }
22+ func (cf * CompiledFunction ) Inspect () string { return fmt .Sprintf ("CompiledFunction[%p]" , cf ) }
Original file line number Diff line number Diff line change @@ -3,18 +3,19 @@ package object
33import "fmt"
44
55const (
6- INTEGER = "INTEGER"
7- ERROR = "ERROR"
8- FUNCTION = "FUNCTION"
9- BOOLEAN = "BOOLEAN"
10- ARRAY = "ARRAY"
11- RETURN = "RETURN"
12- BUILTIN = "BUILTIN"
13- STRING = "STRING"
14- NONE = "NONE"
15- HASHMAP = "HASHMAP"
16- EXPORT = "EXPORT"
17- IMPORT = "IMPORT"
6+ INTEGER = "INTEGER"
7+ ERROR = "ERROR"
8+ FUNCTION = "FUNCTION"
9+ BOOLEAN = "BOOLEAN"
10+ ARRAY = "ARRAY"
11+ RETURN = "RETURN"
12+ BUILTIN = "BUILTIN"
13+ STRING = "STRING"
14+ NONE = "NONE"
15+ HASHMAP = "HASHMAP"
16+ EXPORT = "EXPORT"
17+ IMPORT = "IMPORT"
18+ COMPILED_FUNCTION = "COMPILED_FUNCTION"
1819)
1920
2021type Object interface {
You can’t perform that action at this time.
0 commit comments