Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for declStmt (0.12 sec)

  1. src/cmd/compile/internal/rangefunc/rewrite.go

    }
    
    // declVar declares a variable with a given name type and initializer value.
    func (r *rewriter) declVar(name string, typ types2.Type, init syntax.Expr) *types2.Var {
    	if r.declStmt == nil {
    		r.declStmt = &syntax.DeclStmt{}
    	}
    	stmt := r.declStmt
    	obj, n := r.makeVarName(stmt.Pos(), name, typ)
    	stmt.DeclList = append(stmt.DeclList, &syntax.VarDecl{
    		NameList: []*syntax.Name{n},
    		// Note: Type is ignored
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:05:44 UTC 2024
    - 41.6K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/positions.go

    		// case *MapType:
    		// case *ChanType:
    
    		// statements
    		// case *EmptyStmt:
    		// case *LabeledStmt:
    		// case *BlockStmt:
    		// case *ExprStmt:
    		case *SendStmt:
    			m = n.Chan
    		// case *DeclStmt:
    		case *AssignStmt:
    			m = n.Lhs
    		// case *BranchStmt:
    		// case *CallStmt:
    		// case *ReturnStmt:
    		// case *IfStmt:
    		// case *ForStmt:
    		// case *SwitchStmt:
    		// case *SelectStmt:
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  3. src/go/types/labels.go

    		fwdJumps = append(fwdJumps, check.blockBranches(all, b, lstmt, list)...)
    	}
    
    	var stmtBranches func(ast.Stmt)
    	stmtBranches = func(s ast.Stmt) {
    		switch s := s.(type) {
    		case *ast.DeclStmt:
    			if d, _ := s.Decl.(*ast.GenDecl); d != nil && d.Tok == token.VAR {
    				recordVarDecl(d.Pos())
    			}
    
    		case *ast.LabeledStmt:
    			// declare non-blank label
    			if name := s.Label.Name; name != "_" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  4. src/go/ast/walk.go

    		Walk(v, n.Methods)
    
    	case *MapType:
    		Walk(v, n.Key)
    		Walk(v, n.Value)
    
    	case *ChanType:
    		Walk(v, n.Value)
    
    	// Statements
    	case *BadStmt:
    		// nothing to do
    
    	case *DeclStmt:
    		Walk(v, n.Decl)
    
    	case *EmptyStmt:
    		// nothing to do
    
    	case *LabeledStmt:
    		Walk(v, n.Label)
    		Walk(v, n.Stmt)
    
    	case *ExprStmt:
    		Walk(v, n.X)
    
    	case *SendStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/labels.go

    				if jmp == bad {
    					return true
    				}
    			}
    		}
    		return false
    	}
    
    	var stmtBranches func(syntax.Stmt)
    	stmtBranches = func(s syntax.Stmt) {
    		switch s := s.(type) {
    		case *syntax.DeclStmt:
    			for _, d := range s.DeclList {
    				if d, _ := d.(*syntax.VarDecl); d != nil {
    					recordVarDecl(d.Pos())
    				}
    			}
    
    		case *syntax.LabeledStmt:
    			// declare non-blank label
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/syntax/parser.go

    			return s
    		}
    	}
    
    	s.List = p.stmtList()
    	s.Rbrace = p.pos()
    	p.want(_Rbrace)
    
    	return s
    }
    
    func (p *parser) declStmt(f func(*Group) Decl) *DeclStmt {
    	if trace {
    		defer p.trace("declStmt")()
    	}
    
    	s := new(DeclStmt)
    	s.pos = p.pos()
    
    	p.next() // _Const, _Type, or _Var
    	s.DeclList = p.appendGroup(nil, f)
    
    	return s
    }
    
    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/go/types/stmt.go

    	inner := ctxt &^ (fallthroughOk | finalSwitchCase | inTypeSwitch)
    
    	switch s := s.(type) {
    	case *ast.BadStmt, *ast.EmptyStmt:
    		// ignore
    
    	case *ast.DeclStmt:
    		check.declStmt(s.Decl)
    
    	case *ast.LabeledStmt:
    		check.hasLabel = true
    		check.stmt(ctxt, s.Stmt)
    
    	case *ast.ExprStmt:
    		// spec: "With the exception of specific built-in functions,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/stmt.go

    	// reset context for statements of inner blocks
    	inner := ctxt &^ (fallthroughOk | finalSwitchCase | inTypeSwitch)
    
    	switch s := s.(type) {
    	case *syntax.EmptyStmt:
    		// ignore
    
    	case *syntax.DeclStmt:
    		check.declStmt(s.DeclList)
    
    	case *syntax.LabeledStmt:
    		check.hasLabel = true
    		check.stmt(ctxt, s.Stmt)
    
    	case *syntax.ExprStmt:
    		// spec: "With the exception of specific built-in functions,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/decl.go

    	if !check.conf.IgnoreFuncBodies && fdecl.Body != nil {
    		check.later(func() {
    			check.funcBody(decl, obj.name, sig, fdecl.Body, nil)
    		}).describef(obj, "func %s", obj.name)
    	}
    }
    
    func (check *Checker) declStmt(list []syntax.Decl) {
    	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
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
  10. src/go/types/decl.go

    	if !check.conf.IgnoreFuncBodies && fdecl.Body != nil {
    		check.later(func() {
    			check.funcBody(decl, obj.name, sig, fdecl.Body, nil)
    		}).describef(obj, "func %s", obj.name)
    	}
    }
    
    func (check *Checker) declStmt(d ast.Decl) {
    	pkg := check.pkg
    
    	check.walkDecl(d, func(d decl) {
    		switch d := d.(type) {
    		case constDecl:
    			top := len(check.delayed)
    
    			// declare all constants
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31K bytes
    - Viewed (0)
Back to top