Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 446 for endPos (0.11 sec)

  1. src/cmd/fix/fix.go

    	if insertAt > 0 {
    		// Assign same position as the previous import,
    		// so that the sorter sees it as being in the same block.
    		prev := impDecl.Specs[insertAt-1]
    		newImport.Path.ValuePos = prev.Pos()
    		newImport.EndPos = prev.Pos()
    	}
    
    	f.Imports = append(f.Imports, newImport)
    	return true
    }
    
    // deleteImport deletes the import path from the file f, if present.
    func deleteImport(f *ast.File, path string) (deleted bool) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 14.6K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go

    			pos = impDecl.Specs[insertAt-1].Pos()
    		}
    	}
    	if newImport.Name != nil {
    		newImport.Name.NamePos = pos
    	}
    	newImport.Path.ValuePos = pos
    	newImport.EndPos = pos
    
    	// Clean up parens. impDecl contains at least one spec.
    	if len(impDecl.Specs) == 1 {
    		// Remove unneeded parens.
    		impDecl.Lparen = token.NoPos
    	} else if !impDecl.Lparen.IsValid() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 10 21:56:21 UTC 2022
    - 13.4K bytes
    - Viewed (0)
  3. src/go/ast/import.go

    	}
    	specs = deduped
    
    	// Fix up comment positions
    	for i, s := range specs {
    		s := s.(*ImportSpec)
    		if s.Name != nil {
    			s.Name.NamePos = pos[i].Start
    		}
    		s.Path.ValuePos = pos[i].Start
    		s.EndPos = pos[i].End
    		for _, g := range importComments[s] {
    			for _, c := range g.cg.List {
    				if g.left {
    					c.Slash = pos[i].Start - 1
    				} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/labels.go

    	. "internal/types/errors"
    )
    
    // labels checks correct label use in body.
    func (check *Checker) labels(body *syntax.BlockStmt) {
    	// set of all labels in this body
    	all := NewScope(nil, body.Pos(), syntax.EndPos(body), "label")
    
    	fwdJumps := check.blockBranches(all, nil, nil, body.List)
    
    	// If there are any forward jumps left, no label was found for
    	// the corresponding goto statements. Either those labels were
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/decl.go

    			// inside a function begins at the end of the ConstSpec or VarSpec
    			// (ShortVarDecl for short variable declarations) and ends at the
    			// end of the innermost containing block."
    			scopePos := syntax.EndPos(s)
    			for i, name := range s.NameList {
    				check.declare(check.scope, name, lhs[i], scopePos)
    			}
    
    		case *syntax.VarDecl:
    			top := len(check.delayed)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
  6. src/archive/tar/writer.go

    func (sw *sparseFileWriter) Write(b []byte) (n int, err error) {
    	overwrite := int64(len(b)) > sw.logicalRemaining()
    	if overwrite {
    		b = b[:sw.logicalRemaining()]
    	}
    
    	b0 := b
    	endPos := sw.pos + int64(len(b))
    	for endPos > sw.pos && err == nil {
    		var nf int // Bytes written in fragment
    		dataStart, dataEnd := sw.sp[0].Offset, sw.sp[0].endOffset()
    		if sw.pos < dataStart { // In a hole fragment
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.6K bytes
    - Viewed (0)
  7. src/regexp/regexp.go

    	searchPos := 0    // position where we next look for a match
    	var buf []byte
    	var endPos int
    	if bsrc != nil {
    		endPos = len(bsrc)
    	} else {
    		endPos = len(src)
    	}
    	if nmatch > re.prog.NumCap {
    		nmatch = re.prog.NumCap
    	}
    
    	var dstCap [2]int
    	for searchPos <= endPos {
    		a := re.doExecute(nil, bsrc, src, searchPos, nmatch, dstCap[:0])
    		if len(a) == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:50:01 UTC 2024
    - 38.5K bytes
    - Viewed (0)
  8. src/go/ast/ast.go

    	}
    	return s.Path.Pos()
    }
    func (s *ValueSpec) Pos() token.Pos { return s.Names[0].Pos() }
    func (s *TypeSpec) Pos() token.Pos  { return s.Name.Pos() }
    
    func (s *ImportSpec) End() token.Pos {
    	if s.EndPos != 0 {
    		return s.EndPos
    	}
    	return s.Path.End()
    }
    
    func (s *ValueSpec) End() token.Pos {
    	if n := len(s.Values); n > 0 {
    		return s.Values[n-1].End()
    	}
    	if s.Type != nil {
    		return s.Type.End()
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/signature.go

    	// scopePos, there should be no need for scope squashing.
    	// Audit to ensure all lookups honor scopePos and simplify.
    	scope := NewScope(check.scope, nopos, nopos, "function body (temp. scope)")
    	scopePos := syntax.EndPos(ftyp) // all parameters' scopes start after the signature
    	var recvList []*Var             // TODO(gri) remove the need for making a list here
    	if recvPar != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:33:05 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  10. src/archive/tar/reader.go

    }
    
    func (sr *sparseFileReader) Read(b []byte) (n int, err error) {
    	finished := int64(len(b)) >= sr.logicalRemaining()
    	if finished {
    		b = b[:sr.logicalRemaining()]
    	}
    
    	b0 := b
    	endPos := sr.pos + int64(len(b))
    	for endPos > sr.pos && err == nil {
    		var nf int // Bytes read in fragment
    		holeStart, holeEnd := sr.sp[0].Offset, sr.sp[0].endOffset()
    		if sr.pos < holeStart { // In a data fragment
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 01:59:14 UTC 2024
    - 26.8K bytes
    - Viewed (0)
Back to top