starlark

package
v0.0.0-...-ee11cf2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FunctionArg

type FunctionArg struct {
	ParamExpr         *build.Ident
	SingleValueExpr   *build.StringExpr
	MultipleValueExpr *build.ListExpr
}

FunctionArg is a wrapper around a Starlark Function argument.

func NewFunctionArg

func NewFunctionArg(a *build.AssignExpr) (*FunctionArg, error)

NewFunctionArg creates a function argument wrapper object for the given Starlark call expression.

func (*FunctionArg) HasMultipleValue

func (a *FunctionArg) HasMultipleValue() bool

HasMultipleValue returns whether this function argument was assigned a list of strings as value.

func (*FunctionArg) HasSingleValue

func (a *FunctionArg) HasSingleValue() bool

HasSingleValue eturns whether this function argument was assigned a single string value in the call expression.

func (*FunctionArg) MultipleValue

func (a *FunctionArg) MultipleValue() []string

MultipleValue returns the list of strings that was assigned to this function argument.

func (*FunctionArg) Param

func (a *FunctionArg) Param() string

Param returns the name of the parameter in this function argument refers to.

func (*FunctionArg) SingleValue

func (a *FunctionArg) SingleValue() string

SingleValue returns the string value assigned to this function argument.

func (*FunctionArg) String

func (a *FunctionArg) String() string

type FunctionCall

type FunctionCall struct {
	Expr     *build.CallExpr
	NameExpr *build.Ident

	Args []*FunctionArg
}

FunctionCall is a wrapper around a Starlark Function call.

func NewFunctionCall

func NewFunctionCall(c *build.CallExpr) (*FunctionCall, error)

NewFunctionCall creates a function call wrapper object for the given Starlark call expression.

func (*FunctionCall) Name

func (c *FunctionCall) Name() string

Name is the name of the Starlark function.

func (*FunctionCall) String

func (c *FunctionCall) String() string

Jump to

Keyboard shortcuts

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