Skip to content

Commit b79db4f

Browse files
aymerickrobpike
authored andcommitted
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>
1 parent e2e322d commit b79db4f

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/text/template/parse/lex.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,12 @@ func lexInsideAction(l *lexer) stateFn {
313313
case r == '(':
314314
l.emit(itemLeftParen)
315315
l.parenDepth++
316-
return lexInsideAction
317316
case r == ')':
318317
l.emit(itemRightParen)
319318
l.parenDepth--
320319
if l.parenDepth < 0 {
321320
return l.errorf("unexpected right paren %#U", r)
322321
}
323-
return lexInsideAction
324322
case r <= unicode.MaxASCII && unicode.IsPrint(r):
325323
l.emit(itemChar)
326324
return lexInsideAction

0 commit comments

Comments
 (0)