Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for RangeStmt (0.12 sec)

  1. src/go/printer/testdata/parser.go

    		}
    		if rhs, isUnary := as.Rhs[0].(*ast.UnaryExpr); isUnary && rhs.Op == token.RANGE {
    			// rhs is range expression
    			// (any short variable declaration was handled by parseSimpleStat above)
    			return &ast.RangeStmt{pos, key, value, as.TokPos, as.Tok, rhs.X, body}
    		}
    		p.errorExpected(s2.Pos(), "range clause")
    		return &ast.BadStmt{pos, body.End()}
    	}
    
    	// regular for statement
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  2. src/go/printer/nodes.go

    			p.print(token.RBRACE)
    		} else {
    			p.block(body, 0)
    		}
    
    	case *ast.ForStmt:
    		p.print(token.FOR)
    		p.controlClause(true, s.Init, s.Cond, s.Post)
    		p.block(s.Body, 1)
    
    	case *ast.RangeStmt:
    		p.print(token.FOR, blank)
    		if s.Key != nil {
    			p.expr(s.Key)
    			if s.Value != nil {
    				// use position of value following the comma as
    				// comma position for correct comment placement
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
  3. src/go/parser/parser.go

    		}
    		// parseSimpleStmt returned a right-hand side that
    		// is a single unary expression of the form "range x"
    		x := as.Rhs[0].(*ast.UnaryExpr).X
    		return &ast.RangeStmt{
    			For:    pos,
    			Key:    key,
    			Value:  value,
    			TokPos: as.TokPos,
    			Tok:    as.Tok,
    			Range:  as.Rhs[0].Pos(),
    			X:      x,
    			Body:   body,
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  4. src/go/types/api_test.go

    			case *ast.TypeSwitchStmt:
    				kind = "type switch"
    			case *ast.CaseClause:
    				kind = "case"
    			case *ast.CommClause:
    				kind = "comm"
    			case *ast.ForStmt:
    				kind = "for"
    			case *ast.RangeStmt:
    				kind = "range"
    			}
    
    			// look for matching scope description
    			desc := kind + ":" + strings.Join(scope.Names(), " ")
    			found := false
    			for _, d := range test.scopes {
    				if desc == d {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 94.2K bytes
    - Viewed (0)
Back to top