yokast

package
v0.0.0-...-713993e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assign

type Assign struct {
	Stmt
	Identifier token.Token
	Value      Expr
}

Assign is a let statement

type Atom

type Atom struct {
	Expr
	// TODO: should these be copied strings?
	// It would be faster to just have these point to a tokens location.
	Value string
}

Atom is an atom

type Block

type Block struct {
	Stmt
	Statements []Stmt
}

type Call

type Call struct {
	Expr
	Identifier *Identifier
	Arguments  []Expr
}

Call is a call expression

type Comment

type Comment struct {
	Stmt
	Value string
}

Comment is a line comment

type Expr

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

Expr is an expression in an AST

type GroupExpr

type GroupExpr struct {
	Expr
	Expression Expr
}

GroupExpr is a yok grouped expression

type Identifier

type Identifier struct {
	Expr
	Token token.Token
}

Identifier is a yok identifier

type If

type If struct {
	Stmt
	Test     Expr
	Body     *Block
	ElseBody *Block
}

type InfixExpr

type InfixExpr struct {
	Expr
	Left     Expr
	Operator token.Token
	Right    Expr
}

InfixExpr is a yok infix expression

type NewLine

type NewLine struct {
	Stmt
}

NewLine is a solo new line

type Node

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

Node is a valid AST node

type PrefixExpr

type PrefixExpr struct {
	Expr
	Token      token.Token
	Expression Expr
}

PrefixExpr is a yok prefix expression

type Script

type Script struct {
	Node
	Statements []Stmt
}

Script represents an entire yok script

type Stmt

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

Stmt is a statement in an AST

type StmtExpr

type StmtExpr struct {
	Stmt
	Expression Expr
}

StmtExpr is any statement that consists of a single expression

type String

type String struct {
	Expr
	// TODO: should these be copied strings?
	// It would be faster to just have these point to a tokens location.
	Value string
}

String is a string literal

Jump to

Keyboard shortcuts

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