Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 228 for Positions (0.29 sec)

  1. src/cmd/compile/internal/syntax/positions.go

    			return n.Pos()
    		}
    	}
    }
    
    // EndPos returns the approximate end position of n in the source.
    // For some nodes (*Name, *BasicLit) it returns the position immediately
    // following the node; for others (*BlockStmt, *SwitchStmt, etc.) it
    // returns the position of the closing '}'; and for some (*ParenExpr)
    // the returned position is the end position of the last enclosed
    // expression.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  2. src/cmd/internal/src/xpos.go

    // This file implements the compressed encoding of source
    // positions using a lookup table.
    
    package src
    
    // XPos is a more compact representation of Pos.
    type XPos struct {
    	index int32
    	lico
    }
    
    // NoXPos is a valid unknown position.
    var NoXPos XPos
    
    // IsKnown reports whether the position p is known.
    // XPos.IsKnown() matches Pos.IsKnown() for corresponding
    // positions.
    func (p XPos) IsKnown() bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 01 15:52:41 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  3. src/go/internal/gcimporter/support.go

    func (s *fakeFileSet) pos(file string, line, column int) token.Pos {
    	// TODO(mdempsky): Make use of column.
    
    	// Since we don't know the set of needed file positions, we reserve
    	// maxlines positions per file. We delay calling token.File.SetLines until
    	// all positions have been calculated (by way of fakeFileSet.setLines), so
    	// that we can avoid setting unnecessary lines. See also golang/go#46586.
    	f := s.files[file]
    	if f == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  4. 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)
  5. src/go/token/example_test.go

    	for _, decl := range f.Decls {
    		// Get the filename, line, and column back via the file set.
    		// We get both the relative and absolute position.
    		// The relative position is relative to the last line directive.
    		// 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"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 22:09:31 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/util.go

    package types2
    
    import (
    	"cmd/compile/internal/syntax"
    	"go/constant"
    	"go/token"
    )
    
    const isTypes2 = true
    
    // cmpPos compares the positions p and q and returns a result r as follows:
    //
    // r <  0: p is before q
    // r == 0: p and q are the same position (but may not be identical)
    // r >  0: p is after q
    //
    // If p and q are in different files, p is before q if the filename
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/internal/typesinternal/types.go

    	*(*bool)(addr) = true
    
    	return true
    }
    
    // ReadGo116ErrorData extracts additional information from types.Error values
    // generated by Go version 1.16 and later: the error code, start position, and
    // end position. If all positions are valid, start <= err.Pos <= end.
    //
    // If the data could not be read, the final result parameter will be false.
    func ReadGo116ErrorData(err types.Error) (code ErrorCode, start, end token.Pos, ok bool) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  8. src/go/types/util.go

    // to be shared.
    
    package types
    
    import (
    	"go/ast"
    	"go/constant"
    	"go/token"
    )
    
    const isTypes2 = false
    
    // cmpPos compares the positions p and q and returns a result r as follows:
    //
    // r <  0: p is before q
    // r == 0: p and q are the same position (but may not be identical)
    // r >  0: p is after q
    //
    // If p and q are in different files, p is before q if the filename
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  9. test/fixedbugs/issue22662b.go

    // license that can be found in the LICENSE file.
    
    // Verify the impact of line directives on error positions and position formatting.
    
    package main
    
    import (
    	"io/ioutil"
    	"log"
    	"os"
    	"os/exec"
    	"strings"
    )
    
    // Each of these tests is expected to fail (missing package clause)
    // at the position determined by the preceding line directive.
    var tests = []struct {
    	src, pos string
    }{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/ssa/lca.go

    	blocks []lcaRangeBlock
    
    	// Data structure for range minimum queries.
    	// rangeMin[k][i] contains the ID of the minimum depth block
    	// in the Euler tour from positions i to i+1<<k-1, inclusive.
    	rangeMin [][]ID
    }
    
    type lcaRangeBlock struct {
    	b          *Block
    	parent     ID    // parent in dominator tree.  0 = no parent (entry or unreachable)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 30 21:52:15 UTC 2023
    - 3.8K bytes
    - Viewed (0)
Back to top