Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 42 for BinaryExpr (0.4 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. analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirExpressionTypeProvider.kt

            // Given: `x = expression`
            // Expected type of `expression` is type of `x`
            val assignmentExpression =
                expression.unwrapQualified<KtBinaryExpression> { binaryExpr, expr -> binaryExpr.right == expr && binaryExpr.operationToken == KtTokens.EQ }
                    ?: return null
            val variableExpression = assignmentExpression.left as? KtNameReferenceExpression ?: return null
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Tue Jun 11 15:45:42 UTC 2024
    - 24.4K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/walk/expr.go

    		ir.OUNSAFEADD:
    		n := n.(*ir.BinaryExpr)
    		n.X = walkExpr(n.X, init)
    		n.Y = walkExpr(n.Y, init)
    		return n
    
    	case ir.OUNSAFESLICE:
    		n := n.(*ir.BinaryExpr)
    		return walkUnsafeSlice(n, init)
    
    	case ir.OUNSAFESTRING:
    		n := n.(*ir.BinaryExpr)
    		return walkUnsafeString(n, init)
    
    	case ir.OUNSAFESTRINGDATA, ir.OUNSAFESLICEDATA:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 27.6K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. src/cmd/compile/internal/typecheck/func.go

    	n.SetOp(ir.ORECOVERFP)
    	n.SetType(types.Types[types.TINTER])
    	n.Args = []ir.Node{Expr(fp)}
    	return n
    }
    
    // tcUnsafeAdd typechecks an OUNSAFEADD node.
    func tcUnsafeAdd(n *ir.BinaryExpr) *ir.BinaryExpr {
    	n.X = AssignConv(Expr(n.X), types.Types[types.TUNSAFEPTR], "argument to unsafe.Add")
    	n.Y = DefaultLit(Expr(n.Y), types.Types[types.TINT])
    	if n.X.Type() == nil || n.Y.Type() == nil {
    		n.SetType(nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 06 15:23:18 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    //	    <----B----->
    //
    // the ast.BinaryExpr(+) node is considered to enclose interval B
    // even though its [Pos()..End()) is actually only interval A.
    // This behaviour makes user interfaces more tolerant of imperfect
    // input.
    //
    // This function treats tokens as nodes, though they are not included
    // in the result. e.g. PathEnclosingInterval("+") returns the
    // enclosing ast.BinaryExpr("x + y").
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  10. src/go/parser/parser_test.go

    	// a valid arithmetic expression
    	src := "a + b"
    	x, err := ParseExpr(src)
    	if err != nil {
    		t.Errorf("ParseExpr(%q): %v", src, err)
    	}
    	// sanity check
    	if _, ok := x.(*ast.BinaryExpr); !ok {
    		t.Errorf("ParseExpr(%q): got %T, want *ast.BinaryExpr", src, x)
    	}
    
    	// a valid type expression
    	src = "struct{x *int}"
    	x, err = ParseExpr(src)
    	if err != nil {
    		t.Errorf("ParseExpr(%q): %v", src, err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 31 20:26:14 UTC 2024
    - 24.6K bytes
    - Viewed (0)
Back to top