Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for BinaryExpr (0.46 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/bools/bools.go

    func run(pass *analysis.Pass) (interface{}, error) {
    	inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
    
    	nodeFilter := []ast.Node{
    		(*ast.BinaryExpr)(nil),
    	}
    	seen := make(map[*ast.BinaryExpr]bool)
    	inspect.Preorder(nodeFilter, func(n ast.Node) {
    		e := n.(*ast.BinaryExpr)
    		if seen[e] {
    			// Already processed as a subexpression of an earlier node.
    			return
    		}
    
    		var op boolOp
    		switch e.Op {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/nilfunc/nilfunc.go

    }
    
    func run(pass *analysis.Pass) (interface{}, error) {
    	inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
    
    	nodeFilter := []ast.Node{
    		(*ast.BinaryExpr)(nil),
    	}
    	inspect.Preorder(nodeFilter, func(n ast.Node) {
    		e := n.(*ast.BinaryExpr)
    
    		// Only want == or != comparisons.
    		if e.Op != token.EQL && e.Op != token.NEQ {
    			return
    		}
    
    		// Only want comparisons with a nil identifier on one side.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/reflectdata/helpers.go

    // between expressions of interface and non-interface type, and
    // returns an expression that yields the *runtime._type value
    // representing the non-interface type.
    func CompareRType(pos src.XPos, n *ir.BinaryExpr) ir.Node {
    	assertOp2(n, ir.OEQ, ir.ONE)
    	base.AssertfAt(n.X.Type().IsInterface() != n.Y.Type().IsInterface(), n.Pos(), "expect mixed interface and non-interface, have %L and %L", n.X, n.Y)
    	if hasRType(n, n.RType, "RType") {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 04:50:32 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  4. src/cmd/internal/dwarf/putvarabbrevgen_test.go

    		return &ast.ReturnStmt{
    			Results: []ast.Expr{&ast.BinaryExpr{
    				Op: token.ADD,
    				X:  &ast.Ident{Name: "DW_ABRV_PUTVAR_START"},
    				Y:  &ast.BasicLit{Kind: token.INT, Value: strconv.Itoa(abbrevs[abbrev])}}}}
    	}
    	if pvacfg.attr != "" {
    		return pvacfgvisitnode(pvacfg.then, tag, append(path, pvacfg), abbrevs)
    	} else if pvacfg.cond != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:45:07 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/shift/shift.go

    		updateDead(pass.TypesInfo, dead, n)
    	})
    
    	nodeFilter = []ast.Node{
    		(*ast.AssignStmt)(nil),
    		(*ast.BinaryExpr)(nil),
    	}
    	inspect.Preorder(nodeFilter, func(node ast.Node) {
    		if dead[node] {
    			// Skip shift checks on unreachable nodes.
    			return
    		}
    
    		switch node := node.(type) {
    		case *ast.BinaryExpr:
    			if node.Op == token.SHL || node.Op == token.SHR {
    				checkLongShift(pass, node, node.X, node.Y)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go

    		// Base case: initial conversion from unsafe.Pointer to uintptr.
    		return len(x.Args) == 1 &&
    			hasBasicType(info, x.Fun, types.Uintptr) &&
    			hasBasicType(info, x.Args[0], types.UnsafePointer)
    
    	case *ast.BinaryExpr:
    		// "It is valid both to add and to subtract offsets from a
    		// pointer in this way. It is also valid to use &^ to round
    		// pointers, usually for alignment."
    		switch x.Op {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  7. src/go/types/exprstring.go

    		}
    		buf.WriteByte(')')
    
    	case *ast.StarExpr:
    		buf.WriteByte('*')
    		WriteExpr(buf, x.X)
    
    	case *ast.UnaryExpr:
    		buf.WriteString(x.Op.String())
    		WriteExpr(buf, x.X)
    
    	case *ast.BinaryExpr:
    		WriteExpr(buf, x.X)
    		buf.WriteByte(' ')
    		buf.WriteString(x.Op.String())
    		buf.WriteByte(' ')
    		WriteExpr(buf, x.Y)
    
    	case *ast.ArrayType:
    		buf.WriteByte('[')
    		if x.Len != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 08 19:31:44 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    	case *ast.BadDecl:
    		return 1 << nBadDecl
    	case *ast.BadExpr:
    		return 1 << nBadExpr
    	case *ast.BadStmt:
    		return 1 << nBadStmt
    	case *ast.BasicLit:
    		return 1 << nBasicLit
    	case *ast.BinaryExpr:
    		return 1 << nBinaryExpr
    	case *ast.BlockStmt:
    		return 1 << nBlockStmt
    	case *ast.BranchStmt:
    		return 1 << nBranchStmt
    	case *ast.CallExpr:
    		return 1 << nCallExpr
    	case *ast.CaseClause:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  9. src/go/ast/walk.go

    			Walk(v, n.Type)
    		}
    
    	case *CallExpr:
    		Walk(v, n.Fun)
    		walkList(v, n.Args)
    
    	case *StarExpr:
    		Walk(v, n.X)
    
    	case *UnaryExpr:
    		Walk(v, n.X)
    
    	case *BinaryExpr:
    		Walk(v, n.X)
    		Walk(v, n.Y)
    
    	case *KeyValueExpr:
    		Walk(v, n.Key)
    		Walk(v, n.Value)
    
    	// Types
    	case *ArrayType:
    		if n.Len != nil {
    			Walk(v, n.Len)
    		}
    		Walk(v, n.Elt)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  10. src/go/types/union.go

    // extracting both the binary exprs (blist) and leaf types (tlist).
    func flattenUnion(list []ast.Expr, x ast.Expr) (blist, tlist []ast.Expr) {
    	if o, _ := x.(*ast.BinaryExpr); o != nil && o.Op == token.OR {
    		blist, tlist = flattenUnion(list, o.X)
    		blist = append(blist, o)
    		x = o.Y
    	}
    	return blist, append(tlist, x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 6.2K bytes
    - Viewed (0)
Back to top