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

Issue 23960003: Disentangle AstNode::Name and AstNode::ShortName. (Closed)

Created:
7 years, 3 months ago by Kevin Millikin (Google)
Modified:
7 years, 3 months ago
Reviewers:
regis, srdjan, hausner
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Disentangle AstNode::Name and AstNode::ShortName. The Name function is used for pretty printing except that for a few node types we rely on a specific name for implementation correctness. Overriding the pretty printing function to get out a type name, or a variable name, or an operator symbol name, is risky. 1. Code that relies on the semantics of the name will break if the pretty name is changed. 2. Pretty printing is less useful. For instance, LoadLocalNode just prints the variable name (twice, once as the AST constructor and once in quotes as the variable name). This is confusing if the variable happens to have the same name as one of the other pretty names, e.g., args or seq. Now, there is a virtual function to get the pretty name but classes do not change it to communicate other information (type names, variable names, operator names). BUG= R=regis@google.com, srdjan@google.com Committed: https://code.google.com/p/dart/source/detail?r=27244

Patch Set 1 #

Total comments: 3

Patch Set 2 : Incorporated review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -51 lines) Patch
M runtime/vm/ast.h View 9 chunks +8 lines, -16 lines 0 comments Download
M runtime/vm/ast.cc View 5 chunks +7 lines, -12 lines 0 comments Download
M runtime/vm/ast_printer.cc View 11 chunks +25 lines, -18 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Kevin Millikin (Google)
I'm not sure who to direct this review to. Redirect as necessary. https://codereview.chromium.org/23960003/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc ...
7 years, 3 months ago (2013-09-05 13:53:45 UTC) #1
srdjan
7 years, 3 months ago (2013-09-05 18:55:05 UTC) #2
srdjan
LGTM
7 years, 3 months ago (2013-09-05 18:57:26 UTC) #3
regis
LGTM with a comment https://codereview.chromium.org/23960003/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/23960003/diff/1/runtime/vm/parser.cc#newcode8229 runtime/vm/parser.cc:8229: const String& name = String::ZoneHandle(Symbols::New("primary")); ...
7 years, 3 months ago (2013-09-05 19:42:12 UTC) #4
Kevin Millikin (Google)
Committed patchset #2 manually as r27244 (presubmit successful).
7 years, 3 months ago (2013-09-06 11:54:48 UTC) #5
Kevin Millikin (Google)
7 years, 3 months ago (2013-09-06 12:18:45 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/23960003/diff/1/runtime/vm/parser.cc
File runtime/vm/parser.cc (right):

https://codereview.chromium.org/23960003/diff/1/runtime/vm/parser.cc#newcode8229
runtime/vm/parser.cc:8229: const String& name =
String::ZoneHandle(Symbols::New("primary"));
Thanks for the clarification.  I filed issue 13134 and added TODO(regis) with
the issue number at this site in parser.cc.

Powered by Google App Engine
This is Rietveld 408576698