diff options
| author | Aymerick <aymerick@jehanne.org> | 2015-04-29 11:33:41 +0200 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2015-05-04 17:27:03 +0000 |
| commit | b79db4f2fd76cf1d8ce58144fc609a08ab5dd7b3 (patch) | |
| tree | b7a7742f2ac0654dc8978421138f0bf71eac4d07 | |
| parent | e2e322d293bfd12db095229dd54349c61f4669cf (diff) | |
| download | go-b79db4f2fd76cf1d8ce58144fc609a08ab5dd7b3.tar.xz | |
text/template: ensures code consistency in lexer
At the end of lexInsideAction(), we return lexInsideAction: this is the default
behaviour when we are still parsing an action. But some switch branches return
lexInsideAction too.
So let's ensure code consistency by always reaching the end of the
lexInsideAction function when needed.
Change-Id: I7e9d8d6e51f29ecd6db6bdd63b36017845d95368
Reviewed-on: https://go-review.googlesource.com/9441
Reviewed-by: Rob Pike <r@golang.org>
| -rw-r--r-- | src/text/template/parse/lex.go | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/text/template/parse/lex.go b/src/text/template/parse/lex.go index b829b7e3b4..fe77b3afbe 100644 --- a/src/text/template/parse/lex.go +++ b/src/text/template/parse/lex.go @@ -313,14 +313,12 @@ func lexInsideAction(l *lexer) stateFn { case r == '(': l.emit(itemLeftParen) l.parenDepth++ - return lexInsideAction case r == ')': l.emit(itemRightParen) l.parenDepth-- if l.parenDepth < 0 { return l.errorf("unexpected right paren %#U", r) } - return lexInsideAction case r <= unicode.MaxASCII && unicode.IsPrint(r): l.emit(itemChar) return lexInsideAction |
