Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ConstDecl (0.15 sec)

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

    	pkg := check.pkg
    
    	first := -1                // index of first ConstDecl in the current group, or -1
    	var last *syntax.ConstDecl // last ConstDecl with init expressions, or nil
    	for index, decl := range list {
    		if _, ok := decl.(*syntax.ConstDecl); !ok {
    			first = -1 // we're not in a constant declaration
    		}
    
    		switch s := decl.(type) {
    		case *syntax.ConstDecl:
    			top := len(check.delayed)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
  2. src/go/types/decl.go

    	importDecl struct{ spec *ast.ImportSpec }
    	constDecl  struct {
    		spec      *ast.ValueSpec
    		iota      int
    		typ       ast.Expr
    		init      []ast.Expr
    		inherited bool
    	}
    	varDecl  struct{ spec *ast.ValueSpec }
    	typeDecl struct{ spec *ast.TypeSpec }
    	funcDecl struct{ decl *ast.FuncDecl }
    )
    
    func (d importDecl) node() ast.Node { return d.spec }
    func (d constDecl) node() ast.Node  { return d.spec }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31K bytes
    - Viewed (0)
  3. src/go/types/resolver.go

    					}
    				} else {
    					// declare imported package object in file scope
    					// (no need to provide s.Name since we called check.recordDef earlier)
    					check.declare(fileScope, nil, pkgName, nopos)
    				}
    			case constDecl:
    				// declare all constants
    				for i, name := range d.spec.Names {
    					obj := NewConst(name.Pos(), pkg, name.Name, nil, constant.MakeInt64(int64(d.iota)))
    
    					var init ast.Expr
    					if i < len(d.init) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 16:22:59 UTC 2024
    - 26.1K bytes
    - Viewed (0)
Back to top