Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for TokPos (0.84 sec)

  1. src/text/scanner/scanner.go

    // Valid after calling [Scanner.Scan] and in calls of [Scanner.Error].
    func (s *Scanner) TokenText() string {
    	if s.tokPos < 0 {
    		// no token text
    		return ""
    	}
    
    	if s.tokEnd < s.tokPos {
    		// if EOF was reached, s.tokEnd is set to -1 (s.srcPos == 0)
    		s.tokEnd = s.tokPos
    	}
    	// s.tokEnd >= s.tokPos
    
    	if s.tokBuf.Len() == 0 {
    		// common case: the entire token text is still in srcBuf
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:57:51 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go

    				if spec.Doc != nil {
    					for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Doc.Pos()).Line {
    						fset.File(gen.TokPos).MergeLine(fset.Position(gen.TokPos).Line)
    					}
    				}
    				for _, cg := range f.Comments {
    					if cg.End() < spec.Pos() && fset.Position(cg.End()).Line == fset.Position(spec.Pos()).Line {
    						for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Pos()).Line {
    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/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    	switch n := n.(type) {
    	case *ast.ArrayType:
    		children = append(children,
    			tok(n.Lbrack, len("[")),
    			tok(n.Elt.End(), len("]")))
    
    	case *ast.AssignStmt:
    		children = append(children,
    			tok(n.TokPos, len(n.Tok.String())))
    
    	case *ast.BasicLit:
    		children = append(children,
    			tok(n.ValuePos, len(n.Value)))
    
    	case *ast.BinaryExpr:
    		children = append(children, tok(n.OpPos, len(n.Op.String())))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  4. src/go/ast/ast.go

    	IncDecStmt struct {
    		X      Expr
    		TokPos token.Pos   // position of Tok
    		Tok    token.Token // INC or DEC
    	}
    
    	// An AssignStmt node represents an assignment or
    	// a short variable declaration.
    	//
    	AssignStmt struct {
    		Lhs    []Expr
    		TokPos token.Pos   // position of Tok
    		Tok    token.Token // assignment token, DEFINE
    		Rhs    []Expr
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  5. src/cmd/go/internal/modindex/read.go

    func (sf *sourceFile) embedsOffset() int {
    	pos := sf.importsOffset()
    	n := sf.d.intAt(pos)
    	// each import is 5 uint32s (string + tokpos)
    	return pos + 4 + n*(4*5)
    }
    
    func (sf *sourceFile) directivesOffset() int {
    	pos := sf.embedsOffset()
    	n := sf.d.intAt(pos)
    	// each embed is 5 uint32s (string + tokpos)
    	return pos + 4 + n*(4*5)
    }
    
    func (sf *sourceFile) imports() []rawImport {
    	sf.onceReadImports.Do(func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 14:34:32 UTC 2024
    - 29.7K bytes
    - Viewed (0)
  6. src/go/types/stmt.go

    				return
    			}
    			if s.Tok == token.DEFINE {
    				check.shortVarDecl(inNode(s, s.TokPos), s.Lhs, s.Rhs)
    			} else {
    				// regular assignment
    				check.assignVars(s.Lhs, s.Rhs)
    			}
    
    		default:
    			// assignment operations
    			if len(s.Lhs) != 1 || len(s.Rhs) != 1 {
    				check.errorf(inNode(s, s.TokPos), MultiValAssignOp, "assignment operation %s requires single-valued expressions", s.Tok)
    				return
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  7. src/go/parser/resolver.go

    				// token for the RHS OpPos. That information is not contained within
    				// the AST.
    				as := &ast.AssignStmt{
    					Lhs:    lhs,
    					Tok:    token.DEFINE,
    					TokPos: n.TokPos,
    					Rhs:    []ast.Expr{&ast.UnaryExpr{Op: token.RANGE, X: n.X}},
    				}
    				// TODO(rFindley): this walkLHS reproduced the parser resolution, but
    				// is it necessary? By comparison, for a normal AssignStmt we don't
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 12:56:53 UTC 2023
    - 15.8K bytes
    - Viewed (0)
  8. src/go/doc/reader.go

    						fake := &ast.GenDecl{
    							Doc: d.Doc,
    							// don't use the existing TokPos because it
    							// will lead to the wrong selection range for
    							// the fake declaration if there are more
    							// than one type in the group (this affects
    							// src/cmd/godoc/godoc.go's posLink_urlFunc)
    							TokPos: s.Pos(),
    							Tok:    token.TYPE,
    							Specs:  []ast.Spec{s},
    						}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 27.5K bytes
    - Viewed (0)
Back to top