Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 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/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)
  3. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    	case *ast.Comment:
    		// nop
    
    	case *ast.CommentGroup:
    		// nop
    
    	case *ast.CompositeLit:
    		children = append(children,
    			tok(n.Lbrace, len("{")),
    			tok(n.Rbrace, len("{")))
    
    	case *ast.DeclStmt:
    		// nop
    
    	case *ast.DeferStmt:
    		children = append(children,
    			tok(n.Defer, len("defer")))
    
    	case *ast.Ellipsis:
    		children = append(children,
    			tok(n.Ellipsis, len("...")))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/branches.go

    	// list even if there are trailing empty statements; remove them.
    	stmtList := trimTrailingEmptyStmts(body)
    	for stmtIndex, stmt := range stmtList {
    		lstmt = nil
    	L:
    		switch s := stmt.(type) {
    		case *DeclStmt:
    			for _, d := range s.DeclList {
    				if v, ok := d.(*VarDecl); ok {
    					recordVarDecl(v.Pos(), v.NameList[0])
    					break // the first VarDecl will do
    				}
    			}
    
    		case *LabeledStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Jun 26 00:21:29 UTC 2022
    - 9.8K bytes
    - Viewed (0)
  5. 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)
  6. src/cmd/vendor/golang.org/x/tools/go/cfg/builder.go

    	case *ast.ExprStmt:
    		b.add(s)
    		if call, ok := s.X.(*ast.CallExpr); ok && !b.mayReturn(call) {
    			// Calls to panic, os.Exit, etc, never return.
    			b.current = b.newBlock(KindUnreachable, s)
    		}
    
    	case *ast.DeclStmt:
    		// Treat each var ValueSpec as a separate statement.
    		d := s.Decl.(*ast.GenDecl)
    		if d.Tok == token.VAR {
    			for _, spec := range d.Specs {
    				if spec, ok := spec.(*ast.ValueSpec); ok {
    					b.add(spec)
    				}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  7. src/cmd/cgo/ast.go

    	case *ast.MapType:
    		f.walk(&n.Key, ctxType, visit)
    		f.walk(&n.Value, ctxType, visit)
    	case *ast.ChanType:
    		f.walk(&n.Value, ctxType, visit)
    
    	case *ast.BadStmt:
    	case *ast.DeclStmt:
    		f.walk(n.Decl, ctxDecl, visit)
    	case *ast.EmptyStmt:
    	case *ast.LabeledStmt:
    		f.walk(n.Stmt, ctxStmt, visit)
    	case *ast.ExprStmt:
    		f.walk(&n.X, ctxExpr, visit)
    	case *ast.SendStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 07 16:54:27 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go

    		a.apply(n, "Key", nil, n.Key)
    		a.apply(n, "Value", nil, n.Value)
    
    	case *ast.ChanType:
    		a.apply(n, "Value", nil, n.Value)
    
    	// Statements
    	case *ast.BadStmt:
    		// nothing to do
    
    	case *ast.DeclStmt:
    		a.apply(n, "Decl", nil, n.Decl)
    
    	case *ast.EmptyStmt:
    		// nothing to do
    
    	case *ast.LabeledStmt:
    		a.apply(n, "Label", nil, n.Label)
    		a.apply(n, "Stmt", nil, n.Stmt)
    
    	case *ast.ExprStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 12.2K bytes
    - Viewed (0)
  9. 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)
  10. src/cmd/fix/fix.go

    	case *ast.MapType:
    		walkBeforeAfter(&n.Key, before, after)
    		walkBeforeAfter(&n.Value, before, after)
    	case *ast.ChanType:
    		walkBeforeAfter(&n.Value, before, after)
    
    	case *ast.BadStmt:
    	case *ast.DeclStmt:
    		walkBeforeAfter(&n.Decl, before, after)
    	case *ast.EmptyStmt:
    	case *ast.LabeledStmt:
    		walkBeforeAfter(&n.Stmt, before, after)
    	case *ast.ExprStmt:
    		walkBeforeAfter(&n.X, before, after)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 14.6K bytes
    - Viewed (0)
Back to top