Skip to content

Commit

Permalink
add Quote Object (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Oct 9, 2024
1 parent 747c388 commit d91c672
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions object/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
NULL_OBJ = "NULL"
FUNCTION_OBJ = "FUNCTION"
BUILTIN_OBJ = "BUILTIN"
QUOTE_OBJ = "QUOTE"
)

type ObjectType string
Expand Down Expand Up @@ -110,3 +111,10 @@ type Builtin struct {

func (b *Builtin) Type() ObjectType { return BUILTIN_OBJ }
func (b *Builtin) Inspect() string { return "builtin function" }

type Quote struct {
Expression ast.Expression
}

func (q *Quote) Type() ObjectType { return QUOTE_OBJ }
func (q *Quote) Inspect() string { return q.Expression.String() }

0 comments on commit d91c672

Please sign in to comment.