Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for TILDE (0.03 sec)

  1. src/go/parser/parser.go

    		x = t
    	}
    	return x
    }
    
    func (p *parser) embeddedTerm() ast.Expr {
    	if p.trace {
    		defer un(trace(p, "EmbeddedTerm"))
    	}
    	if p.tok == token.TILDE {
    		t := new(ast.UnaryExpr)
    		t.OpPos = p.pos
    		t.Op = token.TILDE
    		p.next()
    		t.X = p.parseType()
    		return t
    	}
    
    	t := p.tryIdentOrType()
    	if t == nil {
    		pos := p.pos
    		p.errorExpected(pos, "~ term or type")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/parser.go

    }
    
    // EmbeddedTerm = [ "~" ] Type .
    func (p *parser) embeddedTerm() Expr {
    	if trace {
    		defer p.trace("embeddedTerm")()
    	}
    
    	if p.tok == _Operator && p.op == Tilde {
    		t := new(Operation)
    		t.pos = p.pos()
    		t.Op = Tilde
    		p.next()
    		t.X = p.type_()
    		return t
    	}
    
    	t := p.typeOrNil()
    	if t == nil {
    		t = p.badExpr()
    		p.syntaxError("expected ~ term or type")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  3. src/go/types/expr.go

    			x.mode = invalid
    			return
    		}
    
    		x.mode = commaok
    		x.typ = ch.elem
    		check.hasCallOrRecv = true
    		return
    
    	case token.TILDE:
    		// Provide a better error position and message than what check.op below would do.
    		if !allInteger(x.typ) {
    			check.error(e, UndefinedOp, "cannot use ~ outside of interface or type constraint")
    			x.mode = invalid
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/expr.go

    			x.mode = invalid
    			return
    		}
    		x.mode = commaok
    		x.typ = ch.elem
    		check.hasCallOrRecv = true
    		return
    
    	case syntax.Tilde:
    		// Provide a better error position and message than what check.op below would do.
    		if !allInteger(x.typ) {
    			check.error(e, UndefinedOp, "cannot use ~ outside of interface or type constraint")
    			x.mode = invalid
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 51.7K bytes
    - Viewed (0)
  5. src/go/printer/nodes.go

    func isTypeElem(x ast.Expr) bool {
    	switch x := x.(type) {
    	case *ast.ArrayType, *ast.StructType, *ast.FuncType, *ast.InterfaceType, *ast.MapType, *ast.ChanType:
    		return true
    	case *ast.UnaryExpr:
    		return x.Op == token.TILDE
    	case *ast.BinaryExpr:
    		return isTypeElem(x.X) || isTypeElem(x.Y)
    	case *ast.ParenExpr:
    		return isTypeElem(x.X)
    	}
    	return false
    }
    
    func (p *printer) signature(sig *ast.FuncType) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
Back to top