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
This commit is contained in:
parent
93132e1b5d
commit
2f0013ebbf
@ -646,7 +646,7 @@ AstPrinter::~AstPrinter() {
|
||||
|
||||
void AstPrinter::PrintIndented(const char* txt) {
|
||||
for (int i = 0; i < indent_; i++) {
|
||||
Print(". ");
|
||||
Print(". ");
|
||||
}
|
||||
Print(txt);
|
||||
}
|
||||
@ -732,7 +732,7 @@ void AstPrinter::PrintParameters(Scope* scope) {
|
||||
if (scope->num_parameters() > 0) {
|
||||
IndentedScope indent("PARAMS");
|
||||
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)->type());
|
||||
}
|
||||
@ -1024,7 +1024,7 @@ void AstPrinter::VisitProperty(Property* node) {
|
||||
Visit(node->obj());
|
||||
Literal* literal = node->key()->AsLiteral();
|
||||
if (literal != NULL && literal->handle()->IsSymbol()) {
|
||||
PrintLiteralIndented("LITERAL", literal->handle(), false);
|
||||
PrintLiteralIndented("NAME", literal->handle(), false);
|
||||
} else {
|
||||
PrintIndentedVisit("KEY", node->key());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user