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

Side by Side Diff: src/prettyprinter.cc

Issue 12646003: Add parser support for generators. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Fix bad initialization list in last preparser commit Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 } 346 }
347 347
348 348
349 void PrettyPrinter::VisitAssignment(Assignment* node) { 349 void PrettyPrinter::VisitAssignment(Assignment* node) {
350 Visit(node->target()); 350 Visit(node->target());
351 Print(" %s ", Token::String(node->op())); 351 Print(" %s ", Token::String(node->op()));
352 Visit(node->value()); 352 Visit(node->value());
353 } 353 }
354 354
355 355
356 void PrettyPrinter::VisitYield(Yield* node) {
357 Print("yield ");
358 Visit(node->expression());
359 }
360
361
356 void PrettyPrinter::VisitThrow(Throw* node) { 362 void PrettyPrinter::VisitThrow(Throw* node) {
357 Print("throw "); 363 Print("throw ");
358 Visit(node->exception()); 364 Visit(node->exception());
359 } 365 }
360 366
361 367
362 void PrettyPrinter::VisitProperty(Property* node) { 368 void PrettyPrinter::VisitProperty(Property* node) {
363 Expression* key = node->key(); 369 Expression* key = node->key();
364 Literal* literal = key->AsLiteral(); 370 Literal* literal = key->AsLiteral();
365 if (literal != NULL && literal->handle()->IsInternalizedString()) { 371 if (literal != NULL && literal->handle()->IsInternalizedString()) {
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 } 1058 }
1053 1059
1054 1060
1055 void AstPrinter::VisitAssignment(Assignment* node) { 1061 void AstPrinter::VisitAssignment(Assignment* node) {
1056 IndentedScope indent(this, Token::Name(node->op()), node); 1062 IndentedScope indent(this, Token::Name(node->op()), node);
1057 Visit(node->target()); 1063 Visit(node->target());
1058 Visit(node->value()); 1064 Visit(node->value());
1059 } 1065 }
1060 1066
1061 1067
1068 void AstPrinter::VisitYield(Yield* node) {
1069 PrintIndentedVisit("YIELD", node->expression());
1070 }
1071
1072
1062 void AstPrinter::VisitThrow(Throw* node) { 1073 void AstPrinter::VisitThrow(Throw* node) {
1063 PrintIndentedVisit("THROW", node->exception()); 1074 PrintIndentedVisit("THROW", node->exception());
1064 } 1075 }
1065 1076
1066 1077
1067 void AstPrinter::VisitProperty(Property* node) { 1078 void AstPrinter::VisitProperty(Property* node) {
1068 IndentedScope indent(this, "PROPERTY", node); 1079 IndentedScope indent(this, "PROPERTY", node);
1069 Visit(node->obj()); 1080 Visit(node->obj());
1070 Literal* literal = node->key()->AsLiteral(); 1081 Literal* literal = node->key()->AsLiteral();
1071 if (literal != NULL && literal->handle()->IsInternalizedString()) { 1082 if (literal != NULL && literal->handle()->IsInternalizedString()) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 } 1135 }
1125 1136
1126 1137
1127 void AstPrinter::VisitThisFunction(ThisFunction* node) { 1138 void AstPrinter::VisitThisFunction(ThisFunction* node) {
1128 IndentedScope indent(this, "THIS-FUNCTION"); 1139 IndentedScope indent(this, "THIS-FUNCTION");
1129 } 1140 }
1130 1141
1131 #endif // DEBUG 1142 #endif // DEBUG
1132 1143
1133 } } // namespace v8::internal 1144 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | src/scanner.h » ('j') | test/mjsunit/harmony/generators-parsing.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698