ast

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expr

type Expr interface {
	String() string
	Tree(ident int) string
}

func Parse

func Parse(tokens []Token) (Expr, error)

type Func

type Func struct {
	Name string
	Args []Expr
}

func (Func) IsContext

func (f Func) IsContext() bool

func (Func) String

func (f Func) String() string

func (Func) Tree

func (f Func) Tree(ident int) string

type Kind

type Kind byte
const (
	TUnknown    Kind = '?'
	TOp         Kind = 'o'
	TComma      Kind = ','
	TSelector   Kind = 's'
	TFunc       Kind = 'f'
	TLeftParen  Kind = '('
	TRightParen Kind = ')'
	TPackage    Kind = 'p'
)

func (Kind) String

func (k Kind) String() string

type Package

type Package string

func (Package) String

func (p Package) String() string

func (Package) Tree

func (p Package) Tree(ident int) string

type Select

type Select struct {
	Expr     Expr
	Selector string
}

func (Select) String

func (s Select) String() string

func (Select) Tree

func (s Select) Tree(ident int) string

type Token

type Token struct {
	Kind Kind
	Text string
}

func Tokenize

func Tokenize(s string) ([]Token, error)

Jump to

Keyboard shortcuts

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