lang

package
v0.0.0-...-f2efcc2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var False = &TypeBool{BaseType{Typename: "bool", Value: false, Constant: true}}
View Source
var Null = &NullType{BaseType: BaseType{Typename: "null", Value: nil, Constant: true}}
View Source
var True = &TypeBool{BaseType{Typename: "bool", Value: true, Constant: true}}

Functions

func BuildStack

func BuildStack(token *lexer.Token, filename string) string

Types

type BaseError

type BaseError struct {
	Type    string
	Message string
	Stack   string
	IsFatal bool
}

func Errorf

func Errorf(errtype, message, Stack string, isFatal bool) *BaseError

func (*BaseError) Error

func (baseError *BaseError) Error() string

func (*BaseError) GetMessage

func (baseError *BaseError) GetMessage() string

func (*BaseError) GetType

func (baseError *BaseError) GetType() string

func (*BaseError) Run

func (baseError *BaseError) Run()

type BaseType

type BaseType struct {
	Typename string
	Value    interface{}
	Constant bool // is the value is constant
}

func (*BaseType) IsConstant

func (typ *BaseType) IsConstant() bool

func (*BaseType) Name

func (typ *BaseType) Name() string

func (*BaseType) Reassign

func (typ *BaseType) Reassign(newval interface{}) error

func (*BaseType) SetConstant

func (typ *BaseType) SetConstant(to bool)

func (*BaseType) Val

func (typ *BaseType) Val() interface{}

type CustomType

type CustomType struct {
	BaseType
}

func LoadCustomType

func LoadCustomType(qualname string, value interface{}) *CustomType

type Method

type Method struct {
	// contains filtered or unexported fields
}

func NewMethod

func NewMethod(qualname string, gomethod func(args []Type, opts *Options) Type, doc string) *Method

func (*Method) GetDoc

func (method *Method) GetDoc() string

func (*Method) GetName

func (method *Method) GetName() string

func (*Method) RunMethod

func (method *Method) RunMethod(args []Type, opts *Options) Type

type NullType

type NullType struct {
	BaseType
}

type Options

type Options struct {
	Stdout *os.File
	Stdin  *os.File
}

type Type

type Type interface {
	Val() interface{}
	Reassign(newval interface{}) error
	Name() string
	IsConstant() bool
	SetConstant(bool)
}

type TypeBool

type TypeBool struct {
	BaseType
}

type TypeFloat

type TypeFloat struct {
	BaseType
}

func Float

func Float(s float64) *TypeFloat

type TypeInt

type TypeInt struct {
	BaseType
}

func Int

func Int(s int64) *TypeInt

type TypeString

type TypeString struct {
	BaseType
}

func String

func String(s string) *TypeString

func (*TypeString) Len

func (str *TypeString) Len() int

Jump to

Keyboard shortcuts

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