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

Issue 5798050: text/template: add parenthesized pipelines (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by rsc
Modified:
12 years, 1 month ago
Reviewers:
Visibility:
Public.

Description

text/template: add parenthesized pipelines This is generally useful but especially helpful when trying to use the built-in boolean operators. It lets you write: {{if not (f 1)}} foo {{end}} {{if and (f 1) (g 2)}} bar {{end}} {{if or (f 1) (g 2)}} quux {{end}} instead of {{if f 1 | not}} foo {{end}} {{if f 1}}{{if g 2}} bar {{end}}{{end}} {{$do := 0}}{{if f 1}}{{$do := 1}}{{else if g 2}}{{$do := 1}}{{end}}{{if $do}} quux {{end}}

Patch Set 1 #

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -3 lines) Patch
M src/pkg/text/template/exec.go View 1 2 chunks +4 lines, -0 lines 0 comments Download
M src/pkg/text/template/exec_test.go View 1 3 chunks +12 lines, -0 lines 0 comments Download
M src/pkg/text/template/parse/lex.go View 1 6 chunks +23 lines, -1 line 0 comments Download
M src/pkg/text/template/parse/node.go View 1 1 chunk +4 lines, -0 lines 0 comments Download
M src/pkg/text/template/parse/parse.go View 1 2 chunks +11 lines, -2 lines 0 comments Download
M src/pkg/text/template/parse/parse_test.go View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 1
rsc
12 years, 1 month ago (2012-03-12 18:07:01 UTC) #1
*** Abandoned ***
Sign in to reply to this message.

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