Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for declStmt (0.2 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/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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. src/cmd/compile/internal/syntax/nodes.go

    		List   []Stmt
    		Rbrace Pos
    		stmt
    	}
    
    	ExprStmt struct {
    		X Expr
    		simpleStmt
    	}
    
    	SendStmt struct {
    		Chan, Value Expr // Chan <- Value
    		simpleStmt
    	}
    
    	DeclStmt struct {
    		DeclList []Decl
    		stmt
    	}
    
    	AssignStmt struct {
    		Op       Operator // 0 means no operation
    		Lhs, Rhs Expr     // Rhs == nil means Lhs++ (Op == Add) or Lhs-- (Op == Sub)
    		simpleStmt
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:38 UTC 2023
    - 9K bytes
    - Viewed (0)
Back to top