ast

package
v0.5.16 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayLiteral

type ArrayLiteral struct {
	Token    token.Token
	Elements []Expression
}

func (*ArrayLiteral) String

func (al *ArrayLiteral) String() string

func (*ArrayLiteral) TokenLiteral

func (al *ArrayLiteral) TokenLiteral() string

type Assign

type Assign struct {
	Token token.Token
	Name  *Identifier
	Value Expression
}

func (*Assign) String

func (ae *Assign) String() string

func (*Assign) TokenLiteral

func (ae *Assign) TokenLiteral() string

type AssignEqual

type AssignEqual struct {
	Token token.Token
	Left  *Identifier
	Value Expression
}

func (*AssignEqual) String

func (ae *AssignEqual) String() string

func (*AssignEqual) TokenLiteral

func (ae *AssignEqual) TokenLiteral() string

type AssignmentExpression

type AssignmentExpression struct {
	Token token.Token
	Left  Expression
	Value Expression
}

func (*AssignmentExpression) String

func (ae *AssignmentExpression) String() string

func (*AssignmentExpression) TokenLiteral

func (ae *AssignmentExpression) TokenLiteral() string

type At

type At struct {
	Token token.Token
}

func (*At) String

func (a *At) String() string

func (*At) TokenLiteral

func (a *At) TokenLiteral() string

type BlockStatement

type BlockStatement struct {
	Token      token.Token
	Statements []Statement
}

func (*BlockStatement) String

func (bs *BlockStatement) String() string

func (*BlockStatement) TokenLiteral

func (bs *BlockStatement) TokenLiteral() string

type Boolean

type Boolean struct {
	Token token.Token
	Value bool
}

func (*Boolean) String

func (b *Boolean) String() string

func (*Boolean) TokenLiteral

func (b *Boolean) TokenLiteral() string

type Break

type Break struct {
	Statement
	Token token.Token // the 'break' token
}

func (*Break) String

func (b *Break) String() string

func (*Break) TokenLiteral

func (b *Break) TokenLiteral() string

type CallExpression

type CallExpression struct {
	Token     token.Token
	Function  Expression // can be Identifier or FunctionLiteral
	Arguments []Expression
}

func (*CallExpression) String

func (ce *CallExpression) String() string

func (*CallExpression) TokenLiteral

func (ce *CallExpression) TokenLiteral() string

type CaseExpression

type CaseExpression struct {
	Token   token.Token
	Default bool
	Expr    []Expression
	Block   *BlockStatement
}

func (*CaseExpression) String

func (ce *CaseExpression) String() string

func (*CaseExpression) TokenLiteral

func (ce *CaseExpression) TokenLiteral() string

type Continue

type Continue struct {
	Statement
	Token token.Token // the 'continue' token
}

func (*Continue) String

func (c *Continue) String() string

func (*Continue) TokenLiteral

func (c *Continue) TokenLiteral() string

type DictLiteral

type DictLiteral struct {
	Token token.Token
	Pairs map[Expression]Expression
}

func (*DictLiteral) String

func (dl *DictLiteral) String() string

func (*DictLiteral) TokenLiteral

func (dl *DictLiteral) TokenLiteral() string

type Expression

type Expression interface {
	Node
	// contains filtered or unexported methods
}

type ExpressionStatement

type ExpressionStatement struct {
	Token      token.Token
	Expression Expression
}

func (*ExpressionStatement) String

func (es *ExpressionStatement) String() string

func (*ExpressionStatement) TokenLiteral

func (es *ExpressionStatement) TokenLiteral() string

type FloatLiteral

type FloatLiteral struct {
	Token token.Token
	Value float64
}

func (*FloatLiteral) String

func (fl *FloatLiteral) String() string

func (*FloatLiteral) TokenLiteral

func (fl *FloatLiteral) TokenLiteral() string

type For

type For struct {
	Token        token.Token
	Identifier   string      // "i"
	StarterName  *Identifier // i = 0
	StarterValue Expression
	Closer       Expression // i++
	Condition    Expression // i < 1
	Block        *BlockStatement
}

type ForIn

type ForIn struct {
	Token    token.Token
	Key      string
	Value    string
	Iterable Expression
	Block    *BlockStatement
}

func (*ForIn) String

func (fi *ForIn) String() string

func (*ForIn) TokenLiteral

func (fi *ForIn) TokenLiteral() string

type FunctionLiteral

type FunctionLiteral struct {
	Token      token.Token
	Name       string
	Parameters []*Identifier
	Defaults   map[string]Expression
	Body       *BlockStatement
}

func (*FunctionLiteral) String

func (fl *FunctionLiteral) String() string

func (*FunctionLiteral) TokenLiteral

func (fl *FunctionLiteral) TokenLiteral() string

type Identifier

type Identifier struct {
	Token token.Token
	Value string
}

func (*Identifier) String

func (i *Identifier) String() string

func (*Identifier) TokenLiteral

func (i *Identifier) TokenLiteral() string

type IfExpression

type IfExpression struct {
	Token       token.Token
	Condition   Expression
	Consequence *BlockStatement
	Alternative *BlockStatement
}

func (*IfExpression) String

func (ie *IfExpression) String() string

func (*IfExpression) TokenLiteral

func (ie *IfExpression) TokenLiteral() string

type Import

type Import struct {
	Token       token.Token
	Identifiers map[string]*Identifier
}

func (*Import) String

func (i *Import) String() string

func (*Import) TokenLiteral

func (i *Import) TokenLiteral() string

type IndexExpression

type IndexExpression struct {
	Token token.Token
	Left  Expression
	Index Expression
}

func (*IndexExpression) String

func (ie *IndexExpression) String() string

func (*IndexExpression) TokenLiteral

func (ie *IndexExpression) TokenLiteral() string

type InfixExpression

type InfixExpression struct {
	Token    token.Token
	Left     Expression
	Operator string
	Right    Expression
}

func (*InfixExpression) String

func (oe *InfixExpression) String() string

func (*InfixExpression) TokenLiteral

func (oe *InfixExpression) TokenLiteral() string

type IntegerLiteral

type IntegerLiteral struct {
	Token token.Token
	Value int64
}

func (*IntegerLiteral) String

func (il *IntegerLiteral) String() string

func (*IntegerLiteral) TokenLiteral

func (il *IntegerLiteral) TokenLiteral() string

type LetStatement

type LetStatement struct {
	Token token.Token
	Name  *Identifier
	Value Expression
}

func (*LetStatement) String

func (ls *LetStatement) String() string

func (*LetStatement) TokenLiteral

func (ls *LetStatement) TokenLiteral() string

type MethodExpression

type MethodExpression struct {
	Token     token.Token
	Object    Expression
	Method    Expression
	Arguments []Expression
	Defaults  map[string]Expression
}

func (*MethodExpression) String

func (me *MethodExpression) String() string

func (*MethodExpression) TokenLiteral

func (me *MethodExpression) TokenLiteral() string

type Node

type Node interface {
	TokenLiteral() string
	String() string // to help debug the many errors lmao
}

type Null

type Null struct {
	Token token.Token
}

func (*Null) String

func (n *Null) String() string

func (*Null) TokenLiteral

func (n *Null) TokenLiteral() string

type Package

type Package struct {
	Token token.Token
	Name  *Identifier
	Block *BlockStatement
}

func (*Package) String

func (p *Package) String() string

func (*Package) TokenLiteral

func (p *Package) TokenLiteral() string

type PackageBlock

type PackageBlock struct {
	Token      token.Token
	Statements []Statement
}

func (*PackageBlock) String

func (pb *PackageBlock) String() string

func (*PackageBlock) TokenLiteral

func (pb *PackageBlock) TokenLiteral() string

type PostfixExpression

type PostfixExpression struct {
	Token    token.Token
	Operator string
}

func (*PostfixExpression) String

func (pe *PostfixExpression) String() string

func (*PostfixExpression) TokenLiteral

func (pe *PostfixExpression) TokenLiteral() string

type PrefixExpression

type PrefixExpression struct {
	Token    token.Token
	Operator string
	Right    Expression
}

func (*PrefixExpression) String

func (pe *PrefixExpression) String() string

func (*PrefixExpression) TokenLiteral

func (pe *PrefixExpression) TokenLiteral() string

type Program

type Program struct {
	Statements []Statement
}

func (*Program) String

func (p *Program) String() string

func (*Program) TokenLiteral

func (p *Program) TokenLiteral() string

type PropertyAssignment

type PropertyAssignment struct {
	Token token.Token // the '=' token
	Name  *PropertyExpression
	Value Expression
}

func (*PropertyAssignment) String

func (pa *PropertyAssignment) String() string

func (*PropertyAssignment) TokenLiteral

func (pa *PropertyAssignment) TokenLiteral() string

type PropertyExpression

type PropertyExpression struct {
	Expression
	Token    token.Token // The . token
	Object   Expression
	Property Expression
}

func (*PropertyExpression) String

func (pe *PropertyExpression) String() string

func (*PropertyExpression) TokenLiteral

func (pe *PropertyExpression) TokenLiteral() string

type ReturnStatement

type ReturnStatement struct {
	Token       token.Token
	ReturnValue Expression
}

func (*ReturnStatement) String

func (rs *ReturnStatement) String() string

func (*ReturnStatement) TokenLiteral

func (rs *ReturnStatement) TokenLiteral() string

type Statement

type Statement interface {
	Node
	// contains filtered or unexported methods
}

type StringLiteral

type StringLiteral struct {
	Token token.Token
	Value string
}

func (*StringLiteral) String

func (sl *StringLiteral) String() string

func (*StringLiteral) TokenLiteral

func (sl *StringLiteral) TokenLiteral() string

type SwitchExpression

type SwitchExpression struct {
	Token   token.Token
	Value   Expression
	Choices []*CaseExpression
}

func (*SwitchExpression) String

func (se *SwitchExpression) String() string

func (*SwitchExpression) TokenLiteral

func (se *SwitchExpression) TokenLiteral() string

type WhileExpression

type WhileExpression struct {
	Token       token.Token
	Condition   Expression
	Consequence *BlockStatement
}

func (*WhileExpression) String

func (we *WhileExpression) String() string

func (*WhileExpression) TokenLiteral

func (we *WhileExpression) TokenLiteral() string

Jump to

Keyboard shortcuts

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