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 #ifndef V8_AST_MODULES_H_ | 5 #ifndef V8_AST_MODULES_H_ |
6 #define V8_AST_MODULES_H_ | 6 #define V8_AST_MODULES_H_ |
7 | 7 |
8 #include "src/parsing/scanner.h" // Only for Scanner::Location. | 8 #include "src/parsing/scanner.h" // Only for Scanner::Location. |
9 #include "src/pending-compilation-error-handler.h" | 9 #include "src/pending-compilation-error-handler.h" |
10 #include "src/zone/zone-containers.h" | 10 #include "src/zone/zone-containers.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void AddStarExport( | 66 void AddStarExport( |
67 const AstRawString* module_request, const Scanner::Location loc, | 67 const AstRawString* module_request, const Scanner::Location loc, |
68 Zone* zone); | 68 Zone* zone); |
69 | 69 |
70 // Check if module is well-formed and report error if not. | 70 // Check if module is well-formed and report error if not. |
71 // Also canonicalize indirect exports. | 71 // Also canonicalize indirect exports. |
72 bool Validate(ModuleScope* module_scope, | 72 bool Validate(ModuleScope* module_scope, |
73 PendingCompilationErrorHandler* error_handler, Zone* zone); | 73 PendingCompilationErrorHandler* error_handler, Zone* zone); |
74 | 74 |
75 struct Entry : public ZoneObject { | 75 struct Entry : public ZoneObject { |
76 const Scanner::Location location; | 76 Scanner::Location location; |
77 const AstRawString* export_name; | 77 const AstRawString* export_name; |
78 const AstRawString* local_name; | 78 const AstRawString* local_name; |
79 const AstRawString* import_name; | 79 const AstRawString* import_name; |
80 // The module_request value records the order in which modules are | 80 // The module_request value records the order in which modules are |
81 // requested. It also functions as an index into the ModuleInfo's array of | 81 // requested. It also functions as an index into the ModuleInfo's array of |
82 // module specifiers and into the Module's array of requested modules. A | 82 // module specifiers and into the Module's array of requested modules. A |
83 // negative value means no module request. | 83 // negative value means no module request. |
84 int module_request; | 84 int module_request; |
85 | 85 |
86 // TODO(neis): Remove local_name component? | 86 // TODO(neis): Remove local_name component? |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 .insert(std::make_pair(specifier, module_requests_.size())) | 198 .insert(std::make_pair(specifier, module_requests_.size())) |
199 .first; | 199 .first; |
200 return it->second; | 200 return it->second; |
201 } | 201 } |
202 }; | 202 }; |
203 | 203 |
204 } // namespace internal | 204 } // namespace internal |
205 } // namespace v8 | 205 } // namespace v8 |
206 | 206 |
207 #endif // V8_AST_MODULES_H_ | 207 #endif // V8_AST_MODULES_H_ |
OLD | NEW |