| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 case Token::CONST: | 186 case Token::CONST: |
| 187 if (allow_const()) { | 187 if (allow_const()) { |
| 188 return ParseVariableStatement(kStatementListItem, ok); | 188 return ParseVariableStatement(kStatementListItem, ok); |
| 189 } | 189 } |
| 190 break; | 190 break; |
| 191 case Token::LET: | 191 case Token::LET: |
| 192 if (IsNextLetKeyword()) { | 192 if (IsNextLetKeyword()) { |
| 193 return ParseVariableStatement(kStatementListItem, ok); | 193 return ParseVariableStatement(kStatementListItem, ok); |
| 194 } | 194 } |
| 195 break; | 195 break; |
| 196 case Token::IDENTIFIER: { | 196 case Token::IDENTIFIER: |
| 197 case Token::FUTURE_STRICT_RESERVED_WORD: { |
| 197 if (!scope_->typed()) break; | 198 if (!scope_->typed()) break; |
| 198 int pos = peek_position(); | 199 int pos = peek_position(); |
| 199 if (CheckContextualKeyword(CStrVector("type"))) { | 200 if (CheckContextualKeyword(CStrVector("type"))) { |
| 200 return ParseTypeAliasDeclaration(pos, ok); | 201 return ParseTypeAliasDeclaration(pos, ok); |
| 202 } else if (CheckContextualKeyword(CStrVector("interface"))) { |
| 203 return ParseInterfaceDeclaration(pos, ok); |
| 201 } | 204 } |
| 202 break; | 205 break; |
| 203 } | 206 } |
| 204 // TODO(nikolaos): interface | |
| 205 // TODO(nikolaos): ambient | 207 // TODO(nikolaos): ambient |
| 206 default: | 208 default: |
| 207 break; | 209 break; |
| 208 } | 210 } |
| 209 return ParseStatement(ok); | 211 return ParseStatement(ok); |
| 210 } | 212 } |
| 211 | 213 |
| 212 | 214 |
| 213 void PreParser::ParseStatementList(int end_token, bool* ok, | 215 void PreParser::ParseStatementList(int end_token, bool* ok, |
| 214 Scanner::BookmarkScope* bookmark) { | 216 Scanner::BookmarkScope* bookmark) { |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1217 Expect(Token::RBRACE, CHECK_OK); | 1219 Expect(Token::RBRACE, CHECK_OK); |
| 1218 return PreParserExpression::Default(); | 1220 return PreParserExpression::Default(); |
| 1219 } | 1221 } |
| 1220 } | 1222 } |
| 1221 | 1223 |
| 1222 #undef CHECK_OK | 1224 #undef CHECK_OK |
| 1223 | 1225 |
| 1224 | 1226 |
| 1225 } // namespace internal | 1227 } // namespace internal |
| 1226 } // namespace v8 | 1228 } // namespace v8 |
| OLD | NEW |