Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,544 for parseFS (0.21 sec)

  1. src/text/template/helper.go

    }
    
    // ParseFS is like [Template.ParseFiles] or [Template.ParseGlob] but reads from the file system fsys
    // instead of the host operating system's file system.
    // It accepts a list of glob patterns (see [path.Match]).
    // (Note that most file names serve as glob patterns matching only themselves.)
    func ParseFS(fsys fs.FS, patterns ...string) (*Template, error) {
    	return parseFS(nil, fsys, patterns)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 21:54:08 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  2. src/html/template/template.go

    	return template.IsTrue(val)
    }
    
    // ParseFS is like [ParseFiles] or [ParseGlob] but reads from the file system fs
    // instead of the host operating system's file system.
    // It accepts a list of glob patterns.
    // (Note that most file names serve as glob patterns matching only themselves.)
    func ParseFS(fs fs.FS, patterns ...string) (*Template, error) {
    	return parseFS(nil, fs, patterns)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 21:00:46 UTC 2024
    - 17K bytes
    - Viewed (0)
  3. src/html/template/multi_test.go

    `
    
    func TestMultiExecute(t *testing.T) {
    	// Declare a couple of templates first.
    	template, err := New("root").Parse(multiText1)
    	if err != nil {
    		t.Fatalf("parse error for 1: %s", err)
    	}
    	_, err = template.Parse(multiText2)
    	if err != nil {
    		t.Fatalf("parse error for 2: %s", err)
    	}
    	testExecute(multiExecTests, template, t)
    }
    
    func TestParseFiles(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 15:48:16 UTC 2022
    - 8K bytes
    - Viewed (0)
  4. src/text/template/multi_test.go

    	}
    }
    
    func TestAddParseTree(t *testing.T) {
    	// Create some templates.
    	root, err := New("root").Parse(cloneText1)
    	if err != nil {
    		t.Fatal(err)
    	}
    	_, err = root.Parse(cloneText2)
    	if err != nil {
    		t.Fatal(err)
    	}
    	// Add a new parse tree.
    	tree, err := parse.Parse("cloneText3", cloneText3, "", "", nil, builtins())
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 08 10:48:29 UTC 2022
    - 11.7K bytes
    - Viewed (0)
  5. src/embed/embed.go

    //
    // For example, given the content variable in the example above, we can write:
    //
    //	http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(content))))
    //
    //	template.ParseFS(content, "*.tmpl")
    //
    // # Tools
    //
    // To support tools that analyze Go packages, the patterns found in //go:embed lines
    // are available in “go list” output. See the EmbedPatterns, TestEmbedPatterns,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 19:42:51 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  6. internal/s3select/sql/parser.go

    }
    
    // FuncExpr represents a function call
    type FuncExpr struct {
    	SFunc     *SimpleArgFunc `parser:"  @@"`
    	Count     *CountFunc     `parser:"| @@"`
    	Cast      *CastFunc      `parser:"| @@"`
    	Substring *SubstringFunc `parser:"| @@"`
    	Extract   *ExtractFunc   `parser:"| @@"`
    	Trim      *TrimFunc      `parser:"| @@"`
    	DateAdd   *DateAddFunc   `parser:"| @@"`
    	DateDiff  *DateDiffFunc  `parser:"| @@"`
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Jan 18 07:03:17 UTC 2024
    - 12.9K bytes
    - Viewed (0)
  7. src/text/template/parse/parse.go

    	case *WithNode:
    	default:
    		panic("unknown node: " + n.String())
    	}
    	return false
    }
    
    // parse is the top-level parser for a template, essentially the same
    // as itemList except it also parses {{define}} actions.
    // It runs to EOF.
    func (t *Tree) parse() {
    	t.Root = t.newList(t.peek().pos)
    	for t.peek().typ != itemEOF {
    		if t.peek().typ == itemLeftDelim {
    			delim := t.next()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:57:51 UTC 2024
    - 21.3K bytes
    - Viewed (0)
  8. test/stress/parsego.go

    	return isGoFile(dir) &&
    		!strings.HasSuffix(dir.Name(), "_test.go") // ignore test files
    }
    
    func pkgName(filename string) string {
    	file, err := parser.ParseFile(token.NewFileSet(), filename, nil, parser.PackageClauseOnly)
    	if err != nil || file == nil {
    		return ""
    	}
    	return file.Name.Name
    }
    
    func parseDir(dirpath string) map[string]*ast.Package {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 4.1K bytes
    - Viewed (0)
  9. tools/docker-builder/dockerfile/parse.go

    	Value     []string // The contents of the command (ex: `ubuntu:xenial`)
    }
    
    // parseFile parses a Dockerfile from a filename.
    func parseFile(filename string) ([]Command, error) {
    	file, err := os.Open(filename)
    	if err != nil {
    		return nil, err
    	}
    	defer file.Close()
    
    	res, err := parser.Parse(file)
    	if err != nil {
    		return nil, err
    	}
    
    	var ret []Command
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  10. pkg/util/iptables/testing/parse.go

    var ipTablesValuePtrType = reflect.TypeOf((*IPTablesValue)(nil))
    
    // ParseRule parses rule. If strict is false, it will parse the recognized
    // parameters and ignore unrecognized ones. If it is true, parsing will fail if there are
    // unrecognized parameters.
    func ParseRule(rule string, strict bool) (*Rule, error) {
    	parsed := &Rule{Raw: rule}
    
    	// Split rule into "words" (where a quoted string is a single word).
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 19 01:20:51 UTC 2023
    - 11.6K bytes
    - Viewed (0)
Back to top