Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for TokPos (0.29 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/parser.go

    		// is a single unary expression of the form "range x"
    		x := as.Rhs[0].(*ast.UnaryExpr).X
    		return &ast.RangeStmt{
    			For:    pos,
    			Key:    key,
    			Value:  value,
    			TokPos: as.TokPos,
    			Tok:    as.Tok,
    			Range:  as.Rhs[0].Pos(),
    			X:      x,
    			Body:   body,
    		}
    	}
    
    	// regular for statement
    	return &ast.ForStmt{
    		For:  pos,
    		Init: s1,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  8. 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)
  9. src/go/printer/nodes.go

    		const depth = 1
    		p.expr0(s.X, depth+1)
    		p.setPos(s.TokPos)
    		p.print(s.Tok)
    
    	case *ast.AssignStmt:
    		var depth = 1
    		if len(s.Lhs) > 1 && len(s.Rhs) > 1 {
    			depth++
    		}
    		p.exprList(s.Pos(), s.Lhs, depth, 0, s.TokPos, false)
    		p.print(blank)
    		p.setPos(s.TokPos)
    		p.print(s.Tok, blank)
    		p.exprList(s.TokPos, s.Rhs, depth, 0, token.NoPos, false)
    
    	case *ast.GoStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
  10. 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