]> Cypherpunks repositories - gostls13.git/commit
text/template: fix a couple of parse bugs around identifiers.
authorRob Pike <r@golang.org>
Tue, 13 Mar 2012 20:03:11 +0000 (07:03 +1100)
committerRob Pike <r@golang.org>
Tue, 13 Mar 2012 20:03:11 +0000 (07:03 +1100)
commit8170d81f4f12db0c5d40bb550639026ee850fe25
treebdf9c864bccd4e34e1c677fb8b56c5dfb841718d
parent5361712ab4f582fda6c098a45d270278b7907404
text/template: fix a couple of parse bugs around identifiers.
1) Poor error checking in variable declarations admitted
$x=2 or even $x%2.
2) Need white space or suitable termination character
after identifiers, so $x+2 doesn't parse, in case we want it
to mean something one day.
Number 2 in particular prevents mistakes that we will have
to honor later and so is necessary for Go 1.

Fixes #3270.
Fixes #3271.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5795073
src/pkg/text/template/multi_test.go
src/pkg/text/template/parse/lex.go
src/pkg/text/template/parse/parse.go
src/pkg/text/template/parse/parse_test.go