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

Issue 6849066: code review 6849066: go/printer: leave indentation alone when printing nodes... (Closed)

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

Description

go/printer: leave indentation alone when printing nodes from different files ASTs may be created by various tools and built from nodes of different files. An incorrectly constructed AST will likely not print at all, but a (structurally) correct AST with bad position information should still print structurally correct. One heuristic used was to reset indentation when the filename in the position information of nodes changed. However, this can lead to wrong indentation for structurally correct ASTs. Fix: Don't change the indentation in this case. Related to issue 4300.

Patch Set 1 #

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -1 line) Patch
M src/pkg/go/printer/printer.go View 1 1 chunk +8 lines, -1 line 0 comments Download

Messages

Total messages: 3
gri
Hello r@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
9 years, 2 months ago (2012-11-16 21:00:35 UTC) #1
r
LGTM
9 years, 2 months ago (2012-11-16 21:08:09 UTC) #2
gri
9 years, 2 months ago (2012-11-16 21:17:17 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=178cc4ec963c ***

go/printer: leave indentation alone when printing nodes from different files

ASTs may be created by various tools and built from nodes of
different files. An incorrectly constructed AST will likely
not print at all, but a (structurally) correct AST with bad
position information should still print structurally correct.

One heuristic used was to reset indentation when the filename
in the position information of nodes changed. However, this
can lead to wrong indentation for structurally correct ASTs.

Fix: Don't change the indentation in this case.

Related to issue 4300.

R=r
CC=golang-dev
http://codereview.appspot.com/6849066
Sign in to reply to this message.

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