expr

package
v0.0.0-...-b83a777 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2017 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package expr defines data structures representing Neugram expressions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bad

type Bad struct {
	Error error
}

type BasicLiteral

type BasicLiteral struct {
	Value interface{} // string, *big.Int, *big.Float
}

type Binary

type Binary struct {
	Op    token.Token // Add, Sub, Mul, Div, Rem, Pow, And, Or, Equal, NotEqual, Less, Greater
	Left  Expr
	Right Expr
}

type Call

type Call struct {
	Func       Expr
	Args       []Expr
	Ellipsis   bool // last argument expands, e.g. f(x...)
	ElideError bool
}

type CompLiteral

type CompLiteral struct {
	Type     tipe.Type
	Keys     []Expr // TODO: could make this []string
	Elements []Expr
}

type Expr

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

type FuncLiteral

type FuncLiteral struct {
	Name            string // may be empty
	ReceiverName    string // if non-empty, this is a method
	PointerReceiver bool
	Type            *tipe.Func
	ParamNames      []string
	ResultNames     []string
	Body            interface{} // *stmt.Block, breaking the package import cycle
}

type Ident

type Ident struct {
	Name string
}

type Index

type Index struct {
	Left     Expr
	Indicies []Expr
}

type MapLiteral

type MapLiteral struct {
	Type   tipe.Type
	Keys   []Expr
	Values []Expr
}

type Range

type Range struct {
	Start Expr
	End   Expr
	Exact Expr
}

type Selector

type Selector struct {
	Left  Expr
	Right *Ident
}

type Shell

type Shell struct {
	Cmds       []*ShellList
	TrapOut    bool // override os.Stdout, outer language collect it
	DropOut    bool // send stdout to /dev/null (just an optimization)
	ElideError bool
}

type ShellAndOr

type ShellAndOr struct {
	Pipeline   []*ShellPipeline
	Sep        []token.Token // '&&' or '||'. len(Sep) == len(Pipeline)-1
	Background bool
}

type ShellAssign

type ShellAssign struct {
	Key   string
	Value string
}

type ShellCmd

type ShellCmd struct {
	SimpleCmd *ShellSimpleCmd // or:
	Subshell  *ShellList
}

type ShellList

type ShellList struct {
	AndOr []*ShellAndOr
}

type ShellPipeline

type ShellPipeline struct {
	Bang bool
	Cmd  []*ShellCmd // Cmd[0] | Cmd[1] | ...
}

type ShellRedirect

type ShellRedirect struct {
	Number   *int
	Token    token.Token // '<', '<&', '>', '>&', '>>'
	Filename string
}

type ShellSimpleCmd

type ShellSimpleCmd struct {
	Redirect []*ShellRedirect
	Assign   []ShellAssign
	Args     []string
}

type Slice

type Slice struct {
	Low  Expr
	High Expr
	Max  Expr
}

type SliceLiteral

type SliceLiteral struct {
	Type  *tipe.Slice
	Elems []Expr
}

type TableLiteral

type TableLiteral struct {
	Type     *tipe.Table
	ColNames []Expr
	Rows     [][]Expr
}

type Type

type Type struct {
	Type tipe.Type
}

Type is not a typical Neugram expression. It is used only for when types are passed as arguments to the builtin functions new and make.

type TypeAssert

type TypeAssert struct {
	Left Expr
	Type tipe.Type
}

type Unary

type Unary struct {
	Op   token.Token // Not, Mul (deref), Ref, LeftParen, Range
	Expr Expr
}

Jump to

Keyboard shortcuts

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