diff options
Diffstat (limited to 'object/object.go')
| -rw-r--r-- | object/object.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/object/object.go b/object/object.go index 793ff6b..731be0b 100644 --- a/object/object.go +++ b/object/object.go @@ -15,6 +15,7 @@ const ( NULL_OBJ = "NULL" RETURN_VALUE_OBJ = "RETURN_VALUE" FUNCTION_OBJ = "FUNCTION" + STRING_OBJ = "STRING" ERROR_OBJ = "ERROR" ) @@ -47,6 +48,10 @@ type Function struct { Env *Environment } +type String struct { + Value string +} + func (i *Integer) Type() ObjectType { return INTEGER_OBJ } @@ -104,3 +109,6 @@ func (f *Function) Inspect() string { func (e *Error) Type() ObjectType { return ERROR_OBJ } func (e *Error) Inspect() string { return "ERROR:" + e.Message } + +func (s *String) Type() ObjectType { return STRING_OBJ } +func (s *String) Inspect() string { return s.Value } |
