Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for callExpr (0.18 sec)

  1. src/go/printer/testdata/parser.go

    		p.next() // consume "++" or "--"
    		return s
    	}
    
    	// expression
    	return &ast.ExprStmt{x[0]}
    }
    
    func (p *parser) parseCallExpr() *ast.CallExpr {
    	x := p.parseRhs()
    	if call, isCall := x.(*ast.CallExpr); isCall {
    		return call
    	}
    	p.errorExpected(x.Pos(), "function/method call")
    	return nil
    }
    
    func (p *parser) parseGoStmt() ast.Stmt {
    	if p.trace {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  2. src/cmd/cgo/gcc.go

    			for _, r := range f.Ref {
    				if r.Expr == px {
    					*px = p.rewriteName(f, r, addPosition)
    					r.Done = true
    					break
    				}
    			}
    
    			return
    		}
    
    		call, ok := (*px).(*ast.CallExpr)
    		if !ok {
    			return
    		}
    
    		for _, c := range f.Calls {
    			if !c.Done && c.Call.Lparen == call.Lparen {
    				cstr, nu := p.rewriteCall(f, c)
    				if cstr != "" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 97K bytes
    - Viewed (0)
  3. src/go/parser/parser.go

    	return &ast.ExprStmt{X: x[0]}, false
    }
    
    func (p *parser) parseCallExpr(callType string) *ast.CallExpr {
    	x := p.parseRhs() // could be a conversion: (some type)(x)
    	if t := ast.Unparen(x); t != x {
    		p.error(x.Pos(), fmt.Sprintf("expression in %s must not be parenthesized", callType))
    		x = t
    	}
    	if call, isCall := x.(*ast.CallExpr); isCall {
    		return call
    	}
    	if _, isBad := x.(*ast.BadExpr); !isBad {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  4. src/go/types/expr.go

    			goto Error
    		}
    		T := check.varType(e.Type)
    		if !isValid(T) {
    			goto Error
    		}
    		check.typeAssertion(e, x, T, false)
    		x.mode = commaok
    		x.typ = T
    
    	case *ast.CallExpr:
    		return check.callExpr(x, e)
    
    	case *ast.StarExpr:
    		check.exprOrType(x, e.X, false)
    		switch x.mode {
    		case invalid:
    			goto Error
    		case typexpr:
    			check.validVarType(e.X, x.typ)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/expr.go

    		// x.(type) expressions are handled explicitly in type switches
    		check.error(e, InvalidSyntaxTree, "use of .(type) outside type switch")
    		check.use(e.X)
    		goto Error
    
    	case *syntax.CallExpr:
    		return check.callExpr(x, e)
    
    	case *syntax.ListExpr:
    		// catch-all for unexpected expression lists
    		check.error(e, InvalidSyntaxTree, "unexpected list of expressions")
    		goto Error
    
    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/parser.go

    			}
    		case Or:
    			if name, lhs := extractName(x.X, force || isTypeElem(x.Y)); name != nil && lhs != nil {
    				// x = name lhs|x.Y
    				op := *x
    				op.X = lhs
    				return name, &op
    			}
    		}
    	case *CallExpr:
    		if name, _ := x.Fun.(*Name); name != nil {
    			if len(x.ArgList) == 1 && !x.HasDots && (force || isTypeElem(x.ArgList[0])) {
    				// x = name "(" x.ArgList[0] ")"
    				return name, x.ArgList[0]
    			}
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/api_test.go

    	}
    	conf.Check("p", []*syntax.File{f}, info) // ignore result
    	for e, tv := range info.Types {
    		if _, ok := e.(*syntax.CallExpr); ok {
    			if tv.Type != Typ[Int16] {
    				t.Errorf("CallExpr has type %v, want int16", tv.Type)
    			}
    			return
    		}
    	}
    	t.Errorf("CallExpr has no type")
    }
    
    // TestCompositeLitTypes verifies that Info.Types registers the correct
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 93.3K bytes
    - Viewed (0)
  8. src/go/types/api_test.go

    	}
    	conf.Check("p", fset, []*ast.File{f}, info) // ignore result
    	for e, tv := range info.Types {
    		if _, ok := e.(*ast.CallExpr); ok {
    			if tv.Type != Typ[Int16] {
    				t.Errorf("CallExpr has type %v, want int16", tv.Type)
    			}
    			return
    		}
    	}
    	t.Errorf("CallExpr has no type")
    }
    
    // TestCompositeLitTypes verifies that Info.Types registers the correct
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 94.2K bytes
    - Viewed (0)
  9. src/go/printer/nodes.go

    				if x != nil && needsBlanks {
    					p.print(blank)
    				}
    			}
    			if x != nil {
    				p.expr0(x, depth+1)
    			}
    		}
    		p.setPos(x.Rbrack)
    		p.print(token.RBRACK)
    
    	case *ast.CallExpr:
    		if len(x.Args) > 1 {
    			depth++
    		}
    
    		// Conversions to literal function types or <-chan
    		// types require parentheses around the type.
    		paren := false
    		switch t := x.Fun.(type) {
    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