OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "src/allocation.h" | 7 #include "src/allocation.h" |
8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
9 #include "src/conversions-inl.h" | 9 #include "src/conversions-inl.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
11 #include "src/globals.h" | 11 #include "src/globals.h" |
12 #include "src/hashmap.h" | 12 #include "src/hashmap.h" |
13 #include "src/list.h" | 13 #include "src/list.h" |
14 #include "src/preparse-data.h" | 14 #include "src/preparse-data.h" |
15 #include "src/preparse-data-format.h" | 15 #include "src/preparse-data-format.h" |
16 #include "src/preparser.h" | 16 #include "src/preparser.h" |
17 #include "src/unicode.h" | 17 #include "src/unicode.h" |
18 #include "src/utils.h" | 18 #include "src/utils.h" |
19 | 19 |
20 namespace v8 { | 20 namespace v8 { |
21 namespace internal { | 21 namespace internal { |
22 | 22 |
23 void PreParserTraits::ReportMessageAt(Scanner::Location location, | 23 void PreParserTraits::ReportMessageAt(Scanner::Location location, |
24 const char* message, | 24 const char* message, const char* arg, |
25 const char* arg, | 25 ParseErrorType error_type) { |
26 bool is_reference_error) { | 26 ReportMessageAt(location.beg_pos, location.end_pos, message, arg, error_type); |
27 ReportMessageAt(location.beg_pos, | |
28 location.end_pos, | |
29 message, | |
30 arg, | |
31 is_reference_error); | |
32 } | 27 } |
33 | 28 |
34 | 29 |
35 void PreParserTraits::ReportMessageAt(int start_pos, | 30 void PreParserTraits::ReportMessageAt(int start_pos, int end_pos, |
36 int end_pos, | 31 const char* message, const char* arg, |
37 const char* message, | 32 ParseErrorType error_type) { |
38 const char* arg, | 33 pre_parser_->log_->LogMessage(start_pos, end_pos, message, arg, error_type); |
39 bool is_reference_error) { | |
40 pre_parser_->log_->LogMessage(start_pos, end_pos, message, arg, | |
41 is_reference_error); | |
42 } | 34 } |
43 | 35 |
44 | 36 |
45 PreParserIdentifier PreParserTraits::GetSymbol(Scanner* scanner) { | 37 PreParserIdentifier PreParserTraits::GetSymbol(Scanner* scanner) { |
46 if (scanner->current_token() == Token::FUTURE_RESERVED_WORD) { | 38 if (scanner->current_token() == Token::FUTURE_RESERVED_WORD) { |
47 return PreParserIdentifier::FutureReserved(); | 39 return PreParserIdentifier::FutureReserved(); |
48 } else if (scanner->current_token() == | 40 } else if (scanner->current_token() == |
49 Token::FUTURE_STRICT_RESERVED_WORD) { | 41 Token::FUTURE_STRICT_RESERVED_WORD) { |
50 return PreParserIdentifier::FutureStrictReserved(); | 42 return PreParserIdentifier::FutureStrictReserved(); |
51 } else if (scanner->current_token() == Token::LET) { | 43 } else if (scanner->current_token() == Token::LET) { |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); | 1023 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); |
1032 ParseArguments(ok); | 1024 ParseArguments(ok); |
1033 | 1025 |
1034 return Expression::Default(); | 1026 return Expression::Default(); |
1035 } | 1027 } |
1036 | 1028 |
1037 #undef CHECK_OK | 1029 #undef CHECK_OK |
1038 | 1030 |
1039 | 1031 |
1040 } } // v8::internal | 1032 } } // v8::internal |
OLD | NEW |