Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 33 for SliceExpr (0.18 sec)

  1. src/cmd/compile/internal/syntax/nodes_test.go

    	{"KeyValueExpr", `"a"@: b`},
    
    	{"FuncLit", `@func (){}`},
    	{"ParenExpr", `@(x)`},
    	{"SelectorExpr", `a@.b`},
    	{"IndexExpr", `a@[i]`},
    
    	{"SliceExpr", `a@[:]`},
    	{"SliceExpr", `a@[i:]`},
    	{"SliceExpr", `a@[:j]`},
    	{"SliceExpr", `a@[i:j]`},
    	{"SliceExpr", `a@[i:j:k]`},
    
    	{"AssertExpr", `x@.(T)`},
    
    	{"Operation", `@*b`},
    	{"Operation", `@+b`},
    	{"Operation", `@-b`},
    	{"Operation", `@!b`},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 18:45:06 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/positions.go

    				continue
    			}
    			return n.Pos()
    		case *KeyValueExpr:
    			m = n.Key
    		// case *FuncLit:
    		// case *ParenExpr:
    		case *SelectorExpr:
    			m = n.X
    		case *IndexExpr:
    			m = n.X
    		// case *SliceExpr:
    		case *AssertExpr:
    			m = n.X
    		case *TypeSwitchGuard:
    			if n.Lhs != nil {
    				m = n.Lhs
    				continue
    			}
    			m = n.X
    		case *Operation:
    			if n.Y != nil {
    				m = n.X
    				continue
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  3. src/go/types/exprstring.go

    	case *ast.IndexExpr, *ast.IndexListExpr:
    		ix := typeparams.UnpackIndexExpr(x)
    		WriteExpr(buf, ix.X)
    		buf.WriteByte('[')
    		writeExprList(buf, ix.Indices)
    		buf.WriteByte(']')
    
    	case *ast.SliceExpr:
    		WriteExpr(buf, x.X)
    		buf.WriteByte('[')
    		if x.Low != nil {
    			WriteExpr(buf, x.Low)
    		}
    		buf.WriteByte(':')
    		if x.High != nil {
    			WriteExpr(buf, x.High)
    		}
    		if x.Slice3 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 08 19:31:44 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    		return 1 << nReturnStmt
    	case *ast.SelectStmt:
    		return 1 << nSelectStmt
    	case *ast.SelectorExpr:
    		return 1 << nSelectorExpr
    	case *ast.SendStmt:
    		return 1 << nSendStmt
    	case *ast.SliceExpr:
    		return 1 << nSliceExpr
    	case *ast.StarExpr:
    		return 1 << nStarExpr
    	case *ast.StructType:
    		return 1 << nStructType
    	case *ast.SwitchStmt:
    		return 1 << nSwitchStmt
    	case *ast.TypeAssertExpr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  5. src/go/ast/ast.go

    		X       Expr      // expression
    		Lbrack  token.Pos // position of "["
    		Indices []Expr    // index expressions
    		Rbrack  token.Pos // position of "]"
    	}
    
    	// A SliceExpr node represents an expression followed by slice indices.
    	SliceExpr struct {
    		X      Expr      // expression
    		Lbrack token.Pos // position of "["
    		Low    Expr      // begin of slice range; or nil
    		High   Expr      // end of slice range; or nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  6. src/go/types/index.go

    	// a valid type.
    	if x.typ == nil {
    		x.typ = Typ[Invalid]
    	}
    
    	check.index(index, length)
    	return false
    }
    
    func (check *Checker) sliceExpr(x *operand, e *ast.SliceExpr) {
    	check.expr(nil, x, e.X)
    	if x.mode == invalid {
    		check.use(e.Low, e.High, e.Max)
    		return
    	}
    
    	valid := false
    	length := int64(-1) // valid if >= 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:17:05 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  7. src/cmd/gofmt/simplify.go

    					}
    					x = t.Value
    					px = &t.Value
    				}
    				s.simplifyLiteral(typ, eltType, x, px)
    			}
    			// node was simplified - stop walk (there are no subnodes to simplify)
    			return nil
    		}
    
    	case *ast.SliceExpr:
    		// a slice expression of the form: s[a:len(s)]
    		// can be simplified to: s[a:]
    		// if s is "simple enough" (for now we only accept identifiers)
    		//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 19 20:06:14 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/index.go

    	// a valid type.
    	if x.typ == nil {
    		x.typ = Typ[Invalid]
    	}
    
    	check.index(index, length)
    	return false
    }
    
    func (check *Checker) sliceExpr(x *operand, e *syntax.SliceExpr) {
    	check.expr(nil, x, e.X)
    	if x.mode == invalid {
    		check.use(e.Index[:]...)
    		return
    	}
    
    	valid := false
    	length := int64(-1) // valid if >= 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 15 16:16:58 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    		children = append(children,
    			tok(n.Select, len("select")))
    
    	case *ast.SelectorExpr:
    		// nop
    
    	case *ast.SendStmt:
    		children = append(children,
    			tok(n.Arrow, len("<-")))
    
    	case *ast.SliceExpr:
    		children = append(children,
    			tok(n.Lbrack, len("[")),
    			tok(n.Rbrack, len("]")))
    
    	case *ast.StarExpr:
    		children = append(children, tok(n.Star, len("*")))
    
    	case *ast.StructType:
    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/cmd/compile/internal/syntax/walk.go

    		w.node(n.Body)
    
    	case *ParenExpr:
    		w.node(n.X)
    
    	case *SelectorExpr:
    		w.node(n.X)
    		w.node(n.Sel)
    
    	case *IndexExpr:
    		w.node(n.X)
    		w.node(n.Index)
    
    	case *SliceExpr:
    		w.node(n.X)
    		for _, x := range n.Index {
    			if x != nil {
    				w.node(x)
    			}
    		}
    
    	case *AssertExpr:
    		w.node(n.X)
    		w.node(n.Type)
    
    	case *TypeSwitchGuard:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:55:04 UTC 2023
    - 5.7K bytes
    - Viewed (0)
Back to top