parser

package
v1.26.7 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	FnObj      types.Object
	Name       string
	Value      Value
	Properties Properties
	Position   token.Position
}

func MustOption

func MustOption(o *Option, _ bool) *Option

func (Option) At added in v1.14.0

func (o Option) At(key string) (*Option, bool)

func (Option) Exists

func (o Option) Exists(key string) bool

func (Option) OneOf

func (o Option) OneOf(key string) bool

func (Option) Slice added in v1.14.0

func (o Option) Slice(key string) ([]*Option, bool)

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(pkg *packages.Package) *Parser

func (Parser) Parse

func (p Parser) Parse(expr ast.Expr) (*Option, error)

type Properties

type Properties map[string][]*Option

type Value

type Value struct {
	// contains filtered or unexported fields
}

func (Value) Bool

func (v Value) Bool() (value bool)

func (Value) Expr

func (v Value) Expr() ast.Expr

func (Value) ExprSlice added in v1.6.0

func (v Value) ExprSlice() (value []ast.Expr)

func (Value) Float

func (v Value) Float() (value float32)

func (Value) Int

func (v Value) Int() (value int)

func (Value) Pos

func (v Value) Pos() token.Position

func (Value) String

func (v Value) String() (value string)

func (Value) StringSlice

func (v Value) StringSlice() (value []string)

func (Value) Type

func (v Value) Type() types.Type

Jump to

Keyboard shortcuts

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