MCPcopy Create free account
hub / github.com/dim-an/cod / walkLineTree

Function walkLineTree

parse_doc/textutil_test.go:28–41  ·  view source on GitHub ↗
(tree *lineTree)

Source from the content-addressed store, hash-verified

26}
27
28func walkLineTree(tree *lineTree) (res []treeNode) {
29 var walk func(int, *lineTree)
30 walk = func(initialDepth int, tree *lineTree) {
31 res = append(res, treeNode{
32 childDepth: initialDepth,
33 line: tree.line,
34 })
35 for i := range tree.children {
36 walk(initialDepth+1, &tree.children[i])
37 }
38 }
39 walk(0, tree)
40 return
41}
42
43func TestFindIndentedParagraph(t *testing.T) {
44 makeFlattened := func(text, paragraph string) []treeNode {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected