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" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #define DUMMY ) // to make indentation work | 34 #define DUMMY ) // to make indentation work |
35 #undef DUMMY | 35 #undef DUMMY |
36 | 36 |
37 // Used in functions where the return type is not ExpressionT. | 37 // Used in functions where the return type is not ExpressionT. |
38 #define CHECK_OK_CUSTOM(x) ok); \ | 38 #define CHECK_OK_CUSTOM(x) ok); \ |
39 if (!*ok) return this->x(); \ | 39 if (!*ok) return this->x(); \ |
40 ((void)0 | 40 ((void)0 |
41 #define DUMMY ) // to make indentation work | 41 #define DUMMY ) // to make indentation work |
42 #undef DUMMY | 42 #undef DUMMY |
43 | 43 |
44 void ParserBaseTraits<PreParser>::ReportMessageAt( | |
45 Scanner::Location source_location, MessageTemplate::Template message, | |
46 const char* arg, ParseErrorType error_type) { | |
47 delegate()->log_->LogMessage(source_location.beg_pos, source_location.end_pos, | |
48 message, arg, error_type); | |
49 } | |
50 | |
51 void ParserBaseTraits<PreParser>::ReportMessageAt( | |
52 Scanner::Location source_location, MessageTemplate::Template message, | |
53 const AstRawString* arg, ParseErrorType error_type) { | |
54 UNREACHABLE(); | |
55 } | |
56 | |
57 PreParserIdentifier ParserBaseTraits<PreParser>::GetSymbol( | 44 PreParserIdentifier ParserBaseTraits<PreParser>::GetSymbol( |
58 Scanner* scanner) const { | 45 Scanner* scanner) const { |
59 switch (scanner->current_token()) { | 46 switch (scanner->current_token()) { |
60 case Token::ENUM: | 47 case Token::ENUM: |
61 return PreParserIdentifier::Enum(); | 48 return PreParserIdentifier::Enum(); |
62 case Token::AWAIT: | 49 case Token::AWAIT: |
63 return PreParserIdentifier::Await(); | 50 return PreParserIdentifier::Await(); |
64 case Token::FUTURE_STRICT_RESERVED_WORD: | 51 case Token::FUTURE_STRICT_RESERVED_WORD: |
65 return PreParserIdentifier::FutureStrictReserved(); | 52 return PreParserIdentifier::FutureStrictReserved(); |
66 case Token::LET: | 53 case Token::LET: |
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 | 1249 |
1263 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); | 1250 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); |
1264 } | 1251 } |
1265 | 1252 |
1266 #undef CHECK_OK | 1253 #undef CHECK_OK |
1267 #undef CHECK_OK_CUSTOM | 1254 #undef CHECK_OK_CUSTOM |
1268 | 1255 |
1269 | 1256 |
1270 } // namespace internal | 1257 } // namespace internal |
1271 } // namespace v8 | 1258 } // namespace v8 |
OLD | NEW |