Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10497)

Issue 13327043: code review 13327043: text/template: allow {{else if ... }} to simplify if chains (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by r
Modified:
10 years, 7 months ago
Reviewers:
adg
CC:
golang-dev, adg
Visibility:
Public.

Description

text/template: allow {{else if ... }} to simplify if chains The method is simple: the parser just parses {{if A}}a{{else if B}}b{{end}} to the same tree that would be produced by {{if A}}a{{else}}{{if B}}b{{end}}{{end}} Thus no changes are required in text/template itself or in html/template, only in text/template/parse. Fixes issue 6085

Patch Set 1 #

Patch Set 2 : diff -r 4a2a2c758ca5 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -4 lines) Patch
M src/pkg/text/template/doc.go View 1 chunk +6 lines, -0 lines 0 comments Download
M src/pkg/text/template/exec_test.go View 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/text/template/parse/parse.go View 6 chunks +27 lines, -4 lines 0 comments Download
M src/pkg/text/template/parse/parse_test.go View 2 chunks +5 lines, -0 lines 0 comments Download

Messages

Total messages: 3
r
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
10 years, 7 months ago (2013-08-28 04:32:18 UTC) #1
adg
LGTM
10 years, 7 months ago (2013-08-28 04:39:31 UTC) #2
r
10 years, 7 months ago (2013-08-28 04:44:06 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=0ff127f41a08 ***

text/template: allow {{else if ... }} to simplify if chains
The method is simple: the parser just parses

        {{if A}}a{{else if B}}b{{end}}

to the same tree that would be produced by

        {{if A}}a{{else}}{{if B}}b{{end}}{{end}}

Thus no changes are required in text/template itself
or in html/template, only in text/template/parse.

Fixes issue 6085

R=golang-dev, adg
CC=golang-dev
https://codereview.appspot.com/13327043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b