object

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INTEGER_OBJ = "INTEGER"
	BOOLEAN_OBJ = "BOOLEAN"
	NULL_OBJ    = "NULL"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Boolean

type Boolean struct {
	Value bool
}

func (*Boolean) Inspect

func (b *Boolean) Inspect() string

func (*Boolean) Type

func (b *Boolean) Type() ObjectType

type Integer

type Integer struct {
	Value int64
}

func (*Integer) Inspect

func (i *Integer) Inspect() string

func (*Integer) Type

func (i *Integer) Type() ObjectType

type Null

type Null struct{}

func (*Null) Inspect

func (n *Null) Inspect() string

func (*Null) Type

func (n *Null) Type() ObjectType

type Object

type Object interface {
	Type() ObjectType
	Inspect() string
}

type ObjectType

type ObjectType string

type Token

type Token struct {
	Type    Type
	Literal string
}

func NewToken

func NewToken(tokenType Type, ch byte) Token

func (Token) String

func (t Token) String() string

type Type

type Type int
const (
	UNKNOWN Type = iota
	INT
	FLOAT
	BOOLEAN
	STRING
	IDENT
	EOF
)

func LookupIdent

func LookupIdent(ident string) Type

func LookupTokenType

func LookupTokenType(literal string) Type

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL