ast

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type And

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

func (And) Compile

func (a And) Compile(c *compiler.Compiler) (position int, err error)

func (And) Eval

func (a And) Eval(env *obj.Env) obj.Object

func (And) String

func (a And) String() string

type Assign

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

func (Assign) Compile

func (a Assign) Compile(c *compiler.Compiler) (position int, err error)

func (Assign) Eval

func (a Assign) Eval(env *obj.Env) obj.Object

func (Assign) String

func (a Assign) String() string

type Bang

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

func (Bang) Compile

func (b Bang) Compile(c *compiler.Compiler) (position int, err error)

func (Bang) Eval

func (b Bang) Eval(env *obj.Env) obj.Object

func (Bang) String

func (b Bang) String() string

type BitwiseAnd

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

func (BitwiseAnd) Compile

func (b BitwiseAnd) Compile(c *compiler.Compiler) (position int, err error)

func (BitwiseAnd) Eval

func (b BitwiseAnd) Eval(env *obj.Env) obj.Object

func (BitwiseAnd) String

func (b BitwiseAnd) String() string

type BitwiseAndAssign

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

func (BitwiseAndAssign) Compile

func (b BitwiseAndAssign) Compile(c *compiler.Compiler) (position int, err error)

func (BitwiseAndAssign) Eval

func (b BitwiseAndAssign) Eval(env *obj.Env) obj.Object

func (BitwiseAndAssign) String

func (b BitwiseAndAssign) String() string

type BitwiseLeftShift

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

func (BitwiseLeftShift) Compile

func (b BitwiseLeftShift) Compile(c *compiler.Compiler) (position int, err error)

func (BitwiseLeftShift) Eval

func (b BitwiseLeftShift) Eval(env *obj.Env) obj.Object

func (BitwiseLeftShift) String

func (b BitwiseLeftShift) String() string

type BitwiseNot

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

func (BitwiseNot) Compile

func (b BitwiseNot) Compile(c *compiler.Compiler) (position int, err error)

func (BitwiseNot) Eval

func (b BitwiseNot) Eval(env *obj.Env) obj.Object

func (BitwiseNot) String

func (b BitwiseNot) String() string

type BitwiseOr

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

func (BitwiseOr) Compile

func (b BitwiseOr) Compile(c *compiler.Compiler) (position int, err error)

func (BitwiseOr) Eval

func (b BitwiseOr) Eval(env *obj.Env) obj.Object

func (BitwiseOr) String

func (b BitwiseOr) String() string

type BitwiseOrAssign

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

func (BitwiseOrAssign) Compile

func (b BitwiseOrAssign) Compile(c *compiler.Compiler) (position int, err error)

func (BitwiseOrAssign) Eval

func (b BitwiseOrAssign) Eval(env *obj.Env) obj.Object

func (BitwiseOrAssign) String

func (b BitwiseOrAssign) String() string

type BitwiseRightShift

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

func (BitwiseRightShift) Compile

func (b BitwiseRightShift) Compile(c *compiler.Compiler) (position int, err error)

func (BitwiseRightShift) Eval

func (b BitwiseRightShift) Eval(env *obj.Env) obj.Object

func (BitwiseRightShift) String

func (b BitwiseRightShift) String() string

type BitwiseShiftLeftAssign

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

func (BitwiseShiftLeftAssign) Compile

func (b BitwiseShiftLeftAssign) Compile(c *compiler.Compiler) (position int, err error)

func (BitwiseShiftLeftAssign) Eval

func (b BitwiseShiftLeftAssign) Eval(env *obj.Env) obj.Object

func (BitwiseShiftLeftAssign) String

func (b BitwiseShiftLeftAssign) String() string

type BitwiseShiftRightAssign

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

func (BitwiseShiftRightAssign) Compile

func (b BitwiseShiftRightAssign) Compile(c *compiler.Compiler) (position int, err error)

func (BitwiseShiftRightAssign) Eval

func (b BitwiseShiftRightAssign) Eval(env *obj.Env) obj.Object

func (BitwiseShiftRightAssign) String

func (b BitwiseShiftRightAssign) String() string

type BitwiseXor

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

func (BitwiseXor) Compile

func (b BitwiseXor) Compile(c *compiler.Compiler) (position int, err error)

func (BitwiseXor) Eval

func (b BitwiseXor) Eval(env *obj.Env) obj.Object

func (BitwiseXor) String

func (b BitwiseXor) String() string

type BitwiseXorAssign

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

func (BitwiseXorAssign) Compile

func (b BitwiseXorAssign) Compile(c *compiler.Compiler) (position int, err error)

func (BitwiseXorAssign) Eval

func (b BitwiseXorAssign) Eval(env *obj.Env) obj.Object

func (BitwiseXorAssign) String

func (b BitwiseXorAssign) String() string

type Block

type Block []Node

func NewBlock

func NewBlock() Block

func (*Block) Add

func (b *Block) Add(n Node)

func (Block) Compile

func (b Block) Compile(c *compiler.Compiler) (position int, err error)

func (Block) Eval

func (b Block) Eval(env *obj.Env) obj.Object

func (Block) String

func (b Block) String() string

type Boolean

type Boolean bool

func (Boolean) Compile

func (b Boolean) Compile(c *compiler.Compiler) (position int, err error)

func (Boolean) Eval

func (b Boolean) Eval(env *obj.Env) obj.Object

func (Boolean) String

func (b Boolean) String() string

type Break

type Break struct{}

func NewBreak

func NewBreak() Break

func (Break) Compile

func (b Break) Compile(c *compiler.Compiler) (position int, err error)

func (Break) Eval

func (b Break) Eval(_ *obj.Env) obj.Object

func (Break) String

func (b Break) String() string

type Call

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

func (Call) Compile

func (c Call) Compile(comp *compiler.Compiler) (position int, err error)

func (Call) Eval

func (c Call) Eval(env *obj.Env) obj.Object

func (Call) String

func (c Call) String() string

type Continue

type Continue struct{}

func NewContinue

func NewContinue() Continue

func (Continue) Compile

func (c Continue) Compile(comp *compiler.Compiler) (position int, err error)

func (Continue) Eval

func (c Continue) Eval(_ *obj.Env) obj.Object

func (Continue) String

func (c Continue) String() string

type Divide

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

func (Divide) Compile

func (d Divide) Compile(c *compiler.Compiler) (position int, err error)

func (Divide) Eval

func (d Divide) Eval(env *obj.Env) obj.Object

func (Divide) String

func (d Divide) String() string

type DivideAssign

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

func (DivideAssign) Compile

func (d DivideAssign) Compile(c *compiler.Compiler) (position int, err error)

func (DivideAssign) Eval

func (d DivideAssign) Eval(env *obj.Env) obj.Object

func (DivideAssign) String

func (d DivideAssign) String() string

type Dot

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

func (Dot) Compile

func (d Dot) Compile(c *compiler.Compiler) (position int, err error)

func (Dot) Eval

func (d Dot) Eval(env *obj.Env) obj.Object

func (Dot) String

func (d Dot) String() string

type Equals

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

func (Equals) Compile

func (e Equals) Compile(c *compiler.Compiler) (position int, err error)

func (Equals) Eval

func (e Equals) Eval(env *obj.Env) obj.Object

func (Equals) String

func (e Equals) String() string

type Float

type Float float64

func (Float) Compile

func (f Float) Compile(c *compiler.Compiler) (position int, err error)

func (Float) Eval

func (f Float) Eval(env *obj.Env) obj.Object

func (Float) String

func (f Float) String() string

type For

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

func (For) Compile

func (f For) Compile(c *compiler.Compiler) (position int, err error)

func (For) Eval

func (f For) Eval(env *obj.Env) obj.Object

func (For) String

func (f For) String() string

type Function

type Function struct {
	Name string
	// contains filtered or unexported fields
}

func (Function) Compile

func (f Function) Compile(c *compiler.Compiler) (position int, err error)

func (Function) Eval

func (f Function) Eval(env *obj.Env) obj.Object

func (Function) String

func (f Function) String() string

type Greater

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

func (Greater) Compile

func (g Greater) Compile(c *compiler.Compiler) (position int, err error)

func (Greater) Eval

func (g Greater) Eval(env *obj.Env) obj.Object

func (Greater) String

func (g Greater) String() string

type GreaterEq

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

func (GreaterEq) Compile

func (g GreaterEq) Compile(c *compiler.Compiler) (position int, err error)

func (GreaterEq) Eval

func (g GreaterEq) Eval(env *obj.Env) obj.Object

func (GreaterEq) String

func (g GreaterEq) String() string

type Identifier

type Identifier string

func (Identifier) Compile

func (i Identifier) Compile(c *compiler.Compiler) (position int, err error)

func (Identifier) Eval

func (i Identifier) Eval(env *obj.Env) obj.Object

func (Identifier) String

func (i Identifier) String() string

type IfExpr

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

func (IfExpr) Compile

func (i IfExpr) Compile(c *compiler.Compiler) (position int, err error)

func (IfExpr) Eval

func (i IfExpr) Eval(env *obj.Env) obj.Object

func (IfExpr) String

func (i IfExpr) String() string

type Import added in v1.2.0

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

func (Import) Compile added in v1.2.0

func (i Import) Compile(c *compiler.Compiler) (position int, err error)

func (Import) Eval added in v1.2.0

func (i Import) Eval(env *obj.Env) obj.Object

func (Import) String added in v1.2.0

func (i Import) String() string

type In

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

func (In) Compile

func (i In) Compile(c *compiler.Compiler) (position int, err error)

func (In) Eval

func (i In) Eval(env *obj.Env) obj.Object

func (In) String

func (i In) String() string

type Index

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

func (Index) Compile

func (i Index) Compile(c *compiler.Compiler) (position int, err error)

func (Index) Eval

func (i Index) Eval(env *obj.Env) obj.Object

func (Index) String

func (i Index) String() string

type Integer

type Integer int64

func (Integer) Compile

func (i Integer) Compile(c *compiler.Compiler) (position int, err error)

func (Integer) Eval

func (i Integer) Eval(env *obj.Env) obj.Object

func (Integer) String

func (i Integer) String() string

type Less

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

func (Less) Compile

func (l Less) Compile(c *compiler.Compiler) (position int, err error)

func (Less) Eval

func (l Less) Eval(env *obj.Env) obj.Object

func (Less) String

func (l Less) String() string

type LessEq

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

func (LessEq) Compile

func (l LessEq) Compile(c *compiler.Compiler) (position int, err error)

func (LessEq) Eval

func (l LessEq) Eval(env *obj.Env) obj.Object

func (LessEq) String

func (l LessEq) String() string

type List

type List []Node

func (List) Compile

func (l List) Compile(c *compiler.Compiler) (position int, err error)

func (List) Eval

func (l List) Eval(env *obj.Env) obj.Object

func (List) String

func (l List) String() string

type Map

type Map [][2]Node

func (Map) Compile

func (m Map) Compile(c *compiler.Compiler) (position int, err error)

func (Map) Eval

func (m Map) Eval(env *obj.Env) obj.Object

func (Map) String

func (m Map) String() string

type Minus

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

func (Minus) Compile

func (m Minus) Compile(c *compiler.Compiler) (position int, err error)

func (Minus) Eval

func (m Minus) Eval(env *obj.Env) obj.Object

func (Minus) String

func (m Minus) String() string

type MinusAssign

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

func (MinusAssign) Compile

func (m MinusAssign) Compile(c *compiler.Compiler) (position int, err error)

func (MinusAssign) Eval

func (m MinusAssign) Eval(env *obj.Env) obj.Object

func (MinusAssign) String

func (m MinusAssign) String() string

type MinusMinus

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

func (MinusMinus) Compile

func (m MinusMinus) Compile(c *compiler.Compiler) (position int, err error)

func (MinusMinus) Eval

func (m MinusMinus) Eval(env *obj.Env) obj.Object

func (MinusMinus) String

func (m MinusMinus) String() string

type Mod

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

func (Mod) Compile

func (m Mod) Compile(c *compiler.Compiler) (position int, err error)

func (Mod) Eval

func (m Mod) Eval(env *obj.Env) obj.Object

func (Mod) String

func (m Mod) String() string

type ModAssign

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

func (ModAssign) Compile

func (m ModAssign) Compile(c *compiler.Compiler) (position int, err error)

func (ModAssign) Eval

func (m ModAssign) Eval(env *obj.Env) obj.Object

func (ModAssign) String

func (m ModAssign) String() string

type Node

type Node interface {
	Eval(*obj.Env) obj.Object
	String() string
	compiler.Compilable
}

func NewAnd

func NewAnd(l, r Node) Node

func NewAssign

func NewAssign(l, r Node) Node

func NewBang

func NewBang(n Node) Node

func NewBitwiseAnd

func NewBitwiseAnd(l, r Node) Node

func NewBitwiseAndAssign

func NewBitwiseAndAssign(l, r Node) Node

func NewBitwiseLeftShift

func NewBitwiseLeftShift(l, r Node) Node

func NewBitwiseNot

func NewBitwiseNot(n Node) Node

func NewBitwiseOr

func NewBitwiseOr(l, r Node) Node

func NewBitwiseOrAssign

func NewBitwiseOrAssign(l, r Node) Node

func NewBitwiseRightShift

func NewBitwiseRightShift(l, r Node) Node

func NewBitwiseShiftLeftAssign

func NewBitwiseShiftLeftAssign(l, r Node) Node

func NewBitwiseShiftRightAssign

func NewBitwiseShiftRightAssign(l, r Node) Node

func NewBitwiseXor

func NewBitwiseXor(l, r Node) Node

func NewBitwiseXorAssign

func NewBitwiseXorAssign(l, r Node) Node

func NewBoolean

func NewBoolean(b bool) Node

func NewCall

func NewCall(fn Node, args []Node) Node

func NewDivide

func NewDivide(l, r Node) Node

func NewDivideAssign

func NewDivideAssign(l, r Node) Node

func NewDot

func NewDot(l, r Node) Node

func NewEquals

func NewEquals(l, r Node) Node

func NewFloat

func NewFloat(f float64) Node

func NewFor

func NewFor(cond, body, before, after Node) Node

func NewFunction

func NewFunction(params []Identifier, body Node) Node

func NewGreater

func NewGreater(l, r Node) Node

func NewGreaterEq

func NewGreaterEq(l, r Node) Node

func NewIdentifier

func NewIdentifier(name string) Node

func NewIfExpr

func NewIfExpr(cond, body, alt Node) Node

func NewImport added in v1.2.0

func NewImport(name Node, parse func(string) (Node, []string)) Node

func NewIn

func NewIn(l, r Node) Node

func NewIndex

func NewIndex(l, i Node) Node

func NewInteger

func NewInteger(i int64) Node

func NewLess

func NewLess(l, r Node) Node

func NewLessEq

func NewLessEq(l, r Node) Node

func NewList

func NewList(elements ...Node) Node

func NewMap

func NewMap(pairs ...[2]Node) Node

func NewMinus

func NewMinus(l, r Node) Node

func NewMinusAssign

func NewMinusAssign(l, r Node) Node

func NewMinusMinus

func NewMinusMinus(r Node) Node

func NewMod

func NewMod(l, r Node) Node

func NewModAssign

func NewModAssign(l, r Node) Node

func NewNotEquals

func NewNotEquals(l, r Node) Node

func NewOr

func NewOr(l, r Node) Node

func NewPlus

func NewPlus(l, r Node) Node

