go-jsonnet/toolutils/ast.go
sh0rez 42cb19ef24 feat(parser): export parser.Children (#327)
* feat(parser): export parser.Children

As parser was moved to internal/parser, it is not possible to import it into
external projects anymore.

However, parser.Children() is handy to use in static analysis tools, so it is
worth exporting. This does that by adding a stub package
`github.com/google/go-jsonnet/parser` that wraps the internal function.

Signed-off-by: sh0rez <me@shorez.de>
2019-10-06 22:38:37 +02:00

13 lines
364 B
Go

// Package toolutils includes several utilities handy for use in code analysis tools
package toolutils
import (
"github.com/google/go-jsonnet/ast"
"github.com/google/go-jsonnet/internal/parser"
)
// Children returns all children of a node. It supports ASTs before and after desugaring.
func Children(node ast.Node) []ast.Node {
return parser.Children(node)
}