Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for IsEmptyTree (0.15 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. api/go1.txt

    pkg text/template/parse, const NodeText NodeType
    pkg text/template/parse, const NodeVariable NodeType
    pkg text/template/parse, const NodeWith NodeType
    pkg text/template/parse, func IsEmptyTree(Node) bool
    pkg text/template/parse, func New(string, ...map[string]interface{}) *Tree
    pkg text/template/parse, func NewIdentifier(string) *IdentifierNode
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 14 18:58:28 UTC 2013
    - 1.7M bytes
    - Viewed (0)
Back to top