- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for IsEmptyTree (0.13 sec)
-
src/text/template/parse/parse.go
func (t *Tree) add() { tree := t.treeSet[t.Name] if tree == nil || IsEmptyTree(tree.Root) { t.treeSet[t.Name] = t return } if !IsEmptyTree(t.Root) { t.errorf("template: multiple definition of template %q", t.Name) } } // IsEmptyTree reports whether this tree (node) is empty of everything but space or comments. func IsEmptyTree(n Node) bool { switch n := n.(type) { case nil: return true
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 20:57:51 UTC 2024 - 21.3K bytes - Viewed (0) -
src/text/template/template.go
func (t *Template) associate(new *Template, tree *parse.Tree) bool { if new.common != t.common { panic("internal error: associate not common") } if old := t.tmpl[new.name]; old != nil && parse.IsEmptyTree(tree.Root) && old.Tree != nil { // If a template by that name exists, // don't replace it with an empty template. return false } t.tmpl[new.name] = new return true
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 20:57:51 UTC 2024 - 7.2K bytes - Viewed (0) -
src/text/template/parse/parse_test.go
} func TestIsEmpty(t *testing.T) { if !IsEmptyTree(nil) { t.Errorf("nil tree is not empty") } for _, test := range isEmptyTests { tree, err := New("root").Parse(test.input, "", "", make(map[string]*Tree), nil) if err != nil { t.Errorf("%q: unexpected error: %v", test.name, err) continue } if empty := IsEmptyTree(tree.Root); empty != test.empty {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat Feb 24 21:59:12 UTC 2024 - 24K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"IdentifierNode.Ident", Field, 0}, {"IdentifierNode.NodeType", Field, 0}, {"IdentifierNode.Pos", Field, 1}, {"IfNode", Type, 0}, {"IfNode.BranchNode", Field, 0}, {"IsEmptyTree", Func, 0}, {"ListNode", Type, 0}, {"ListNode.NodeType", Field, 0}, {"ListNode.Nodes", Field, 0}, {"ListNode.Pos", Field, 1}, {"Mode", Type, 16}, {"New", Func, 0},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 534.2K bytes - Viewed (0)