expr

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 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

NewSelector returns

Types

type Binary

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

Binary represents binary expr

func NewBinary

func NewBinary(x node.Node) *Binary

NewBinary returns a binary expr

func (*Binary) HasIdentifier added in v0.3.0

func (b *Binary) HasIdentifier() bool

HasIdentifier 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) Identifier added in v0.3.0

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

Identifier returns an identifier node or nil

func (*Binary) Parenthesis

func (b *Binary) Parenthesis() *Parenthesis

Parenthesis returns parenthesis

type Call

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

Call represents a call

type Case

type Case struct {
	X Qualify
	Y node.Node
}

Case represents a switch case

type Ident

type Ident struct {
	Name string
}

Ident represent an identifier

type Literal

type Literal struct {
	Value string
	Kind  string
}

Literal represents a literal

func NewBoolLiteral

func NewBoolLiteral(v string) *Literal

NewBoolLiteral returns bool literal

func NewIntLiteral

func NewIntLiteral(v string) *Literal

NewIntLiteral returns an int literal

func NewNullLiteral

func NewNullLiteral(v string) *Literal

NewNullLiteral returns null literal

func NewNumericLiteral

func NewNumericLiteral(v string) *Literal

NewNumericLiteral returns numeric literal

func NewStringLiteral

func NewStringLiteral(v string) *Literal

NewStringLiteral returns string literal

type Parenthesis

type Parenthesis struct {
	Raw string
	X   node.Node
}

Parenthesis represents parenthesis expr

func NewParenthesis

func NewParenthesis(raw string) *Parenthesis

NewParenthesis returns a parenthesis expr

type Placeholder

type Placeholder struct {
	Name     string
	Comments string
}

Placeholder represetns a placeholder

func NewPlaceholder

func NewPlaceholder(name string) *Placeholder

NewPlaceholder returns a placeholder

type Qualify

type Qualify struct {
	X node.Node
}

Qualify represents qualify node

func NewQualify

func NewQualify() *Qualify

NewQualify returns qualify node

type Range

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

Range represents a range expr

type Raw

type Raw struct {
	Raw      string
	X        node.Node
	Unparsed string
}

Raw represetns a raw expr

func NewRaw

func NewRaw(raw string) *Raw

NewRaw create a raw valie

type Selector

type Selector struct {
	Name string
	X    node.Node
}

Selector represent identifier selector

type Star

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

Star represents a star expr

func NewStar

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

NewStar returns a start expr

type Switch

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

Switch represetns a switch expr

type Unary

type Unary struct {
	Op string
	X  node.Node
}

Unary represents unary expr

func NewUnary

func NewUnary(op string) *Unary

NewUnary crates an unary expr

Jump to

Keyboard shortcuts

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