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

Side by Side Diff: src/ast.cc

Issue 131101: Initial implementation of printing the AST as a JSON string. This... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/ast.h ('k') | src/codegen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 if (targets_->at(i) == target) return; 166 if (targets_->at(i) == target) return;
167 } 167 }
168 targets_->Add(target); 168 targets_->Add(target);
169 } 169 }
170 170
171 171
172 // ---------------------------------------------------------------------------- 172 // ----------------------------------------------------------------------------
173 // Implementation of AstVisitor 173 // Implementation of AstVisitor
174 174
175 175
176 void AstVisitor::VisitDeclarations(ZoneList<Declaration*>* declarations) {
177 for (int i = 0; i < declarations->length(); i++) {
178 Visit(declarations->at(i));
179 }
180 }
181
182
176 void AstVisitor::VisitStatements(ZoneList<Statement*>* statements) { 183 void AstVisitor::VisitStatements(ZoneList<Statement*>* statements) {
177 for (int i = 0; i < statements->length(); i++) { 184 for (int i = 0; i < statements->length(); i++) {
178 Visit(statements->at(i)); 185 Visit(statements->at(i));
179 } 186 }
180 } 187 }
181 188
182 189
183 void AstVisitor::VisitExpressions(ZoneList<Expression*>* expressions) { 190 void AstVisitor::VisitExpressions(ZoneList<Expression*>* expressions) {
184 for (int i = 0; i < expressions->length(); i++) { 191 for (int i = 0; i < expressions->length(); i++) {
185 // The variable statement visiting code may pass NULL expressions 192 // The variable statement visiting code may pass NULL expressions
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 if (kInfinity - max_match_ < node_max_match) { 495 if (kInfinity - max_match_ < node_max_match) {
489 max_match_ = kInfinity; 496 max_match_ = kInfinity;
490 } else { 497 } else {
491 max_match_ += node->max_match(); 498 max_match_ += node->max_match();
492 } 499 }
493 } 500 }
494 } 501 }
495 502
496 503
497 } } // namespace v8::internal 504 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698