]> Cypherpunks.ru repositories - gostls13.git/commit
html/template, text/template: implement break and continue for range loops
authorRuss Cox <rsc@golang.org>
Thu, 20 May 2021 16:46:33 +0000 (12:46 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 23 Sep 2021 02:52:10 +0000 (02:52 +0000)
commitd0dd26a88c019d54f22463daae81e785f5867565
tree95803033c564f840d9778568f7a0dd8f81c07774
parent93453233bd00cc641d2f959f1faf236e0094c2bf
html/template, text/template: implement break and continue for range loops

Break and continue for range loops was accepted as a proposal in June 2017.
It was implemented in CL 66410 (Oct 2017)
but then rolled back in CL 92155 (Feb 2018)
because html/template changes had not been implemented.

This CL reimplements break and continue in text/template
and then adds support for them in html/template as well.

Fixes #20531.

Change-Id: I05330482a976f1c078b4b49c2287bd9031bb7616
Reviewed-on: https://go-review.googlesource.com/c/go/+/321491
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
12 files changed:
src/html/template/context.go
src/html/template/escape.go
src/html/template/escape_test.go
src/html/template/exec_test.go
src/text/template/doc.go
src/text/template/exec.go
src/text/template/exec_test.go
src/text/template/parse/lex.go
src/text/template/parse/lex_test.go
src/text/template/parse/node.go
src/text/template/parse/parse.go
src/text/template/parse/parse_test.go