Documentation ¶
Index ¶
- Constants
- type Node
- func NewAny(this *Token, help *Token) *Node
- func NewBreak(this, label *Token) *Node
- func NewCall(this, label *Token) *Node
- func NewCandidate(this, funcName *Token, args []*Token) *Node
- func NewCommand(this, command, label *Token) *Node
- func NewContinue(this, label *Token) *Node
- func NewFinish(this *Token) *Node
- func NewGoCall(this, funcName *Token, args []*Token) *Node
- func NewLabel(this, label *Token) *Node
- func NewLiteral(this, help *Token) *Node
- func NewLoop(this, pattern, label *Token) *Node
- func NewRoot() *Node
- func NewSwitch(this *Token, pattern, label *Token) *Node
- func NewSwitchLoop(this, pattern, label *Token) *Node
- func (n *Node) AddChild(new *Node)
- func (n *Node) Args() []string
- func (n *Node) AsCandidates() []compromise.Candidate
- func (n *Node) Child() *Node
- func (n *Node) Command() *Token
- func (n *Node) Dump(multiLine bool) string
- func (n *Node) FuncName() *Token
- func (n *Node) GetLabeledNode(label string, referrer *Token) *Node
- func (n *Node) GetStartNodeForCommand(command string) *Node
- func (n *Node) Help() *Token
- func (n *Node) HelpText() string
- func (n *Node) IsRoot() bool
- func (n *Node) Label() *Token
- func (n *Node) LabelWord() string
- func (n *Node) Literal() *Token
- func (n *Node) Next() *Node
- func (n *Node) NodeType() int
- func (n *Node) NodeTypeString() string
- func (n *Node) Parent() *Node
- func (n *Node) Pattern() *Token
- func (n *Node) PatternMatches(s string) bool
- func (n *Node) Root() *Node
- func (n *Node) SelfToken() *Token
- func (n *Node) String() string
- func (n *Node) TargetCommands() []string
- func (n *Node) UpdateLastVisitedWordIndex(index int)
- type Token
Constants ¶
View Source
const ( TokenCommand = iota TokenLiteral TokenLabel TokenHelp // This is used as an expected type. TokenAny )
View Source
const ( NodeRoot = iota NodeCommand NodeLabel NodeCall NodeFinish NodeLoop NodeSwitch NodeSwitchLoop NodeAny NodeBreak NodeContinue NodeGoCall NodeCandidate NodeLiteral )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node implements a tree of Tokens. This tree is a basic AST of the completion spec.
func NewCandidate ¶
func NewCommand ¶
func NewContinue ¶
func NewLiteral ¶
func NewSwitchLoop ¶
func (*Node) AsCandidates ¶
func (n *Node) AsCandidates() []compromise.Candidate
func (*Node) GetLabeledNode ¶
GetLabeledNode returns the NodeLabel with a given label. Only supported by a root node.
func (*Node) GetStartNodeForCommand ¶
GetStartNodeForCommand takes a command name given by completion and returns the starting NodeLabel for the command, taking @command's into account.
func (*Node) NodeTypeString ¶
func (*Node) PatternMatches ¶
func (*Node) TargetCommands ¶
Return command name listed with @command.
func (*Node) UpdateLastVisitedWordIndex ¶
Click to show internal directories.
Click to hide internal directories.