Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Issue 10449021: New Prettyprinter class that converts Node-tree to string. (Closed)

Created:
8 years, 7 months ago by Roman
Modified:
8 years, 6 months ago
Reviewers:
Anton Muhin, ahe, ngeoffray
CC:
reviews_dartlang.org
Visibility:
Public.

Description

New Prettyprinter class that converts Node-tree to string. BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=8436

Patch Set 1 #

Patch Set 2 : #

Total comments: 6

Patch Set 3 : address comments #

Patch Set 4 : Change class name from PrettyPrint to PrettyPrinter #

Total comments: 15

Patch Set 5 : Address Peter's comments. #

Total comments: 5

Patch Set 6 : Address Peter's comments. #

Total comments: 2

Patch Set 7 : Make prettyPrint() method static. #

Patch Set 8 : Remove trailing spaces, add NL at EOF #

Unified diffs Side-by-side diffs Delta from patch set Stats (+302 lines, -1 line) Patch
A lib/compiler/implementation/tree/prettyprint.dart View 1 2 3 4 5 6 7 1 chunk +300 lines, -0 lines 0 comments Download
M lib/compiler/implementation/tree/tree.dart View 1 2 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 14 (0 generated)
Roman
Example: for foo.dart with contents: main() { a = list[0] } the result is: <FunctionExpression> ...
8 years, 7 months ago (2012-05-25 14:59:11 UTC) #1
Anton Muhin
lgtm w/ comments addressed, but, please, wait for lgtm from Peter. https://chromiumcodereview.appspot.com/10449021/diff/4/lib/compiler/implementation/tree/prettyprint.dart File lib/compiler/implementation/tree/prettyprint.dart (right): ...
8 years, 7 months ago (2012-05-28 06:07:09 UTC) #2
Roman
https://chromiumcodereview.appspot.com/10449021/diff/4/lib/compiler/implementation/tree/prettyprint.dart File lib/compiler/implementation/tree/prettyprint.dart (right): https://chromiumcodereview.appspot.com/10449021/diff/4/lib/compiler/implementation/tree/prettyprint.dart#newcode29 lib/compiler/implementation/tree/prettyprint.dart:29: sb.add("<"); On 2012/05/28 06:07:09, antonmuhin wrote: > do we ...
8 years, 6 months ago (2012-05-28 12:32:14 UTC) #3
ahe
Hi Roman, You have sent a few examples using the output of this class. That ...
8 years, 6 months ago (2012-05-31 17:37:18 UTC) #4
Roman
I changed class name from PrettyPrint to PrettyPrinter. CL that removes printDebugInfo from Unparser is ...
8 years, 6 months ago (2012-06-01 12:33:28 UTC) #5
ahe
Basically good, but I would like some better names for the add...Node methods. I'm thinking ...
8 years, 6 months ago (2012-06-01 12:52:57 UTC) #6
Roman
Sorry for the delay. https://chromiumcodereview.appspot.com/10449021/diff/8001/lib/compiler/implementation/tree/prettyprint.dart File lib/compiler/implementation/tree/prettyprint.dart (right): https://chromiumcodereview.appspot.com/10449021/diff/8001/lib/compiler/implementation/tree/prettyprint.dart#newcode21 lib/compiler/implementation/tree/prettyprint.dart:21: void addInNode(String type, [Map params]) ...
8 years, 6 months ago (2012-06-05 09:28:54 UTC) #7
Roman
ping, Peter
8 years, 6 months ago (2012-06-06 15:03:58 UTC) #8
Roman
Adding Nicolas because Peter is too busy with other issues.
8 years, 6 months ago (2012-06-07 13:28:45 UTC) #9
ahe
LGTM provided you address the comments below. https://chromiumcodereview.appspot.com/10449021/diff/8001/lib/compiler/implementation/tree/prettyprint.dart File lib/compiler/implementation/tree/prettyprint.dart (right): https://chromiumcodereview.appspot.com/10449021/diff/8001/lib/compiler/implementation/tree/prettyprint.dart#newcode67 lib/compiler/implementation/tree/prettyprint.dart:67: sb = ...
8 years, 6 months ago (2012-06-08 07:37:36 UTC) #10
Roman
https://chromiumcodereview.appspot.com/10449021/diff/8001/lib/compiler/implementation/tree/prettyprint.dart File lib/compiler/implementation/tree/prettyprint.dart (right): https://chromiumcodereview.appspot.com/10449021/diff/8001/lib/compiler/implementation/tree/prettyprint.dart#newcode67 lib/compiler/implementation/tree/prettyprint.dart:67: sb = new StringBuffer(); On 2012/06/08 07:37:36, ahe wrote: ...
8 years, 6 months ago (2012-06-08 09:10:15 UTC) #11
ahe
https://chromiumcodereview.appspot.com/10449021/diff/11001/lib/compiler/implementation/tree/prettyprint.dart File lib/compiler/implementation/tree/prettyprint.dart (right): https://chromiumcodereview.appspot.com/10449021/diff/11001/lib/compiler/implementation/tree/prettyprint.dart#newcode14 lib/compiler/implementation/tree/prettyprint.dart:14: static final String _INDENT = " "; On 2012/06/08 ...
8 years, 6 months ago (2012-06-08 09:41:57 UTC) #12
ahe
https://chromiumcodereview.appspot.com/10449021/diff/16001/lib/compiler/implementation/tree/prettyprint.dart File lib/compiler/implementation/tree/prettyprint.dart (right): https://chromiumcodereview.appspot.com/10449021/diff/16001/lib/compiler/implementation/tree/prettyprint.dart#newcode80 lib/compiler/implementation/tree/prettyprint.dart:80: String prettyPrint(Node node) { I'm not really sure I ...
8 years, 6 months ago (2012-06-08 09:45:31 UTC) #13
Roman
8 years, 6 months ago (2012-06-08 09:56:33 UTC) #14
https://chromiumcodereview.appspot.com/10449021/diff/16001/lib/compiler/imple...
File lib/compiler/implementation/tree/prettyprint.dart (right):

https://chromiumcodereview.appspot.com/10449021/diff/16001/lib/compiler/imple...
lib/compiler/implementation/tree/prettyprint.dart:80: String prettyPrint(Node
node) {
On 2012/06/08 09:45:31, ahe wrote:
> I'm not really sure I understand the purpose of this method. It is not
> re-entrant, so why would I want to call prettyPrint twice on the same
> PrettyPrinter. Why not turn this into a static method:
> 
> static String prettyPrint(Node node) {
>   var p = new PrettyPrinter();
>   node.accept(p);
>   return p.sb.toString();
> }

Yes, this is great. Done.

Powered by Google App Engine
This is Rietveld 408576698