func NewPlusAssign

func NewPlusAssign(l, r Node) Node

func NewPlusPlus

func NewPlusPlus(r Node) Node

func NewPrefixMinus

func NewPrefixMinus(n Node) Node

func NewRawString

func NewRawString(s string) Node

func NewReturn

func NewReturn(n Node) Node

func NewString

func NewString(s string, parse parseFn) (Node, error)

func NewTimes

func NewTimes(l, r Node) Node

func NewTimesAssign

func NewTimesAssign(l, r Node) Node

type NotEquals

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

func (NotEquals) Compile

func (n NotEquals) Compile(c *compiler.Compiler) (position int, err error)

func (NotEquals) Eval

func (n NotEquals) Eval(env *obj.Env) obj.Object

func (NotEquals) String

func (n NotEquals) String() string

type Null

type Null struct{}

func NewNull

func NewNull() Null

func (Null) Compile

func (n Null) Compile(c *compiler.Compiler) (position int, err error)

func (Null) Eval

func (n Null) Eval(_ *obj.Env) obj.Object

func (Null) String

func (n Null) String() string

type Or

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

func (Or) Compile

func (o Or) Compile(c *compiler.Compiler) (position int, err error)

func (Or) Eval

func (o Or) Eval(env *obj.Env) obj.Object

func (Or) String

func (o Or) String() string

type Plus

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

func (Plus) Compile

func (p Plus) Compile(c *compiler.Compiler) (position int, err error)

func (Plus) Eval

func (p Plus) Eval(env *obj.Env) obj.Object

func (Plus) String

func (p Plus) String() string

type PlusAssign

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

func (PlusAssign) Compile

func (p PlusAssign) Compile(c *compiler.Compiler) (position int, err error)

func (PlusAssign) Eval

func (p PlusAssign) Eval(env *obj.Env) obj.Object

func (PlusAssign) String

func (p PlusAssign) String() string

type PlusPlus

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

func (PlusPlus) Compile

func (p PlusPlus) Compile(c *compiler.Compiler) (position int, err error)

func (PlusPlus) Eval

func (p PlusPlus) Eval(env *obj.Env) obj.Object

func (PlusPlus) String

func (p PlusPlus) String() string

type PrefixMinus

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

func (PrefixMinus) Compile

func (p PrefixMinus) Compile(c *compiler.Compiler) (position int, err error)

func (PrefixMinus) Eval

func (p PrefixMinus) Eval(env *obj.Env) obj.Object

func (PrefixMinus) String

func (p PrefixMinus) String() string

type RawString

type RawString string

func (RawString) Compile

func (r RawString) Compile(c *compiler.Compiler) (position int, err error)

func (RawString) Eval

func (r RawString) Eval(env *obj.Env) obj.Object

func (RawString) Quoted

func (r RawString) Quoted() string

func (RawString) String

func (r RawString) String() string

type Return

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

func (Return) Compile

func (r Return) Compile(c *compiler.Compiler) (position int, err error)

func (Return) Eval

func (r Return) Eval(env *obj.Env) obj.Object

func (Return) String

func (r Return) String() string

type String

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

func (String) Compile

func (s String) Compile(c *compiler.Compiler) (position int, err error)

func (String) Eval

func (s String) Eval(env *obj.Env) obj.Object

func (String) Quoted

func (s String) Quoted() string

func (String) String

func (s String) String() string

type Times

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

func (Times) Compile

func (t Times) Compile(c *compiler.Compiler) (position int, err error)

func (Times) Eval

func (t Times) Eval(env *obj.Env) obj.Object

func (Times) String

func (t Times) String() string

type TimesAssign

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

func (TimesAssign) Compile

func (t TimesAssign) Compile(c *compiler.Compiler) (position int, err error)

func (TimesAssign) Eval

func (t TimesAssign) Eval(env *obj.Env) obj.Object

func (TimesAssign) String

func (t TimesAssign) String() string

Jump to

Keyboard shortcuts

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