Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 732 for positioner (0.19 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. src/cmd/compile/internal/liveness/intervals.go

    	c.s[len(c.s)-1].st = pos
    	c.setLast(pos)
    	return nil
    }
    
    // Kill method should be invoked on instruction at position p if instr
    // should be treated as as having a kill (lifetime end) for the
    // resource. See the example in the comment at the beginning of this
    // file for an example. Note that if we see a kill at position K for a
    // resource currently live since J, this will result in a lifetime
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 29 21:55:27 UTC 2024
    - 10K bytes
    - Viewed (0)
  9. test/typeparam/issue58513.go

    // function literals to plumb sub-dictionaries appropriately.
    // However, when these expressions are inlined, we were constructing
    // the function literal bodies with the inline-adjusted positions
    // instead of the original (inline-free) positions, which could lead
    // to infinite loops when unwinding the stack.
    
    package main
    
    import "runtime"
    
    func assert[_ any]() {
    	panic(0)
    }
    
    func Assert[To any]() func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 27 23:07:49 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  10. src/go/ast/ast.go

    //
    // All nodes contain position information marking the beginning of
    // the corresponding source text segment; it is accessible via the
    // Pos accessor method. Nodes may contain additional position info
    // for language constructs where comments may be found between parts
    // of the construct (typically any larger, parenthesized subpart).
    // That position information is needed to properly position comments
    // when printing the construct.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
Back to top