aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/parse
diff options
context:
space:
mode:
authorAriel Mashraki <ariel@mashraki.co.il>2017-07-01 19:12:59 +0300
committerBrad Fitzpatrick <bradfitz@golang.org>2017-11-10 04:13:30 +0000
commit3e97c42f77288b06a125cecd199aee4c6a23bc10 (patch)
tree7c667e9886eb9103cbf59e9b712160640b6650df /src/text/template/parse
parentd58bf64d5acbcad1ae5b605228ce51038d4df631 (diff)
downloadgo-3e97c42f77288b06a125cecd199aee4c6a23bc10.tar.xz
text/template: remove unnecessary lexer field
this change removes the state field from the lexer, because it's only used by the run method and can be replaced with a local variable Change-Id: Ib7a90ab6e9a894716cba2c7d9ed71bf2ad1240c0 Reviewed-on: https://go-review.googlesource.com/47338 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/text/template/parse')
-rw-r--r--src/text/template/parse/lex.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/text/template/parse/lex.go b/src/text/template/parse/lex.go
index 71f228c45c..da766cc7c3 100644
--- a/src/text/template/parse/lex.go
+++ b/src/text/template/parse/lex.go
@@ -114,7 +114,6 @@ type lexer struct {
input string // the string being scanned
leftDelim string // start of action
rightDelim string // end of action
- state stateFn // the next lexing function to enter
pos Pos // current position in the input
start Pos // start position of this item
width Pos // width of last rune read from input
@@ -229,8 +228,8 @@ func lex(name, input, left, right string) *lexer {
// run runs the state machine for the lexer.
func (l *lexer) run() {
- for l.state = lexText; l.state != nil; {
- l.state = l.state(l)
+ for state := lexText; state != nil; {
+ state = state(l)
}
close(l.items)
}