Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 732 for positioner (0.16 sec)

  1. src/go/types/infer.go

    // type parameter. Otherwise the result is nil. Errors are reported through the err parameter.
    // Note: infer may fail (return nil) due to invalid args operands without reporting additional errors.
    func (check *Checker) infer(posn positioner, tparams []*TypeParam, targs []Type, params *Tuple, args []*operand, reverse bool, err *error_) (inferred []Type) {
    	// Don't verify result conditions if there's no error handler installed:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 13:54:20 UTC 2024
    - 26.5K bytes
    - Viewed (0)
  2. src/go/types/decl.go

    	var x operand
    	if init != nil {
    		if inherited {
    			// The initialization expression is inherited from a previous
    			// constant declaration, and (error) positions refer to that
    			// expression and not the current constant declaration. Use
    			// the constant identifier position for any errors during
    			// init expression evaluation since that is all we have
    			// (see issues go.dev/issue/42991, go.dev/issue/42992).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31K bytes
    - Viewed (0)
  3. src/go/token/position.go

    func (s *FileSet) PositionFor(p Pos, adjusted bool) (pos Position) {
    	if p != NoPos {
    		if f := s.file(p); f != nil {
    			return f.position(p, adjusted)
    		}
    	}
    	return
    }
    
    // Position converts a [Pos] p in the fileset into a Position value.
    // Calling s.Position(p) is equivalent to calling s.PositionFor(p, true).
    func (s *FileSet) Position(p Pos) (pos Position) {
    	return s.PositionFor(p, true)
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  4. src/go/types/expr.go

    		return
    	}
    
    	if !Identical(x.typ, y.typ) {
    		// only report an error if we have valid types
    		// (otherwise we had an error reported elsewhere already)
    		if isValid(x.typ) && isValid(y.typ) {
    			var posn positioner = x
    			if e != nil {
    				posn = e
    			}
    			if e != nil {
    				check.errorf(posn, MismatchedTypes, invalidOp+"%s (mismatched types %s and %s)", e, x.typ, y.typ)
    			} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  5. 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)
  6. src/cmd/internal/src/pos.go

    //
    // The position base is used to determine the "relative" position, that is the
    // filename and line number relative to the position base. If the base refers
    // to the current file, there is no difference between absolute and relative
    // positions. If it refers to a //line directive, a relative position is relative
    // to that directive. A position base in turn contains the position at which it
    // was introduced in the current file.
    type Pos struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 01 15:52:41 UTC 2023
    - 15.5K bytes
    - Viewed (0)
  7. src/go/token/position_test.go

    	f.SetLinesForContent(src)
    
    	// verify position info
    	for i, offs := range f.lines {
    		got1 := f.PositionFor(f.Pos(offs), false)
    		got2 := f.PositionFor(f.Pos(offs), true)
    		got3 := f.Position(f.Pos(offs))
    		want := Position{filename, offs, i + 1, 1}
    		checkPos(t, "1. PositionFor unadjusted", got1, want)
    		checkPos(t, "1. PositionFor adjusted", got2, want)
    		checkPos(t, "1. Position", got3, want)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 31 20:26:14 UTC 2024
    - 14.3K bytes
    - Viewed (0)
  8. src/cmd/cgo/internal/testerrors/argposition_test.go

    		if fdecl, ok := decl.(*ast.FuncDecl); ok {
    			ast.Walk(&Visitor{expectation, fset, t}, fdecl.Body)
    		}
    	}
    	for ident, positions := range expectation {
    		for _, position := range positions {
    			if !position.Visited {
    				t.Errorf("Position %d:%d missed for %s ident", position.Line, position.Column, ident)
    			}
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 19 01:37:31 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  9. src/go/token/example_test.go

    		// 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)
  10. src/cmd/compile/internal/syntax/pos.go

    func (p position_) String() string {
    	if p.line == 0 {
    		if p.filename == "" {
    			return "<unknown position>"
    		}
    		return p.filename
    	}
    	if p.col == 0 {
    		return fmt.Sprintf("%s:%d", p.filename, p.line)
    	}
    	return fmt.Sprintf("%s:%d:%d", p.filename, p.line, p.col)
    }
    
    // A PosBase represents the base for relative position information:
    // At position pos, the relative position is filename:line:col.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 20:44:57 UTC 2024
    - 5.6K bytes
    - Viewed (0)
Back to top