Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 32 for declStmt (0.47 sec)

  1. src/cmd/compile/internal/syntax/nodes_test.go

    	{"ExprStmt", `append@(s, 1, 2, 3)`},
    
    	{"SendStmt", `ch @<- x`},
    
    	{"DeclStmt", `@const x = 0`},
    	{"DeclStmt", `@const (x = 0)`},
    	{"DeclStmt", `@type T int`},
    	{"DeclStmt", `@type T = int`},
    	{"DeclStmt", `@type (T1 = int; T2 = float32)`},
    	{"DeclStmt", `@var x = 0`},
    	{"DeclStmt", `@var x, y, z int`},
    	{"DeclStmt", `@var (a, b = 1, 2)`},
    
    	{"AssignStmt", `x @= y`},
    	{"AssignStmt", `a, b, x @= 1, 2, 3`},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 18:45:06 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/return.go

    // If s is labeled, label is the label name; otherwise s
    // is "".
    func (check *Checker) isTerminating(s syntax.Stmt, label string) bool {
    	switch s := s.(type) {
    	default:
    		panic("unreachable")
    
    	case *syntax.DeclStmt, *syntax.EmptyStmt, *syntax.SendStmt,
    		*syntax.AssignStmt, *syntax.CallStmt:
    		// no chance
    
    	case *syntax.LabeledStmt:
    		return check.isTerminating(s.Stmt, s.Label.Value)
    
    	case *syntax.ExprStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  3. src/go/types/return.go

    // If s is labeled, label is the label name; otherwise s
    // is "".
    func (check *Checker) isTerminating(s ast.Stmt, label string) bool {
    	switch s := s.(type) {
    	default:
    		panic("unreachable")
    
    	case *ast.BadStmt, *ast.DeclStmt, *ast.EmptyStmt, *ast.SendStmt,
    		*ast.IncDecStmt, *ast.AssignStmt, *ast.GoStmt, *ast.DeferStmt,
    		*ast.RangeStmt:
    		// no chance
    
    	case *ast.LabeledStmt:
    		return check.isTerminating(s.Stmt, s.Label.Name)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unreachable/unreachable.go

    	switch x := stmt.(type) {
    	default:
    		log.Fatalf("%s: internal error in findLabels: unexpected statement %T", d.pass.Fset.Position(x.Pos()), x)
    
    	case *ast.AssignStmt,
    		*ast.BadStmt,
    		*ast.DeclStmt,
    		*ast.DeferStmt,
    		*ast.EmptyStmt,
    		*ast.ExprStmt,
    		*ast.GoStmt,
    		*ast.IncDecStmt,
    		*ast.ReturnStmt,
    		*ast.SendStmt:
    		// no statements inside
    
    	case *ast.BlockStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    		return 1 << nCommClause
    	case *ast.Comment:
    		return 1 << nComment
    	case *ast.CommentGroup:
    		return 1 << nCommentGroup
    	case *ast.CompositeLit:
    		return 1 << nCompositeLit
    	case *ast.DeclStmt:
    		return 1 << nDeclStmt
    	case *ast.DeferStmt:
    		return 1 << nDeferStmt
    	case *ast.Ellipsis:
    		return 1 << nEllipsis
    	case *ast.EmptyStmt:
    		return 1 << nEmptyStmt
    	case *ast.ExprStmt:
    		return 1 << nExprStmt
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  8. src/go/ast/ast.go

    	// syntax errors for which no correct statement nodes can be
    	// created.
    	//
    	BadStmt struct {
    		From, To token.Pos // position range of bad statement
    	}
    
    	// A DeclStmt node represents a declaration in a statement list.
    	DeclStmt struct {
    		Decl Decl // *GenDecl with CONST, TYPE, or VAR token
    	}
    
    	// An EmptyStmt node represents an empty statement.
    	// The "position" of the empty statement is the position
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top