- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 36 for RangeStmt (0.13 sec)
-
src/go/parser/parser_test.go
{name: "forrange1", format: "package main; func main() { «for x = range z { «» }» }", scope: true, scopeMultiplier: 2}, // Scopes: RangeStmt, BlockStmt {name: "forrange2", format: "package main; func main() { «for x, y = range z { «» }» }", scope: true, scopeMultiplier: 2}, // Scopes: RangeStmt, BlockStmt
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 31 20:26:14 UTC 2024 - 24.6K bytes - Viewed (0) -
src/go/ast/ast.go
Init Stmt // initialization statement; or nil Cond Expr // condition; or nil Post Stmt // post iteration statement; or nil Body *BlockStmt } // A RangeStmt represents a for statement with a range clause. RangeStmt struct { For token.Pos // position of "for" keyword Key, Value Expr // Key, Value may be nil TokPos token.Pos // position of Tok; invalid if Key == nil
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 28 21:32:41 UTC 2024 - 35.6K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go
case *ast.MapType: children = append(children, tok(n.Map, len("map"))) case *ast.ParenExpr: children = append(children, tok(n.Lparen, len("(")), tok(n.Rparen, len(")"))) case *ast.RangeStmt: children = append(children, tok(n.For, len("for")), tok(n.TokPos, len(n.Tok.String()))) case *ast.ReturnStmt: children = append(children, tok(n.Return, len("return")))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 15.9K bytes - Viewed (0) -
src/cmd/compile/internal/walk/stmt.go
case ir.OSELECT: n := n.(*ir.SelectStmt) walkSelect(n) return n case ir.OSWITCH: n := n.(*ir.SwitchStmt) walkSwitch(n) return n case ir.ORANGE: n := n.(*ir.RangeStmt) return walkRange(n) } // No return! Each case must return (or panic), // to avoid confusion about what gets returned // in the presence of type assertions. } func walkStmtList(s []ir.Node) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 06 15:42:30 UTC 2023 - 4.7K bytes - Viewed (0) -
src/go/types/stmt.go
check.use(s.Lhs...) // avoid follow-up errors } check.stmt(inner, s.Body) case *ast.RangeStmt: inner |= breakOk | continueOk check.rangeStmt(inner, s) default: check.error(s, InvalidSyntaxTree, "invalid statement") } } func (check *Checker) rangeStmt(inner stmtContext, s *ast.RangeStmt) { // Convert go/ast form to local variables. type Expr = ast.Expr type identType = ast.Ident
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 30.6K bytes - Viewed (0) -
src/cmd/compile/internal/reflectdata/helpers.go
} // RangeMapRType asserts that n is a "range" loop over a map value, // and returns an expression that yields the *runtime._type value // representing that map type. func RangeMapRType(pos src.XPos, n *ir.RangeStmt) ir.Node { assertOp(n, ir.ORANGE) if hasRType(n, n.RType, "RType") { return n.RType } return mapRType(pos, n.X.Type()) } // UnsafeSliceElemRType asserts that n is an "unsafe.Slice" operation,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 12 04:50:32 UTC 2023 - 7.1K bytes - Viewed (0) -
src/go/ast/walk.go
case *ForStmt: if n.Init != nil { Walk(v, n.Init) } if n.Cond != nil { Walk(v, n.Cond) } if n.Post != nil { Walk(v, n.Post) } Walk(v, n.Body) case *RangeStmt: if n.Key != nil { Walk(v, n.Key) } if n.Value != nil { Walk(v, n.Value) } Walk(v, n.X) Walk(v, n.Body) // Declarations case *ImportSpec: if n.Doc != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 16 16:34:10 UTC 2024 - 6.4K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/stmt.go
"cmd/internal/src" "internal/types/errors" ) func RangeExprType(t *types.Type) *types.Type { if t.IsPtr() && t.Elem().IsArray() { return t.Elem() } return t } func typecheckrangeExpr(n *ir.RangeStmt) { } // type check assignment. // if this assignment is the definition of a var on the left side, // fill in the var's type. func tcAssign(n *ir.AssignStmt) { if base.EnableTrace && base.Flag.LowerT {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Nov 20 15:10:54 UTC 2023 - 17.8K bytes - Viewed (0) -
src/cmd/cover/cover.go
if found { return pos } found, pos = hasFuncLiteral(s.Post) if found { return pos } return s.Body.Lbrace case *ast.LabeledStmt: return f.statementBoundary(s.Stmt) case *ast.RangeStmt: found, pos := hasFuncLiteral(s.X) if found { return pos } return s.Body.Lbrace case *ast.SwitchStmt: found, pos := hasFuncLiteral(s.Init) if found { return pos }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 14 19:41:17 UTC 2024 - 34.5K bytes - Viewed (0) -
src/cmd/compile/internal/types2/stmt.go
check.stmtList(inner, clause.Body) check.closeScope() } case *syntax.ForStmt: inner |= breakOk | continueOk if rclause, _ := s.Init.(*syntax.RangeClause); rclause != nil { check.rangeStmt(inner, s, rclause) break } check.openScope(s, "for") defer check.closeScope() check.simpleStmt(s.Init) if s.Cond != nil { var x operand check.expr(nil, &x, s.Cond)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 30.7K bytes - Viewed (0)