diff options
| author | Ariel Mashraki <ariel@mashraki.co.il> | 2017-07-18 22:14:17 +0300 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2017-11-09 21:24:21 +0000 |
| commit | 2f53fb58a8664c96a770bfb8c8d1b0596fbae481 (patch) | |
| tree | 5bfc08e4116161378d07225344a8c61a62d75835 /src/text/template/parse | |
| parent | 1c322524ada678c26b831c7e88525e65130a0880 (diff) | |
| download | go-2f53fb58a8664c96a770bfb8c8d1b0596fbae481.tar.xz | |
text/template: remove unused lexer field
The lastPos field used in the past to track the line number of a token.
it's irrelevant anymore, and we can remove it.
Change-Id: I42c0bf55e884b79574a7da4926489f2d77618cd0
Reviewed-on: https://go-review.googlesource.com/49591
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.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/text/template/parse/lex.go b/src/text/template/parse/lex.go index baf48c66c4..71f228c45c 100644 --- a/src/text/template/parse/lex.go +++ b/src/text/template/parse/lex.go @@ -118,7 +118,6 @@ type lexer struct { pos Pos // current position in the input start Pos // start position of this item width Pos // width of last rune read from input - lastPos Pos // position of most recent item returned by nextItem items chan item // channel of scanned items parenDepth int // nesting depth of ( ) exprs line int // 1+number of newlines seen @@ -198,9 +197,7 @@ func (l *lexer) errorf(format string, args ...interface{}) stateFn { // nextItem returns the next item from the input. // Called by the parser, not in the lexing goroutine. func (l *lexer) nextItem() item { - item := <-l.items - l.lastPos = item.pos - return item + return <-l.items } // drain drains the output so the lexing goroutine will exit. |
