Documentation
¶
Index ¶
- Constants
- func Aitem(b *rd.Builder) (ok bool)
- func Aitems(b *rd.Builder) (ok bool)
- func ArgList(b *rd.Builder) (ok bool)
- func Body(b *rd.Builder) (ok bool)
- func BodyBody(b *rd.Builder) (ok bool)
- func BodySelections(b *rd.Builder) (ok bool)
- func Bundle(b *rd.Builder) (ok bool)
- func BundleBody(b *rd.Builder) (ok bool)
- func ClassGuardPromises(b *rd.Builder) (ok bool)
- func ClassGuardSelections(b *rd.Builder) (ok bool)
- func ClassPromises(b *rd.Builder) (ok bool)
- func Comment(b *rd.Builder) (ok bool)
- func Comments(b *rd.Builder) (ok bool)
- func Constraint(b *rd.Builder) (ok bool)
- func Equal(a rd.Token, t token.T) bool
- func EqualType(a rd.Token, tt chroma.TokenType) bool
- func FatArrow(b *rd.Builder) (ok bool)
- func Fmt(b *rd.Builder, a string, i int)
- func Function(b *rd.Builder) (ok bool)
- func GaItem(b *rd.Builder) (ok bool)
- func GaItems(b *rd.Builder) (ok bool)
- func GiveArgList(b *rd.Builder) (ok bool)
- func Lex(specification string) ([]rd.Token, error)
- func List(b *rd.Builder) (ok bool)
- func Litem(b *rd.Builder) (ok bool)
- func Litems(b *rd.Builder) (ok bool)
- func Macro(b *rd.Builder) (ok bool)
- func Match(b *rd.Builder, t token.T) bool
- func MatchDiscard(b *rd.Builder, t token.T) bool
- func MatchType(b *rd.Builder, tt chroma.TokenType) bool
- func NakedVar(b *rd.Builder) (ok bool)
- func NamespaceFunction(b *rd.Builder) (ok bool)
- func Peek(b *rd.Builder, t token.T) bool
- func PeekClassGuard(b *rd.Builder) (ok bool)
- func PeekPromiseGuard(b *rd.Builder) (ok bool)
- func Print(w io.Writer, tree *rd.Tree)
- func Promise(b *rd.Builder) (ok bool)
- func PromiseConstraints(b *rd.Builder) (ok bool)
- func PromiseGuard(b *rd.Builder) (ok bool)
- func Promisee(b *rd.Builder) (ok bool)
- func Promises(b *rd.Builder) (ok bool)
- func Qstring(b *rd.Builder) (ok bool)
- func Rval(b *rd.Builder) (ok bool)
- func Selection(b *rd.Builder) (ok bool)
- func Specification(b *rd.Builder) (ok bool)
- func ThinArrow(b *rd.Builder) (ok bool)
- func WalkFunc(tree *rd.Tree, f TreeVisitorFunc)
- type Printer
- type TreeVisitor
- type TreeVisitorFunc
- type WalkStatus
Constants ¶
const LoopBreak = 1000
We have an infinite parsing loop somewhere, if we break it we get parsing errors in the test data we have....Meaning we depend on a 'return true' that should be a 'false' Just quit after 1000(?) loops, until we get a good handle on this. Stuff is fast enough, that you don't notice and you get a nice error.
Variables ¶
This section is empty.
Functions ¶
func BodySelections ¶
func BundleBody ¶
func ClassGuardPromises ¶
func ClassGuardSelections ¶
func ClassPromises ¶
func Constraint ¶
func GiveArgList ¶
func MatchDiscard ¶
MatchDiscard matches the next token type to tt. If OK the token is not added to the tree, but discarded.
func NamespaceFunction ¶ added in v0.1.27
NamespaceFunction parses the (relative?) new syntax "default:function", this is lexed as: KeywordDeclaration Punctuation(:) NameFunction. This functions check for that. It adds a Function to the AST.
func PeekClassGuard ¶
PeekClassGuard checks for a classguard by peeking the next 2 tokens.
func PeekPromiseGuard ¶
PeekPromiseGuard checks for a classguard by peeking the next 2 tokens.
func PromiseConstraints ¶
func PromiseGuard ¶
func Specification ¶
func WalkFunc ¶
func WalkFunc(tree *rd.Tree, f TreeVisitorFunc)
WalkFunc is like Walk but accepts just a callback function.
Types ¶
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer used for some housekeeping during printing.
type TreeVisitor ¶
type TreeVisitor interface {
Visit(tree *rd.Tree, entering bool) WalkStatus
}
TreeVisitor is a callback to be called when traversing the syntax tree. Called twice for every node: once with entering=true when the branch is first visited, then with entering=false after all the children are done.
type TreeVisitorFunc ¶
type TreeVisitorFunc func(tree *rd.Tree, entering bool) WalkStatus
TreeVisitorFunc casts a function to match TreeVisitor interface.
func (TreeVisitorFunc) Visit ¶
func (f TreeVisitorFunc) Visit(tree *rd.Tree, entering bool) WalkStatus
Visit calls visitor function.
type WalkStatus ¶
type WalkStatus int
const ( // GoToNext is the default traversal of every node. GoToNext WalkStatus = iota // SkipChildren tells walker to skip all children of current node. SkipChildren // Terminate tells walker to terminate the traversal. Terminate )
func Walk ¶
func Walk(tree *rd.Tree, visitor TreeVisitor) WalkStatus
Walk traverses tree recursively.