Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 54 for setPos (0.17 sec)

  1. src/cmd/compile/internal/rangefunc/rewrite.go

    	return n
    }
    
    // setPos walks the top structure of x that has no position assigned
    // and assigns it all to have position pos.
    // When setPos encounters a syntax node with a position assigned,
    // setPos does not look inside that node.
    // setPos only needs to handle syntax we create in this package;
    // all other syntax should have positions assigned already.
    func setPos(x syntax.Node, pos syntax.Pos) {
    	if x == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:05:44 UTC 2024
    - 41.6K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/walk/complit.go

    	for _, r := range entries {
    		r := r.(*ir.KeyExpr)
    		index, elem := r.Key, r.Value
    
    		ir.SetPos(index)
    		appendWalkStmt(init, ir.NewAssignStmt(base.Pos, tmpkey, index))
    
    		ir.SetPos(elem)
    		appendWalkStmt(init, ir.NewAssignStmt(base.Pos, tmpelem, elem))
    
    		ir.SetPos(tmpelem)
    
    		// typechecker rewrites OINDEX to OINDEXMAP
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:03:54 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/typecheck/typecheck.go

    				}
    				if len(nl)-i > 1 {
    					goto toomany
    				}
    				n = nl[i]
    				ir.SetPos(n)
    				if n.Type() != nil {
    					nl[i] = assignconvfn(n, t, desc)
    				}
    				return
    			}
    
    			// TODO(mdempsky): Make into ... call with implicit slice.
    			for ; i < len(nl); i++ {
    				n = nl[i]
    				ir.SetPos(n)
    				if n.Type() != nil {
    					nl[i] = assignconvfn(n, t.Elem(), desc)
    				}
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 19:08:34 UTC 2024
    - 30.5K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/typecheck/expr.go

    			n.SetType(nil)
    			return n
    		}
    		n.SetType(t)
    		n.SetOp(ir.OSLICESTR)
    	} else if t.IsPtr() && t.Elem().IsArray() {
    		tp = t.Elem()
    		n.SetType(types.NewSlice(tp.Elem()))
    		types.CalcSize(n.Type())
    		if hasmax {
    			n.SetOp(ir.OSLICE3ARR)
    		} else {
    			n.SetOp(ir.OSLICEARR)
    		}
    	} else if t.IsSlice() {
    		n.SetType(t)
    	} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/staticinit/sched.go

    		return true // discard
    	}
    
    	// Only worry about simple "l = r" assignments. The OAS2*
    	// assignments mostly necessitate dynamic execution anyway.
    	if len(lhs) > 1 {
    		return false
    	}
    
    	lno := ir.SetPos(n)
    	defer func() { base.Pos = lno }()
    
    	nam := lhs[0].(*ir.Name)
    	return s.StaticAssign(nam, 0, rhs, nam.Type())
    }
    
    // like staticassign but we are copying an already
    // initialized value r.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 17:16:14 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/walk/switch.go

    		body.Append(ncase.Body...)
    		if fall, pos := endsInFallthrough(ncase.Body); !fall {
    			br := ir.NewBranchStmt(base.Pos, ir.OBREAK, nil)
    			br.SetPos(pos)
    			body.Append(br)
    		}
    	}
    	sw.Cases = nil
    
    	if defaultGoto == nil {
    		br := ir.NewBranchStmt(base.Pos, ir.OBREAK, nil)
    		br.SetPos(br.Pos().WithNotStmt())
    		defaultGoto = br
    	}
    
    	s.Emit(&sw.Compiled)
    	sw.Compiled.Append(defaultGoto)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  7. src/text/template/parse/node.go

    	return &IdentifierNode{NodeType: NodeIdentifier, Ident: ident}
    }
    
    // SetPos sets the position. [NewIdentifier] is a public method so we can't modify its signature.
    // Chained for convenience.
    // TODO: fix one day?
    func (i *IdentifierNode) SetPos(pos Pos) *IdentifierNode {
    	i.Pos = pos
    	return i
    }
    
    // SetTree sets the parent tree for the node. [NewIdentifier] is a public method so we can't modify its signature.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:57:51 UTC 2024
    - 24.2K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/walk/order.go

    			// buffer during conversion. String comparison does not
    			// memorize the strings for later use, so it is safe.
    			if n.X.Op() == ir.OBYTES2STR {
    				n.X.(*ir.ConvExpr).SetOp(ir.OBYTES2STRTMP)
    			}
    			if n.Y.Op() == ir.OBYTES2STR {
    				n.Y.(*ir.ConvExpr).SetOp(ir.OBYTES2STRTMP)
    			}
    
    		case t.IsStruct() || t.IsArray():
    			// for complex comparisons, we need both args to be
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 02:00:33 UTC 2024
    - 42.7K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/typecheck/stmt.go

    		r := rhs[0]
    
    		switch r.Op() {
    		case ir.OINDEXMAP:
    			stmt.SetOp(ir.OAS2MAPR)
    		case ir.ORECV:
    			stmt.SetOp(ir.OAS2RECV)
    		case ir.ODOTTYPE:
    			r := r.(*ir.TypeAssertExpr)
    			stmt.SetOp(ir.OAS2DOTTYPE)
    			r.SetOp(ir.ODOTTYPE2)
    		case ir.ODYNAMICDOTTYPE:
    			r := r.(*ir.DynamicTypeAssertExpr)
    			stmt.SetOp(ir.OAS2DOTTYPE)
    			r.SetOp(ir.ODYNAMICDOTTYPE2)
    		default:
    			break assignOK
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 20 15:10:54 UTC 2023
    - 17.8K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/walk/range.go

    	//	ha, hit: hidden aggregate, iterator
    	//	hn, hp: hidden len, pointer
    	//	hb: hidden bool
    	//	a, v1, v2: not hidden aggregate, val 1, 2
    
    	a := nrange.X
    	t := a.Type()
    	lno := ir.SetPos(a)
    
    	v1, v2 := nrange.Key, nrange.Value
    
    	if ir.IsBlank(v2) {
    		v2 = nil
    	}
    
    	if ir.IsBlank(v1) && v2 == nil {
    		v1 = nil
    	}
    
    	if v1 == nil && v2 != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:33 UTC 2023
    - 17.6K bytes
    - Viewed (0)
Back to top