ast

package
v0.0.0-...-1ec79b4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone[E Node](node E) E

Types

type DotSelector

type DotSelector struct {
	PosRange
	Left, Right Node // left.right
}

func (*DotSelector) Clone

func (dot *DotSelector) Clone() Node

func (*DotSelector) Equal

func (dot *DotSelector) Equal(other Node) bool

func (*DotSelector) Name

func (*DotSelector) Name() string

func (*DotSelector) String

func (dot *DotSelector) String() string

type If

type If struct {
	PosRange
	Cond, Then Node
	Else       Node // optional
}

func (*If) Clone

func (if_ *If) Clone() Node

func (*If) Equal

func (if_ *If) Equal(other Node) bool

func (*If) Name

func (*If) Name() string

func (*If) String

func (if_ *If) String() string

type ImportGo

type ImportGo struct {
	PosRange
	Items []Node // string | symbol | (symbol string)
}

func (*ImportGo) Clone

func (importgo *ImportGo) Clone() Node

func (*ImportGo) Equal

func (importgo *ImportGo) Equal(other Node) bool

func (*ImportGo) Name

func (importgo *ImportGo) Name() string

func (*ImportGo) String

func (importgo *ImportGo) String() string

type Keyword

type Keyword struct {
	PosRange
	Value string
}

func (*Keyword) Clone

func (kw *Keyword) Clone() Node

func (*Keyword) Equal

func (kw *Keyword) Equal(node Node) bool

func (*Keyword) Name

func (*Keyword) Name() string

func (*Keyword) String

func (kw *Keyword) String() string

type Literal

type Literal[L LiteralValue] struct {
	PosRange
	Value L
}

func (*Literal[L]) Clone

func (lit *Literal[L]) Clone() Node

func (*Literal[E]) Equal

func (lit *Literal[E]) Equal(other Node) bool

func (*Literal[L]) Name

func (*Literal[L]) Name() string

func (*Literal[L]) String

func (lit *Literal[L]) String() string

type LiteralValue

type LiteralValue interface {
	string | int64 | float64 | bool
}

type Node

type Node interface {
	fmt.Stringer
	Equal(other Node) bool
	Name() string
	Pos() PosRange
	Clone() Node
}

type Package

type Package struct {
	PosRange
	Nodes []Node
}

func (*Package) Clone

func (pkg *Package) Clone() Node

func (*Package) Equal

func (pkg *Package) Equal(other Node) bool

func (*Package) Name

func (*Package) Name() string

func (*Package) String

func (pkg *Package) String() string

type PosRange

type PosRange struct {
	From, To tokens.Position
}

func (PosRange) Pos

func (pos PosRange) Pos() PosRange

type SExp

type SExp struct {
	PosRange
	Items []Node
}

func NewSexp

func NewSexp(items ...Node) *SExp

func (*SExp) Clone

func (sexp *SExp) Clone() Node

func (*SExp) Equal

func (sexp *SExp) Equal(other Node) bool

func (*SExp) Name

func (sexp *SExp) Name() string

func (*SExp) String

func (sexp *SExp) String() string

type SpecialOp

type SpecialOp struct {
	PosRange
	Op    string
	Items []Node
}

func (*SpecialOp) Clone

func (special *SpecialOp) Clone() Node

func (*SpecialOp) Equal

func (special *SpecialOp) Equal(other Node) bool

func (*SpecialOp) Name

func (special *SpecialOp) Name() string

func (*SpecialOp) String

func (special *SpecialOp) String() string

type Symbol

type Symbol struct {
	PosRange
	Value string
}

func (*Symbol) Clone

func (sym *Symbol) Clone() Node

func (*Symbol) Equal

func (sym *Symbol) Equal(node Node) bool

func (*Symbol) Name

func (*Symbol) Name() string

func (*Symbol) String

func (sym *Symbol) String() string

Jump to

Keyboard shortcuts

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