Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 259 for fsel (0.34 sec)

  1. src/go/parser/example_test.go

    import (
    	"fmt"
    	"go/parser"
    	"go/token"
    )
    
    func ExampleParseFile() {
    	fset := token.NewFileSet() // positions are relative to fset
    
    	src := `package foo
    
    import (
    	"fmt"
    	"time"
    )
    
    func bar() {
    	fmt.Println(time.Now())
    }`
    
    	// Parse src but stop after processing the imports.
    	f, err := parser.ParseFile(fset, "", src, parser.ImportsOnly)
    	if err != nil {
    		fmt.Println(err)
    		return
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 03 16:07:09 UTC 2017
    - 715 bytes
    - Viewed (0)
  2. src/go/format/example_test.go

    	node, err := parser.ParseExpr(expr)
    	if err != nil {
    		log.Fatal(err)
    	}
    
    	// Create a FileSet for node. Since the node does not come
    	// from a real source file, fset will be empty.
    	fset := token.NewFileSet()
    
    	var buf bytes.Buffer
    	err = format.Node(&buf, fset, node)
    	if err != nil {
    		log.Fatal(err)
    	}
    
    	fmt.Println(buf.String())
    
    	// Output: (6 + 2*3) / 4
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 19 17:49:53 UTC 2018
    - 753 bytes
    - Viewed (0)
  3. src/go/types/lookup_test.go

    	// Choose an arbitrary, large package.
    	path := filepath.Join(runtime.GOROOT(), "src", "net", "http")
    
    	fset := token.NewFileSet()
    	files, err := pkgFiles(fset, path)
    	if err != nil {
    		b.Fatal(err)
    	}
    
    	conf := Config{
    		Importer: importer.Default(),
    	}
    
    	pkg, err := conf.Check("http", fset, files, nil)
    	if err != nil {
    		b.Fatal(err)
    	}
    
    	scope := pkg.Scope()
    	names := scope.Names()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 13 15:31:43 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  4. src/go/ast/filter_test.go

    func (t2) f1() {}
    
    func (x *t2) f2() {}
    `
    
    func TestFilterDuplicates(t *testing.T) {
    	// parse input
    	fset := token.NewFileSet()
    	file, err := parser.ParseFile(fset, "", input, 0)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	// create package
    	files := map[string]*ast.File{"": file}
    	pkg, err := ast.NewPackage(fset, files, nil, nil)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	// filter
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 15:35:30 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  5. src/go/importer/importer.go

    // Deprecated: If lookup is nil, for backwards-compatibility, the importer
    // will attempt to resolve imports in the $GOPATH workspace.
    func ForCompiler(fset *token.FileSet, compiler string, lookup Lookup) types.Importer {
    	switch compiler {
    	case "gc":
    		return &gcimports{
    			fset:     fset,
    			packages: make(map[string]*types.Package),
    			lookup:   lookup,
    		}
    
    	case "gccgo":
    		var inst gccgoimporter.GccgoInstallation
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  6. src/go/ast/commentmap.go

    func NewCommentMap(fset *token.FileSet, node Node, comments []*CommentGroup) CommentMap {
    	if len(comments) == 0 {
    		return nil // no comments to map
    	}
    
    	cmap := make(CommentMap)
    
    	// set up comment reader r
    	tmp := make([]*CommentGroup, len(comments))
    	copy(tmp, comments) // don't change incoming comments
    	sortComments(tmp)
    	r := commentListReader{fset: fset, list: tmp} // !r.eol() because len(comments) > 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  7. src/crypto/internal/nistec/p256_asm_s390x.s

    	VPDI $0x4, Z1H, Z1H, Z1H
    	VL   64(P1ptr), Z1L
    	VPDI $0x4, Z1L, Z1L, Z1L
    
    	VLREPG sel+32(FP), SEL1
    	VZERO  ZER
    	VCEQG  SEL1, ZER, SEL1
    
    	VSEL X1L, X3L, SEL1, X3L
    	VSEL X1H, X3H, SEL1, X3H
    	VSEL Y1L, Y3L, SEL1, Y3L
    	VSEL Y1H, Y3H, SEL1, Y3H
    	VSEL Z1L, Z3L, SEL1, Z3L
    	VSEL Z1H, Z3H, SEL1, Z3H
    
    	//	if (zero == 0) {
    	//		copy(P3.x[:], X2)
    	//		copy(P3.y[:], Y2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:29:44 UTC 2024
    - 55.4K bytes
    - Viewed (0)
  8. src/go/token/example_test.go

    		// The absolute position is the exact position in the source.
    		pos := decl.Pos()
    		relPosition := fset.Position(pos)
    		absPosition := fset.PositionFor(pos, false)
    
    		// Either a FuncDecl or GenDecl, since we exit on error.
    		kind := "func"
    		if gen, ok := decl.(*ast.GenDecl); ok {
    			kind = gen.Tok.String()
    		}
    
    		// If the relative and absolute positions differ, show both.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 22:09:31 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  9. src/go/parser/performance_test.go

    func BenchmarkResolve(b *testing.B) {
    	b.SetBytes(int64(len(src)))
    	for i := 0; i < b.N; i++ {
    		b.StopTimer()
    		fset := token.NewFileSet()
    		file, err := ParseFile(fset, "", src, SkipObjectResolution)
    		if err != nil {
    			b.Fatalf("benchmark failed due to parse error: %s", err)
    		}
    		b.StartTimer()
    		handle := fset.File(file.Package)
    		resolveFile(file, handle, nil)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 01 22:35:46 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  10. src/cmd/fix/main.go

    		return err
    	}
    
    	file, err := parser.ParseFile(fset, filename, src, parserMode)
    	if err != nil {
    		return err
    	}
    
    	// Make sure file is in canonical format.
    	// This "fmt" pseudo-fix cannot be disabled.
    	newSrc, err := gofmtFile(file)
    	if err != nil {
    		return err
    	}
    	if !bytes.Equal(newSrc, src) {
    		newFile, err := parser.ParseFile(fset, filename, newSrc, parserMode)
    		if err != nil {
    			return err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 5.4K bytes
    - Viewed (0)
Back to top