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

Issue 130620043: code review 130620043: text/template: add back pointer to Nodes for better err... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 8 months ago by r
Modified:
9 years, 8 months ago
Reviewers:
gobot, adg, josharian, bradfitz
CC:
golang-codereviews, adg
Visibility:
Public.

Description

text/template: add back pointer to Nodes for better error generation ErrorContext now has all the information it needs from the Node, rather than depending on the template that contains it. This makes it easier for html/template to generate correct locations in its error messages. Updated html/template to use this ability where it is easy, which is not everywhere, but more work can probably push it through. Fixes issue 8577.

Patch Set 1 #

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

Patch Set 3 : diff -r 59b1bb4bf0458d3e31aaff083c5381c9906f875c https://code.google.com/p/go #

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

Patch Set 5 : diff -r 59b1bb4bf0458d3e31aaff083c5381c9906f875c https://code.google.com/p/go #

Total comments: 2

Patch Set 6 : diff -r 25ae16c918f65ca0e0039d74109aaeefa716d987 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+272 lines, -168 lines) Patch
M src/pkg/html/template/error.go View 3 chunks +12 lines, -4 lines 0 comments Download
M src/pkg/html/template/escape.go View 1 2 3 4 5 12 chunks +33 lines, -42 lines 0 comments Download
M src/pkg/html/template/escape_test.go View 4 chunks +9 lines, -9 lines 0 comments Download
M src/pkg/html/template/template.go View 2 chunks +2 lines, -2 lines 0 comments Download
M src/pkg/html/template/transition.go View 6 chunks +6 lines, -6 lines 0 comments Download
M src/pkg/text/template/parse/node.go View 1 2 3 4 5 29 chunks +174 lines, -76 lines 0 comments Download
M src/pkg/text/template/parse/parse.go View 1 2 3 4 5 20 chunks +34 lines, -28 lines 0 comments Download
M src/pkg/text/template/parse/parse_test.go View 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 10
r
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
9 years, 8 months ago (2014-08-26 22:44:30 UTC) #1
adg
LGTM https://codereview.appspot.com/130620043/diff/80001/src/pkg/text/template/parse/node.go File src/pkg/text/template/parse/node.go (right): https://codereview.appspot.com/130620043/diff/80001/src/pkg/text/template/parse/node.go#newcode29 src/pkg/text/template/parse/node.go:29: // parent returns the containing *Tree. why "parent" ...
9 years, 8 months ago (2014-08-27 04:40:38 UTC) #2
r
https://codereview.appspot.com/130620043/diff/80001/src/pkg/text/template/parse/node.go File src/pkg/text/template/parse/node.go (right): https://codereview.appspot.com/130620043/diff/80001/src/pkg/text/template/parse/node.go#newcode29 src/pkg/text/template/parse/node.go:29: // parent returns the containing *Tree. On 2014/08/27 04:40:37, ...
9 years, 8 months ago (2014-08-27 05:21:40 UTC) #3
adg
I didn't see the collision. It was "tr" where I saw it. But "parent" is ...
9 years, 8 months ago (2014-08-27 05:23:06 UTC) #4
r
*** Submitted as https://code.google.com/p/go/source/detail?r=5f91e12d9798 *** text/template: add back pointer to Nodes for better error generation ...
9 years, 8 months ago (2014-08-29 16:54:05 UTC) #5
gobot
This CL appears to have broken the linux-amd64 builder. See http://build.golang.org/log/344b2089ed1dabdb3c65b8f7937ff6b8b0f58a34
9 years, 8 months ago (2014-08-29 16:57:40 UTC) #6
josharian
Real: Error running API checker: exit status 1 On Fri, Aug 29, 2014 at 9:57 ...
9 years, 8 months ago (2014-08-29 17:06:14 UTC) #7
bradfitz
The api checker caught something! On Fri, Aug 29, 2014 at 10:05 AM, Josh Bleecher ...
9 years, 8 months ago (2014-08-29 17:08:27 UTC) #8
r
Cool. It's an interesting one. I prefer the new code and it is actually an ...
9 years, 8 months ago (2014-08-29 17:23:56 UTC) #9
bradfitz
9 years, 8 months ago (2014-08-29 17:39:16 UTC) #10
Why not both? Mailed https://codereview.appspot.com/136010043



On Fri, Aug 29, 2014 at 10:23 AM, Rob Pike <r@golang.org> wrote:

> Cool.
>
> It's an interesting one. I prefer the new code and it is actually an
> API expansion since the receiver can now be a value. What do you
> think? I think it's fine.
>
> Nice catch regardless.
>
> -rob
>
>
> On Fri, Aug 29, 2014 at 10:08 AM, Brad Fitzpatrick <bradfitz@golang.org>
> wrote:
> > The api checker caught something!
> >
> >
> >
> > On Fri, Aug 29, 2014 at 10:05 AM, Josh Bleecher Snyder <
> josharian@gmail.com>
> > wrote:
> >>
> >> Real:
> >>
> >> Error running API checker: exit status 1
> >>
> >>
> >> On Fri, Aug 29, 2014 at 9:57 AM,  <gobot@golang.org> wrote:
> >> > This CL appears to have broken the linux-amd64 builder.
> >> > See
> http://build.golang.org/log/344b2089ed1dabdb3c65b8f7937ff6b8b0f58a34
> >> >
> >> >
> >> > https://codereview.appspot.com/130620043/
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "golang-codereviews" group.
> >> > To unsubscribe from this group and stop receiving emails from it, send
> >> > an
> >> > email to golang-codereviews+unsubscribe@googlegroups.com.
> >> > For more options, visit https://groups.google.com/d/optout.
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "golang-codereviews" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to golang-codereviews+unsubscribe@googlegroups.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
>
Sign in to reply to this message.

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