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_PARSING_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 FLAG_ACCESSOR(kToplevel, is_toplevel, set_toplevel) | 51 FLAG_ACCESSOR(kToplevel, is_toplevel, set_toplevel) |
52 FLAG_ACCESSOR(kLazy, is_lazy, set_lazy) | 52 FLAG_ACCESSOR(kLazy, is_lazy, set_lazy) |
53 FLAG_ACCESSOR(kEval, is_eval, set_eval) | 53 FLAG_ACCESSOR(kEval, is_eval, set_eval) |
54 FLAG_ACCESSOR(kGlobal, is_global, set_global) | 54 FLAG_ACCESSOR(kGlobal, is_global, set_global) |
55 FLAG_ACCESSOR(kStrictMode, is_strict_mode, set_strict_mode) | 55 FLAG_ACCESSOR(kStrictMode, is_strict_mode, set_strict_mode) |
56 FLAG_ACCESSOR(kNative, is_native, set_native) | 56 FLAG_ACCESSOR(kNative, is_native, set_native) |
57 FLAG_ACCESSOR(kModule, is_module, set_module) | 57 FLAG_ACCESSOR(kModule, is_module, set_module) |
58 FLAG_ACCESSOR(kAllowLazyParsing, allow_lazy_parsing, set_allow_lazy_parsing) | 58 FLAG_ACCESSOR(kAllowLazyParsing, allow_lazy_parsing, set_allow_lazy_parsing) |
59 FLAG_ACCESSOR(kAstValueFactoryOwned, ast_value_factory_owned, | 59 FLAG_ACCESSOR(kAstValueFactoryOwned, ast_value_factory_owned, |
60 set_ast_value_factory_owned) | 60 set_ast_value_factory_owned) |
| 61 FLAG_ACCESSOR(kIgnoreHtmlComments, ignore_html_comments, |
| 62 set_ignore_html_comments) |
61 | 63 |
62 #undef FLAG_ACCESSOR | 64 #undef FLAG_ACCESSOR |
63 | 65 |
64 void set_parse_restriction(ParseRestriction restriction) { | 66 void set_parse_restriction(ParseRestriction restriction) { |
65 SetFlag(kParseRestriction, restriction != NO_PARSE_RESTRICTION); | 67 SetFlag(kParseRestriction, restriction != NO_PARSE_RESTRICTION); |
66 } | 68 } |
67 | 69 |
68 ParseRestriction parse_restriction() const { | 70 ParseRestriction parse_restriction() const { |
69 return GetFlag(kParseRestriction) ? ONLY_SINGLE_FUNCTION_LITERAL | 71 return GetFlag(kParseRestriction) ? ONLY_SINGLE_FUNCTION_LITERAL |
70 : NO_PARSE_RESTRICTION; | 72 : NO_PARSE_RESTRICTION; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // ---------- Input flags --------------------------- | 162 // ---------- Input flags --------------------------- |
161 kToplevel = 1 << 0, | 163 kToplevel = 1 << 0, |
162 kLazy = 1 << 1, | 164 kLazy = 1 << 1, |
163 kEval = 1 << 2, | 165 kEval = 1 << 2, |
164 kGlobal = 1 << 3, | 166 kGlobal = 1 << 3, |
165 kStrictMode = 1 << 4, | 167 kStrictMode = 1 << 4, |
166 kNative = 1 << 5, | 168 kNative = 1 << 5, |
167 kParseRestriction = 1 << 6, | 169 kParseRestriction = 1 << 6, |
168 kModule = 1 << 7, | 170 kModule = 1 << 7, |
169 kAllowLazyParsing = 1 << 8, | 171 kAllowLazyParsing = 1 << 8, |
| 172 kIgnoreHtmlComments = 1 << 9, |
170 // ---------- Output flags -------------------------- | 173 // ---------- Output flags -------------------------- |
171 kAstValueFactoryOwned = 1 << 9 | 174 kAstValueFactoryOwned = 1 << 10 |
172 }; | 175 }; |
173 | 176 |
174 //------------- Inputs to parsing and scope analysis ----------------------- | 177 //------------- Inputs to parsing and scope analysis ----------------------- |
175 Zone* zone_; | 178 Zone* zone_; |
176 unsigned flags_; | 179 unsigned flags_; |
177 ScriptCompiler::ExternalSourceStream* source_stream_; | 180 ScriptCompiler::ExternalSourceStream* source_stream_; |
178 ScriptCompiler::StreamedSource::Encoding source_stream_encoding_; | 181 ScriptCompiler::StreamedSource::Encoding source_stream_encoding_; |
179 v8::Extension* extension_; | 182 v8::Extension* extension_; |
180 ScriptCompiler::CompileOptions compile_options_; | 183 ScriptCompiler::CompileOptions compile_options_; |
181 Scope* script_scope_; | 184 Scope* script_scope_; |
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 | 1240 |
1238 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1241 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1239 return parser_->ParseDoExpression(ok); | 1242 return parser_->ParseDoExpression(ok); |
1240 } | 1243 } |
1241 | 1244 |
1242 | 1245 |
1243 } // namespace internal | 1246 } // namespace internal |
1244 } // namespace v8 | 1247 } // namespace v8 |
1245 | 1248 |
1246 #endif // V8_PARSING_PARSER_H_ | 1249 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |