mirror of
https://github.com/google/go-jsonnet.git
synced 2025-08-06 22:37:23 +02:00
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>
This commit is contained in:
parent
56da397819
commit
42cb19ef24
12
toolutils/BUILD.bazel
Normal file
12
toolutils/BUILD.bazel
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = ["ast.go"],
|
||||||
|
importpath = "github.com/google/go-jsonnet/toolutils",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
deps = [
|
||||||
|
"//ast:go_default_library",
|
||||||
|
"//internal/parser:go_default_library",
|
||||||
|
],
|
||||||
|
)
|
12
toolutils/ast.go
Normal file
12
toolutils/ast.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// 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)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user