aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/parse/parse.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/text/template/parse/parse.go')
-rw-r--r--src/text/template/parse/parse.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/text/template/parse/parse.go b/src/text/template/parse/parse.go
index b0cbe9dfc8..ce548b0886 100644
--- a/src/text/template/parse/parse.go
+++ b/src/text/template/parse/parse.go
@@ -415,8 +415,8 @@ func (t *Tree) action() (n Node) {
// {{break}}
// Break keyword is past.
func (t *Tree) breakControl(pos Pos, line int) Node {
- if token := t.next(); token.typ != itemRightDelim {
- t.unexpected(token, "in {{break}}")
+ if token := t.nextNonSpace(); token.typ != itemRightDelim {
+ t.unexpected(token, "{{break}}")
}
if t.rangeDepth == 0 {
t.errorf("{{break}} outside {{range}}")
@@ -428,8 +428,8 @@ func (t *Tree) breakControl(pos Pos, line int) Node {
// {{continue}}
// Continue keyword is past.
func (t *Tree) continueControl(pos Pos, line int) Node {
- if token := t.next(); token.typ != itemRightDelim {
- t.unexpected(token, "in {{continue}}")
+ if token := t.nextNonSpace(); token.typ != itemRightDelim {
+ t.unexpected(token, "{{continue}}")
}
if t.rangeDepth == 0 {
t.errorf("{{continue}} outside {{range}}")