OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/ast/ast.h" | 5 #include "src/ast/ast.h" |
6 | 6 |
7 #include <cmath> // For isfinite. | 7 #include <cmath> // For isfinite. |
8 | 8 |
9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 if (stmt->IsJump()) break; | 958 if (stmt->IsJump()) break; |
959 } | 959 } |
960 } | 960 } |
961 | 961 |
962 void AstTraversalVisitor::VisitVariableDeclaration(VariableDeclaration* decl) {} | 962 void AstTraversalVisitor::VisitVariableDeclaration(VariableDeclaration* decl) {} |
963 | 963 |
964 void AstTraversalVisitor::VisitFunctionDeclaration(FunctionDeclaration* decl) { | 964 void AstTraversalVisitor::VisitFunctionDeclaration(FunctionDeclaration* decl) { |
965 RECURSE(Visit(decl->fun())); | 965 RECURSE(Visit(decl->fun())); |
966 } | 966 } |
967 | 967 |
968 void AstTraversalVisitor::VisitImportDeclaration(ImportDeclaration* decl) {} | |
969 | |
970 void AstTraversalVisitor::VisitBlock(Block* stmt) { | 968 void AstTraversalVisitor::VisitBlock(Block* stmt) { |
971 RECURSE(VisitStatements(stmt->statements())); | 969 RECURSE(VisitStatements(stmt->statements())); |
972 } | 970 } |
973 | 971 |
974 void AstTraversalVisitor::VisitExpressionStatement(ExpressionStatement* stmt) { | 972 void AstTraversalVisitor::VisitExpressionStatement(ExpressionStatement* stmt) { |
975 RECURSE(Visit(stmt->expression())); | 973 RECURSE(Visit(stmt->expression())); |
976 } | 974 } |
977 | 975 |
978 void AstTraversalVisitor::VisitEmptyStatement(EmptyStatement* stmt) {} | 976 void AstTraversalVisitor::VisitEmptyStatement(EmptyStatement* stmt) {} |
979 | 977 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 bool Literal::Match(void* literal1, void* literal2) { | 1234 bool Literal::Match(void* literal1, void* literal2) { |
1237 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1235 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1238 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1236 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1239 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1237 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
1240 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1238 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1241 } | 1239 } |
1242 | 1240 |
1243 | 1241 |
1244 } // namespace internal | 1242 } // namespace internal |
1245 } // namespace v8 | 1243 } // namespace v8 |
OLD | NEW |