(line int, name string, children ...*TNode)
| 601 | } |
| 602 | |
| 603 | func createElement(line int, name string, children ...*TNode) *TNode { |
| 604 | nodeType := ElementNode |
| 605 | if name == "" { |
| 606 | nodeType = RootNode |
| 607 | } |
| 608 | n := createNode(name, nodeType) |
| 609 | n.lines = line |
| 610 | for _, c := range children { |
| 611 | c.Parent = n |
| 612 | c.PrevSibling = n.LastChild |
| 613 | if c.PrevSibling == nil { |
| 614 | n.FirstChild = c |
| 615 | } else { |
| 616 | c.PrevSibling.NextSibling = c |
| 617 | } |
| 618 | n.LastChild = c |
| 619 | } |
| 620 | return n |
| 621 | } |
| 622 | |
| 623 | func createBookExample() *TNode { |
| 624 | /* |
no test coverage detected
searching dependent graphs…