A few small changes to --print-ast behavior:

* Remove two horizontal spaces per indent
* Don't print an extra space between "VAR" and "(" for parameters
* Call the name on named property accesses "NAME"

Review URL: http://codereview.chromium.org/67124

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1712 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 93132e1b
...@@ -646,7 +646,7 @@ AstPrinter::~AstPrinter() { ...@@ -646,7 +646,7 @@ AstPrinter::~AstPrinter() {
void AstPrinter::PrintIndented(const char* txt) { void AstPrinter::PrintIndented(const char* txt) {
for (int i = 0; i < indent_; i++) { for (int i = 0; i < indent_; i++) {
Print(". "); Print(". ");
} }
Print(txt); Print(txt);
} }
...@@ -732,7 +732,7 @@ void AstPrinter::PrintParameters(Scope* scope) { ...@@ -732,7 +732,7 @@ void AstPrinter::PrintParameters(Scope* scope) {
if (scope->num_parameters() > 0) { if (scope->num_parameters() > 0) {
IndentedScope indent("PARAMS"); IndentedScope indent("PARAMS");
for (int i = 0; i < scope->num_parameters(); i++) { for (int i = 0; i < scope->num_parameters(); i++) {
PrintLiteralWithModeIndented("VAR ", scope->parameter(i), PrintLiteralWithModeIndented("VAR", scope->parameter(i),
scope->parameter(i)->name(), scope->parameter(i)->name(),
scope->parameter(i)->type()); scope->parameter(i)->type());
} }
...@@ -1024,7 +1024,7 @@ void AstPrinter::VisitProperty(Property* node) { ...@@ -1024,7 +1024,7 @@ void AstPrinter::VisitProperty(Property* node) {
Visit(node->obj()); Visit(node->obj());
Literal* literal = node->key()->AsLiteral(); Literal* literal = node->key()->AsLiteral();
if (literal != NULL && literal->handle()->IsSymbol()) { if (literal != NULL && literal->handle()->IsSymbol()) {
PrintLiteralIndented("LITERAL", literal->handle(), false); PrintLiteralIndented("NAME", literal->handle(), false);
} else { } else {
PrintIndentedVisit("KEY", node->key()); PrintIndentedVisit("KEY", node->key());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment