Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 852 for positioner (0.32 sec)

  1. src/go/scanner/example_test.go

    	// src is the input that we want to tokenize.
    	src := []byte("cos(x) + 1i*sin(x) // Euler")
    
    	// Initialize the scanner.
    	var s scanner.Scanner
    	fset := token.NewFileSet()                      // positions are relative to fset
    	file := fset.AddFile("", fset.Base(), len(src)) // register input "file"
    	s.Init(file, src, nil /* no error handler */, scanner.ScanComments)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 27 19:47:49 UTC 2022
    - 1K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/build/relnote/relnote.go

    }
    
    // addLines adds n lines to the position of b.
    // n can be negative.
    func addLines(b md.Block, n int) {
    	pos := position(b)
    	pos.StartLine += n
    	pos.EndLine += n
    }
    
    func position(b md.Block) *md.Position {
    	switch b := b.(type) {
    	case *md.Heading:
    		return &b.Position
    	case *md.Text:
    		return &b.Position
    	case *md.CodeBlock:
    		return &b.Position
    	case *md.HTMLBlock:
    		return &b.Position
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  3. src/index/suffixarray/sais2.go

    	// By scanning backward, we can keep track of whether the current
    	// position is type-S or type-L according to the usual definition:
    	//
    	//	- position len(text) is type S with text[len(text)] == -1 (the sentinel)
    	//	- position i is type S if text[i] < text[i+1], or if text[i] == text[i+1] && i+1 is type S.
    	//	- position i is type L if text[i] > text[i+1], or if text[i] == text[i+1] && i+1 is type L.
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 18 23:57:18 UTC 2024
    - 52.3K bytes
    - Viewed (0)
  4. src/go/internal/gcimporter/exportdata.go

    		err = fmt.Errorf("invalid archive header")
    		return
    	}
    	name = strings.TrimSpace(string(hdr[:16]))
    	return
    }
    
    // FindExportData positions the reader r at the beginning of the
    // export data section of an underlying GC-created object/archive
    // file by reading from it. The reader must be positioned at the
    // start of the file before calling this function. The hdr result
    // is the string before the export data, either "$$" or "$$B".
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 19 15:49:05 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  5. src/go/importer/importer_test.go

    			t.Fatal(err)
    		}
    		if pkg.Path() != thePackage {
    			t.Fatalf("Path() = %q, want %q", pkg.Path(), thePackage)
    		}
    
    		// Check that the fileset positions are accurate.
    		// https://github.com/golang/go#28995
    		mathBigInt := pkg.Scope().Lookup("Int")
    		posn := fset.Position(mathBigInt.Pos()) // "$GOROOT/src/math/big/int.go:25:1"
    		filename := strings.Replace(posn.Filename, "$GOROOT", testenv.GOROOT(t), 1)
    		data, err := os.ReadFile(filename)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 25 21:16:32 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/example_test.go

    	// builtin len:
    	//   defined at <unknown position>
    	//   used at 6:15
    	// func fib(x int) int:
    	//   defined at fib:8:6
    	//   used at 12:20, 12:9
    	// type S string:
    	//   defined at fib:4:6
    	//   used at 6:23
    	// type int:
    	//   defined at <unknown position>
    	//   used at 8:12, 8:17
    	// type string:
    	//   defined at <unknown position>
    	//   used at 4:8
    	// var b S:
    	//   defined at fib:6:8
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 28 17:58:07 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  7. cmd/httprange.go

    		if offsetBeginString[0] == '+' {
    			return nil, fmt.Errorf("Byte position ('%s') must not have a sign", offsetBeginString)
    		} else if offsetBegin, err = strconv.ParseInt(offsetBeginString, 10, 64); err != nil {
    			return nil, fmt.Errorf("'%s' does not have a valid first byte position value", rangeString)
    		} else if offsetBegin < 0 {
    			return nil, fmt.Errorf("First byte position is negative ('%d')", offsetBegin)
    		}
    	}
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu May 09 08:44:07 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  8. src/go/printer/printer_test.go

    		i2 := <-i2range
    
    		if i2.Name != i1.Name {
    			t.Errorf("got ident %s; want %s", i2.Name, i1.Name)
    		}
    
    		// here we care about the relative (line-directive adjusted) positions
    		l1 := fset.Position(i1.Pos()).Line
    		l2 := fset.Position(i2.Pos()).Line
    		if l2 != l1 {
    			t.Errorf("got line %d; want %d for %s", l2, l1, i1.Name)
    		}
    	}
    
    	if t.Failed() {
    		t.Logf("\n%s", buf.Bytes())
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  9. src/cmd/cover/cover.go

    }
    
    // seenPos2 tracks whether we have seen a token.Position pair.
    var seenPos2 = make(map[pos2]bool)
    
    // dedup takes a token.Position pair and returns a pair that does not
    // duplicate any existing pair. The returned pair will have the Offset
    // fields cleared.
    func dedup(p1, p2 token.Position) (r1, r2 token.Position) {
    	key := pos2{
    		p1: p1,
    		p2: p2,
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 34.5K bytes
    - Viewed (0)
  10. src/go/ast/example_test.go

    func ExampleInspect() {
    	// src is the input for which we want to inspect the AST.
    	src := `
    package p
    const c = 1.0
    var X = f(3.14)*2 + c
    `
    
    	// Create the AST by parsing src.
    	fset := token.NewFileSet() // positions are relative to fset
    	f, err := parser.ParseFile(fset, "src.go", src, 0)
    	if err != nil {
    		panic(err)
    	}
    
    	// Inspect the AST and print all identifiers and literals.
    	ast.Inspect(f, func(n ast.Node) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:44:50 UTC 2024
    - 6.1K bytes
    - Viewed (0)
Back to top