Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for AssertExpr (0.14 sec)

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

    			}
    			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
    			}
    			return n.Pos()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/walk.go

    	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:
    		if n.Lhs != nil {
    			w.node(n.Lhs)
    		}
    		w.node(n.X)
    
    	case *Operation:
    		w.node(n.X)
    		if n.Y != nil {
    			w.node(n.Y)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:55:04 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/syntax/nodes_test.go

    	{"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`},
    	{"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)
  4. src/cmd/compile/internal/syntax/nodes.go

    		// TODO(mdempsky): This is only needed to report the "3-index
    		// slice of string" error when Index[2] is missing.
    		Full bool
    		expr
    	}
    
    	// X.(Type)
    	AssertExpr struct {
    		X    Expr
    		Type Expr
    		expr
    	}
    
    	// X.(type)
    	// Lhs := X.(type)
    	TypeSwitchGuard struct {
    		Lhs *Name // nil means no Lhs :=
    		X   Expr  // X.(type)
    		expr
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:38 UTC 2023
    - 9K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/expr.go

    		check.sliceExpr(x, e)
    		if x.mode == invalid {
    			goto Error
    		}
    
    	case *syntax.AssertExpr:
    		check.expr(nil, x, e.X)
    		if x.mode == invalid {
    			goto Error
    		}
    		// x.(type) expressions are encoded via TypeSwitchGuards
    		if e.Type == nil {
    			check.error(e, InvalidSyntaxTree, "invalid use of AssertExpr")
    			goto Error
    		}
    		if isTypeParam(x.typ) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 51.7K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/syntax/printer.go

    			p.printNode(i)
    		}
    		p.print(_Colon)
    		if j := n.Index[1]; j != nil {
    			p.printNode(j)
    		}
    		if k := n.Index[2]; k != nil {
    			p.print(_Colon, k)
    		}
    		p.print(_Rbrack)
    
    	case *AssertExpr:
    		p.print(n.X, _Dot, _Lparen, n.Type, _Rparen)
    
    	case *TypeSwitchGuard:
    		if n.Lhs != nil {
    			p.print(n.Lhs, blank, _Define, blank)
    		}
    		p.print(n.X, _Dot, _Lparen, _Type, _Rparen)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 07:17:27 UTC 2023
    - 21.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/syntax/parser.go

    				p.next()
    				if p.got(_Type) {
    					t := new(TypeSwitchGuard)
    					// t.Lhs is filled in by parser.simpleStmt
    					t.pos = pos
    					t.X = x
    					x = t
    				} else {
    					t := new(AssertExpr)
    					t.pos = pos
    					t.X = x
    					t.Type = p.type_()
    					x = t
    				}
    				p.want(_Rparen)
    
    			default:
    				p.syntaxError("expected name or (")
    				p.advance(_Semi, _Rparen)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
Back to top