expr

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 2 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Identity

func Identity(node node.Node) node.Node

Identity returns ident or selector expr

func NewSelector

func NewSelector(name string) node.Node

Types

type Binary

type Binary struct {
	X, Y node.Node
	Op   string
}

func NewBinary

func NewBinary(x node.Node) *Binary

func (*Binary) HasIdentity

func (b *Binary) HasIdentity() bool

HasIdentity returns true if x or y opperand is identity

func (*Binary) HasPlaceholder

func (b *Binary) HasPlaceholder() bool

HasPlaceholder returns true if x or y operand is placeholder

func (*Binary) Identity

func (b *Binary) Identity() node.Node

func (*Binary) Parenthesis

func (b *Binary) Parenthesis() *Parenthesis

Parenthesis returns parenthesis

type Call

type Call struct {
	X    node.Node
	Args []node.Node
	Raw  string
}

type Case

type Case struct {
	X Qualify
	Y node.Node
}

type Ident

type Ident struct {
	Name string
}

type Literal

type Literal struct {
	Value string
	Kind  string
}

func NewBoolLiteral

func NewBoolLiteral(v string) *Literal

func NewIntLiteral

func NewIntLiteral(v string) *Literal

func NewNullLiteral

func NewNullLiteral(v string) *Literal

func NewNumericLiteral

func NewNumericLiteral(v string) *Literal

func NewStringLiteral

func NewStringLiteral(v string) *Literal

type Parenthesis

type Parenthesis struct {
	Raw string
	X   node.Node
}

func NewParenthesis

func NewParenthesis(raw string) *Parenthesis

type Placeholder

type Placeholder struct {
	Name     string
	Comments string
}

func NewPlaceholder

func NewPlaceholder(name string) *Placeholder

type Qualify

type Qualify struct {
	X node.Node
}

func NewQualify

func NewQualify() *Qualify

type Range

type Range struct {
	Min node.Node
	Max node.Node
}

type Raw

type Raw struct {
	Raw string
	X   node.Node
}

func NewRaw

func NewRaw(raw string) *Raw

type Selector

type Selector struct {
	Name string
	X    node.Node
}

type Star

type Star struct {
	X        node.Node
	Except   []string
	Comments string
}

func NewStar

func NewStar(x node.Node, comments string) *Star

type Switch

type Switch struct {
	Raw string
	Ident
	Cases []*Case
}

type Unary

type Unary struct {
	Op string
	X  node.Node
}

func NewUnary

func NewUnary(op string) *Unary

Jump to

Keyboard shortcuts

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