- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 547 for Positions (0.2 sec)
-
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) -
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) -
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) -
src/go/token/position_test.go
f.AddLine(offs) f.AddLineInfo(offs, "bar", 42) } // verify positions for all offsets for offs := 0; offs <= f.Size(); offs++ { p := f.Pos(offs) _, col := linecol(lines, offs) msg := fmt.Sprintf("%s (offs = %d, p = %d)", f.Name(), offs, p) checkPos(t, msg, f.Position(f.Pos(offs)), Position{"bar", offs, 42, col}) checkPos(t, msg, fset.Position(p), Position{"bar", offs, 42, col}) } } func TestFiles(t *testing.T) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 31 20:26:14 UTC 2024 - 14.3K bytes - Viewed (0) -
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) -
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) -
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) -
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) -
src/go/ast/import.go
} // Sort the import specs by import path. // Remove duplicates, when possible without data loss. // Reassign the import paths to have the same position sequence. // Reassign each comment to the spec on the same line. // Sort the comments by new position. slices.SortFunc(specs, func(a, b Spec) int { ipath := importPath(a) jpath := importPath(b) r := cmp.Compare(ipath, jpath) if r != 0 { return r
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 5.7K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/diagnostic.go
// problem described by the diagnostic, each one representing // an alternative strategy; at most one may be applied. SuggestedFixes []SuggestedFix // Related contains optional secondary positions and messages // related to the primary diagnostic. Related []RelatedInformation } // RelatedInformation contains information related to a diagnostic.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 04 16:19:04 UTC 2024 - 2.6K bytes - Viewed (0)