Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 36 for LabeledStmt (0.47 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go

    	// 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:
    		a.apply(n, "X", nil, n.X)
    
    	case *ast.SendStmt:
    		a.apply(n, "Chan", nil, n.Chan)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 12.2K bytes
    - Viewed (0)
  2. src/cmd/fix/fix.go

    	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)
    	case *ast.SendStmt:
    		walkBeforeAfter(&n.Chan, before, after)
    		walkBeforeAfter(&n.Value, 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)
  3. src/go/parser/resolver.go

    			} else {
    				ast.Walk(r, e)
    			}
    		}
    
    	case *ast.InterfaceType:
    		r.openScope(n.Pos())
    		defer r.closeScope()
    		r.walkFieldList(n.Methods, ast.Fun)
    
    	// Statements
    	case *ast.LabeledStmt:
    		r.declare(n, nil, r.labelScope, ast.Lbl, n.Label)
    		ast.Walk(r, n.Stmt)
    
    	case *ast.AssignStmt:
    		r.walkExprs(n.Rhs)
    		if n.Tok == token.DEFINE {
    			r.shortVarDecl(n)
    		} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 12:56:53 UTC 2023
    - 15.8K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/parser.go

    	a.pos = pos
    	a.Op = op
    	a.Lhs = lhs
    	a.Rhs = rhs
    	return a
    }
    
    func (p *parser) labeledStmtOrNil(label *Name) Stmt {
    	if trace {
    		defer p.trace("labeledStmt")()
    	}
    
    	s := new(LabeledStmt)
    	s.pos = p.pos()
    	s.Label = label
    
    	p.want(_Colon)
    
    	if p.tok == _Rbrace {
    		// We expect a statement (incl. an empty statement), which must be
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/rangefunc/rewrite.go

    		case *syntax.CaseClause:
    			for i, s := range n.Body {
    				n.Body[i] = r.editStmt(s)
    			}
    		case *syntax.CommClause:
    			for i, s := range n.Body {
    				n.Body[i] = r.editStmt(s)
    			}
    		case *syntax.LabeledStmt:
    			n.Stmt = r.editStmt(n.Stmt)
    		}
    
    		// Pop n.
    		if len(r.forStack) > 0 && r.stack[len(r.stack)-1] == r.forStack[len(r.forStack)-1].nfor {
    			r.endLoop(r.forStack[len(r.forStack)-1])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:05:44 UTC 2024
    - 41.6K bytes
    - Viewed (0)
  6. src/go/printer/testdata/parser.go

    			// Go spec: The scope of a label is the body of the function
    			// in which it is declared and excludes the body of any nested
    			// function.
    			stmt := &ast.LabeledStmt{label, colon, p.parseStmt()}
    			p.declare(stmt, p.labelScope, ast.Lbl, label)
    			return stmt
    		}
    		p.error(x[0].Pos(), "illegal label declaration")
    		return &ast.BadStmt{x[0].Pos(), colon + 1}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/syntax/printer.go

    			p.print(_Rparen)
    		} else {
    			p.print(n.Elem)
    		}
    
    	// statements
    	case *DeclStmt:
    		p.printDecl(n.DeclList)
    
    	case *EmptyStmt:
    		// nothing to print
    
    	case *LabeledStmt:
    		p.print(outdent, n.Label, _Colon, indent, newline, n.Stmt)
    
    	case *ExprStmt:
    		p.print(n.X)
    
    	case *SendStmt:
    		p.print(n.Chan, blank, _Arrow, blank, n.Value)
    
    	case *AssignStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 07:17:27 UTC 2023
    - 21.5K bytes
    - Viewed (0)
  8. src/go/parser/parser_test.go

    		}
    
    		var pos, end token.Pos
    		ast.Inspect(f, func(x ast.Node) bool {
    			switch s := x.(type) {
    			case *ast.BlockStmt:
    				pos, end = s.Pos()+1, s.End()-1 // exclude "{", "}"
    			case *ast.LabeledStmt:
    				pos, end = s.Pos()+2, s.End() // exclude "L:"
    			case *ast.EmptyStmt:
    				// check containment
    				if s.Pos() < pos || s.End() > end {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 31 20:26:14 UTC 2024
    - 24.6K bytes
    - Viewed (0)
  9. 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,
    		// function and method calls and receive operations can appear
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  10. src/go/printer/nodes.go

    			// labeled statements put labels on a separate line, but here
    			// we only care about the start line of the actual statement
    			// without label - correct line for each label
    			for t := s; ; {
    				lt, _ := t.(*ast.LabeledStmt)
    				if lt == nil {
    					break
    				}
    				line++
    				t = lt.Stmt
    			}
    			i++
    		}
    	}
    	if nindent > 0 {
    		p.print(unindent)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
Back to top