Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AnnotationRules = On(Any).Roles(uast.File)
AnnotationRules describes how a UAST should be annotated with `uast.Role`.
https://godoc.org/gopkg.in/bblfsh/sdk.v1/uast/ann
View Source
var ToNode = &uast.ObjectToNode{ TopLevelIsRootNode: true, InternalTypeKey: "kind", OffsetKey: "pos", EndOffsetKey: "end", LineKey: "line", ColumnKey: "col", TokenKeys: map[string]bool{ "text": true, }, IsNode: func(v map[string]interface{}) bool { _, ok := v["kind"].(string) return ok }, Modifier: func(n map[string]interface{}) error { if flags, ok := n["flags"].([]interface{}); ok { var newFlags map[string]bool if len(flags) > 0 { newFlags = make(map[string]bool, len(flags)) } for _, f := range flags { flagStr, ok := f.(string) if !ok { return fmt.Errorf("flag %+v isn't string", f) } newFlags[flagStr] = true } n["flags"] = newFlags } return nil }, }
ToNode is an instance of `uast.ObjectToNode`, defining how to transform an into a UAST (`uast.Node`).
https://godoc.org/gopkg.in/bblfsh/sdk.v1/uast#ObjectToNode
View Source
var Transformers = []transformer.Tranformer{ annotatter.NewAnnotatter(AnnotationRules), positioner.NewFillLineColFromOffset(), }
Transformers is the of list `transformer.Transfomer` to apply to a UAST, to learn more about the Transformers and the available ones take a look to: https://godoc.org/gopkg.in/bblfsh/sdk.v1/uast/transformers
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.