Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for predeclaredFuncs (0.19 sec)

  1. src/cmd/compile/internal/types2/universe.go

    	_Recover
    
    	// package unsafe
    	_Add
    	_Alignof
    	_Offsetof
    	_Sizeof
    	_Slice
    	_SliceData
    	_String
    	_StringData
    
    	// testing support
    	_Assert
    	_Trace
    )
    
    var predeclaredFuncs = [...]struct {
    	name     string
    	nargs    int
    	variadic bool
    	kind     exprKind
    }{
    	_Append:  {"append", 1, true, expression},
    	_Cap:     {"cap", 1, false, expression},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  2. src/go/types/universe.go

    	_Recover
    
    	// package unsafe
    	_Add
    	_Alignof
    	_Offsetof
    	_Sizeof
    	_Slice
    	_SliceData
    	_String
    	_StringData
    
    	// testing support
    	_Assert
    	_Trace
    )
    
    var predeclaredFuncs = [...]struct {
    	name     string
    	nargs    int
    	variadic bool
    	kind     exprKind
    }{
    	_Append:  {"append", 1, true, expression},
    	_Cap:     {"cap", 1, false, expression},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  3. src/go/types/builtins.go

    func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ bool) {
    	argList := call.Args
    
    	// append is the only built-in that permits the use of ... for the last argument
    	bin := predeclaredFuncs[id]
    	if hasDots(call) && id != _Append {
    		check.errorf(dddErrPos(call),
    			InvalidDotDotDot,
    			invalidOp+"invalid use of ... with built-in %s", bin.name)
    		check.use(argList...)
    		return
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/builtins.go

    func (check *Checker) builtin(x *operand, call *syntax.CallExpr, id builtinId) (_ bool) {
    	argList := call.ArgList
    
    	// append is the only built-in that permits the use of ... for the last argument
    	bin := predeclaredFuncs[id]
    	if hasDots(call) && id != _Append {
    		check.errorf(dddErrPos(call),
    			InvalidDotDotDot,
    			invalidOp+"invalid use of ... with built-in %s", bin.name)
    		check.use(argList...)
    		return
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  5. src/go/types/operand.go

    			return "nil"
    		}
    	}
    
    	var buf bytes.Buffer
    
    	var expr string
    	if x.expr != nil {
    		expr = ExprString(x.expr)
    	} else {
    		switch x.mode {
    		case builtin:
    			expr = predeclaredFuncs[x.id].name
    		case typexpr:
    			expr = TypeString(x.typ, qf)
    		case constant_:
    			expr = x.val.String()
    		}
    	}
    
    	// <expr> (
    	if expr != "" {
    		buf.WriteString(expr)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 21:17:10 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/operand.go

    			return "nil"
    		}
    	}
    
    	var buf bytes.Buffer
    
    	var expr string
    	if x.expr != nil {
    		expr = ExprString(x.expr)
    	} else {
    		switch x.mode {
    		case builtin:
    			expr = predeclaredFuncs[x.id].name
    		case typexpr:
    			expr = TypeString(x.typ, qf)
    		case constant_:
    			expr = x.val.String()
    		}
    	}
    
    	// <expr> (
    	if expr != "" {
    		buf.WriteString(expr)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 21:17:10 UTC 2024
    - 11K bytes
    - Viewed (0)
  7. src/go/doc/reader.go

    // Predeclared identifiers
    
    // IsPredeclared reports whether s is a predeclared identifier.
    func IsPredeclared(s string) bool {
    	return predeclaredTypes[s] || predeclaredFuncs[s] || predeclaredConstants[s]
    }
    
    var predeclaredTypes = map[string]bool{
    	"any":        true,
    	"bool":       true,
    	"byte":       true,
    	"comparable": true,
    	"complex64":  true,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 27.5K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/object.go

    // A Builtin represents a built-in function.
    // Builtins don't have a valid type.
    type Builtin struct {
    	object
    	id builtinId
    }
    
    func newBuiltin(id builtinId) *Builtin {
    	return &Builtin{object{name: predeclaredFuncs[id].name, typ: Typ[Invalid], color_: black}, id}
    }
    
    // Nil represents the predeclared value nil.
    type Nil struct {
    	object
    }
    
    func writeObject(buf *bytes.Buffer, obj Object, qf Qualifier) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  9. src/go/doc/example.go

    	depDecls, unresolved := findDeclsAndUnresolved(body, topDecls, typMethods)
    
    	// Remove predeclared identifiers from unresolved list.
    	for n := range unresolved {
    		if predeclaredTypes[n] || predeclaredConstants[n] || predeclaredFuncs[n] {
    			delete(unresolved, n)
    		}
    	}
    
    	// Use unresolved identifiers to determine the imports used by this
    	// example. The heuristic assumes package names match base import
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 21.4K bytes
    - Viewed (0)
  10. src/go/types/object.go

    // A Builtin represents a built-in function.
    // Builtins don't have a valid type.
    type Builtin struct {
    	object
    	id builtinId
    }
    
    func newBuiltin(id builtinId) *Builtin {
    	return &Builtin{object{name: predeclaredFuncs[id].name, typ: Typ[Invalid], color_: black}, id}
    }
    
    // Nil represents the predeclared value nil.
    type Nil struct {
    	object
    }
    
    func writeObject(buf *bytes.Buffer, obj Object, qf Qualifier) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 20.1K bytes
    - Viewed (0)
Back to top