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/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/ast-expression-rewriter.h" | 9 #include "src/ast/ast-expression-rewriter.h" |
10 #include "src/ast/ast-expression-visitor.h" | 10 #include "src/ast/ast-expression-visitor.h" |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
927 // Enter 'scope' with the given parsing mode. | 927 // Enter 'scope' with the given parsing mode. |
928 ParsingModeScope parsing_mode_scope(this, parsing_mode); | 928 ParsingModeScope parsing_mode_scope(this, parsing_mode); |
929 AstNodeFactory function_factory(ast_value_factory()); | 929 AstNodeFactory function_factory(ast_value_factory()); |
930 FunctionState function_state(&function_state_, &scope_, scope, | 930 FunctionState function_state(&function_state_, &scope_, scope, |
931 kNormalFunction, &function_factory); | 931 kNormalFunction, &function_factory); |
932 | 932 |
933 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone()); | 933 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone()); |
934 bool ok = true; | 934 bool ok = true; |
935 int beg_pos = scanner()->location().beg_pos; | 935 int beg_pos = scanner()->location().beg_pos; |
936 parsing_module_ = info->is_module(); | 936 parsing_module_ = info->is_module(); |
937 scanner_.set_allow_html_comments(parsing_module_); | |
vogelheim
2016/05/27 08:08:49
Also, do we know whether Parser + Pre-Parser will
vogelheim
2016/05/27 08:08:49
So... if a file is being parsed top-to-bottom, The
| |
937 if (parsing_module_) { | 938 if (parsing_module_) { |
938 ParseModuleItemList(body, &ok); | 939 ParseModuleItemList(body, &ok); |
939 } else { | 940 } else { |
940 // Don't count the mode in the use counters--give the program a chance | 941 // Don't count the mode in the use counters--give the program a chance |
941 // to enable script-wide strict mode below. | 942 // to enable script-wide strict mode below. |
942 scope_->SetLanguageMode(info->language_mode()); | 943 scope_->SetLanguageMode(info->language_mode()); |
943 ParseStatementList(body, Token::EOS, &ok); | 944 ParseStatementList(body, Token::EOS, &ok); |
944 } | 945 } |
945 | 946 |
946 // The parser will peek but not consume EOS. Our scope logically goes all | 947 // The parser will peek but not consume EOS. Our scope logically goes all |
(...skipping 5965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6912 try_block, target); | 6913 try_block, target); |
6913 final_loop = target; | 6914 final_loop = target; |
6914 } | 6915 } |
6915 | 6916 |
6916 return final_loop; | 6917 return final_loop; |
6917 } | 6918 } |
6918 | 6919 |
6919 | 6920 |
6920 } // namespace internal | 6921 } // namespace internal |
6921 } // namespace v8 | 6922 } // namespace v8 |
OLD | NEW |