| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:analyzer/dart/ast/ast.dart'; | 5 import 'package:analyzer/dart/ast/ast.dart'; |
| 6 import 'package:analyzer/dart/ast/token.dart' as analyzer; | 6 import 'package:analyzer/dart/ast/token.dart' as analyzer; |
| 7 import 'package:analyzer/dart/ast/token.dart' show TokenType; | 7 import 'package:analyzer/dart/ast/token.dart' show TokenType; |
| 8 import 'package:analyzer/error/error.dart'; | 8 import 'package:analyzer/error/error.dart'; |
| 9 import 'package:analyzer/error/listener.dart' show ErrorReporter; | 9 import 'package:analyzer/error/listener.dart' show ErrorReporter; |
| 10 import 'package:analyzer/src/dart/scanner/scanner.dart'; | 10 import 'package:analyzer/src/dart/scanner/scanner.dart'; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 292 } |
| 293 | 293 |
| 294 @override | 294 @override |
| 295 @failingTest | 295 @failingTest |
| 296 void test_constMethod() { | 296 void test_constMethod() { |
| 297 super.test_constMethod(); | 297 super.test_constMethod(); |
| 298 } | 298 } |
| 299 | 299 |
| 300 @override | 300 @override |
| 301 @failingTest | 301 @failingTest |
| 302 void test_constTypedef() { | |
| 303 super.test_constTypedef(); | |
| 304 } | |
| 305 | |
| 306 @override | |
| 307 @failingTest | |
| 308 void test_constructorWithReturnType() { | 302 void test_constructorWithReturnType() { |
| 309 super.test_constructorWithReturnType(); | 303 super.test_constructorWithReturnType(); |
| 310 } | 304 } |
| 311 | 305 |
| 312 @override | 306 @override |
| 313 @failingTest | 307 @failingTest |
| 314 void test_constructorWithReturnType_var() { | 308 void test_constructorWithReturnType_var() { |
| 315 super.test_constructorWithReturnType_var(); | 309 super.test_constructorWithReturnType_var(); |
| 316 } | 310 } |
| 317 | 311 |
| 318 @override | 312 @override |
| 319 @failingTest | 313 @failingTest |
| 314 void test_constTypedef() { |
| 315 super.test_constTypedef(); |
| 316 } |
| 317 |
| 318 @override |
| 319 @failingTest |
| 320 void test_continueOutsideOfLoop_continueInDoStatement() { | 320 void test_continueOutsideOfLoop_continueInDoStatement() { |
| 321 super.test_continueOutsideOfLoop_continueInDoStatement(); | 321 super.test_continueOutsideOfLoop_continueInDoStatement(); |
| 322 } | 322 } |
| 323 | 323 |
| 324 @override | 324 @override |
| 325 @failingTest | 325 @failingTest |
| 326 void test_continueOutsideOfLoop_continueInForStatement() { | 326 void test_continueOutsideOfLoop_continueInForStatement() { |
| 327 super.test_continueOutsideOfLoop_continueInForStatement(); | 327 super.test_continueOutsideOfLoop_continueInForStatement(); |
| 328 } | 328 } |
| 329 | 329 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 } | 448 } |
| 449 | 449 |
| 450 @override | 450 @override |
| 451 @failingTest | 451 @failingTest |
| 452 void test_directiveAfterDeclaration_classBetweenDirectives() { | 452 void test_directiveAfterDeclaration_classBetweenDirectives() { |
| 453 super.test_directiveAfterDeclaration_classBetweenDirectives(); | 453 super.test_directiveAfterDeclaration_classBetweenDirectives(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 @override | 456 @override |
| 457 @failingTest | 457 @failingTest |
| 458 void test_duplicateLabelInSwitchStatement() { | |
| 459 super.test_duplicateLabelInSwitchStatement(); | |
| 460 } | |
| 461 | |
| 462 @override | |
| 463 @failingTest | |
| 464 void test_duplicatedModifier_const() { | 458 void test_duplicatedModifier_const() { |
| 465 super.test_duplicatedModifier_const(); | 459 super.test_duplicatedModifier_const(); |
| 466 } | 460 } |
| 467 | 461 |
| 468 @override | 462 @override |
| 469 @failingTest | 463 @failingTest |
| 470 void test_duplicatedModifier_external() { | 464 void test_duplicatedModifier_external() { |
| 471 super.test_duplicatedModifier_external(); | 465 super.test_duplicatedModifier_external(); |
| 472 } | 466 } |
| 473 | 467 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 490 } | 484 } |
| 491 | 485 |
| 492 @override | 486 @override |
| 493 @failingTest | 487 @failingTest |
| 494 void test_duplicatedModifier_var() { | 488 void test_duplicatedModifier_var() { |
| 495 super.test_duplicatedModifier_var(); | 489 super.test_duplicatedModifier_var(); |
| 496 } | 490 } |
| 497 | 491 |
| 498 @override | 492 @override |
| 499 @failingTest | 493 @failingTest |
| 494 void test_duplicateLabelInSwitchStatement() { |
| 495 super.test_duplicateLabelInSwitchStatement(); |
| 496 } |
| 497 |
| 498 @override |
| 499 @failingTest |
| 500 void test_emptyEnumBody() { | 500 void test_emptyEnumBody() { |
| 501 super.test_emptyEnumBody(); | 501 super.test_emptyEnumBody(); |
| 502 } | 502 } |
| 503 | 503 |
| 504 @override | 504 @override |
| 505 @failingTest | 505 @failingTest |
| 506 void test_enumInClass() { | 506 void test_enumInClass() { |
| 507 super.test_enumInClass(); | 507 super.test_enumInClass(); |
| 508 } | 508 } |
| 509 | 509 |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 } | 1313 } |
| 1314 | 1314 |
| 1315 @override | 1315 @override |
| 1316 @failingTest | 1316 @failingTest |
| 1317 void test_missingFunctionParameters_topLevel_void_expression() { | 1317 void test_missingFunctionParameters_topLevel_void_expression() { |
| 1318 super.test_missingFunctionParameters_topLevel_void_expression(); | 1318 super.test_missingFunctionParameters_topLevel_void_expression(); |
| 1319 } | 1319 } |
| 1320 | 1320 |
| 1321 @override | 1321 @override |
| 1322 @failingTest | 1322 @failingTest |
| 1323 void test_missingIdentifierForParameterGroup() { | |
| 1324 super.test_missingIdentifierForParameterGroup(); | |
| 1325 } | |
| 1326 | |
| 1327 @override | |
| 1328 @failingTest | |
| 1329 void test_missingIdentifier_afterOperator() { | 1323 void test_missingIdentifier_afterOperator() { |
| 1330 super.test_missingIdentifier_afterOperator(); | 1324 super.test_missingIdentifier_afterOperator(); |
| 1331 } | 1325 } |
| 1332 | 1326 |
| 1333 @override | 1327 @override |
| 1334 @failingTest | 1328 @failingTest |
| 1335 void test_missingIdentifier_beforeClosingCurly() { | 1329 void test_missingIdentifier_beforeClosingCurly() { |
| 1336 super.test_missingIdentifier_beforeClosingCurly(); | 1330 super.test_missingIdentifier_beforeClosingCurly(); |
| 1337 } | 1331 } |
| 1338 | 1332 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1355 } | 1349 } |
| 1356 | 1350 |
| 1357 @override | 1351 @override |
| 1358 @failingTest | 1352 @failingTest |
| 1359 void test_missingIdentifier_number() { | 1353 void test_missingIdentifier_number() { |
| 1360 super.test_missingIdentifier_number(); | 1354 super.test_missingIdentifier_number(); |
| 1361 } | 1355 } |
| 1362 | 1356 |
| 1363 @override | 1357 @override |
| 1364 @failingTest | 1358 @failingTest |
| 1359 void test_missingIdentifierForParameterGroup() { |
| 1360 super.test_missingIdentifierForParameterGroup(); |
| 1361 } |
| 1362 |
| 1363 @override |
| 1364 @failingTest |
| 1365 void test_missingKeywordOperator() { | 1365 void test_missingKeywordOperator() { |
| 1366 super.test_missingKeywordOperator(); | 1366 super.test_missingKeywordOperator(); |
| 1367 } | 1367 } |
| 1368 | 1368 |
| 1369 @override | 1369 @override |
| 1370 @failingTest | 1370 @failingTest |
| 1371 void test_missingKeywordOperator_parseClassMember() { | 1371 void test_missingKeywordOperator_parseClassMember() { |
| 1372 super.test_missingKeywordOperator_parseClassMember(); | 1372 super.test_missingKeywordOperator_parseClassMember(); |
| 1373 } | 1373 } |
| 1374 | 1374 |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 } | 1799 } |
| 1800 | 1800 |
| 1801 @override | 1801 @override |
| 1802 @failingTest | 1802 @failingTest |
| 1803 void test_switchHasMultipleDefaultCases_repeated() { | 1803 void test_switchHasMultipleDefaultCases_repeated() { |
| 1804 super.test_switchHasMultipleDefaultCases_repeated(); | 1804 super.test_switchHasMultipleDefaultCases_repeated(); |
| 1805 } | 1805 } |
| 1806 | 1806 |
| 1807 @override | 1807 @override |
| 1808 @failingTest | 1808 @failingTest |
| 1809 void test_topLevelOperator_withoutType() { |
| 1810 super.test_topLevelOperator_withoutType(); |
| 1811 } |
| 1812 |
| 1813 @override |
| 1814 @failingTest |
| 1809 void test_topLevelOperator_withType() { | 1815 void test_topLevelOperator_withType() { |
| 1810 super.test_topLevelOperator_withType(); | 1816 super.test_topLevelOperator_withType(); |
| 1811 } | 1817 } |
| 1812 | 1818 |
| 1813 @override | 1819 @override |
| 1814 @failingTest | 1820 @failingTest |
| 1815 void test_topLevelOperator_withVoid() { | 1821 void test_topLevelOperator_withVoid() { |
| 1816 super.test_topLevelOperator_withVoid(); | 1822 super.test_topLevelOperator_withVoid(); |
| 1817 } | 1823 } |
| 1818 | 1824 |
| 1819 @override | 1825 @override |
| 1820 @failingTest | |
| 1821 void test_topLevelOperator_withoutType() { | |
| 1822 super.test_topLevelOperator_withoutType(); | |
| 1823 } | |
| 1824 | |
| 1825 @override | |
| 1826 @failingTest | 1826 @failingTest |
| 1827 void test_topLevelVariable_withMetadata() { | 1827 void test_topLevelVariable_withMetadata() { |
| 1828 super.test_topLevelVariable_withMetadata(); | 1828 super.test_topLevelVariable_withMetadata(); |
| 1829 } | 1829 } |
| 1830 | 1830 |
| 1831 @override | 1831 @override |
| 1832 @failingTest | 1832 @failingTest |
| 1833 void test_typedefInClass_withReturnType() { | |
| 1834 super.test_typedefInClass_withReturnType(); | |
| 1835 } | |
| 1836 | |
| 1837 @override | |
| 1838 @failingTest | |
| 1839 void test_typedefInClass_withoutReturnType() { | |
| 1840 super.test_typedefInClass_withoutReturnType(); | |
| 1841 } | |
| 1842 | |
| 1843 @override | |
| 1844 @failingTest | |
| 1845 void test_typedef_incomplete() { | 1833 void test_typedef_incomplete() { |
| 1846 super.test_typedef_incomplete(); | 1834 super.test_typedef_incomplete(); |
| 1847 } | 1835 } |
| 1848 | 1836 |
| 1849 @override | 1837 @override |
| 1850 @failingTest | 1838 @failingTest |
| 1851 void test_typedef_namedFunction() { | 1839 void test_typedef_namedFunction() { |
| 1852 super.test_typedef_namedFunction(); | 1840 super.test_typedef_namedFunction(); |
| 1853 } | 1841 } |
| 1854 | 1842 |
| 1855 @override | 1843 @override |
| 1844 @failingTest |
| 1845 void test_typedefInClass_withoutReturnType() { |
| 1846 super.test_typedefInClass_withoutReturnType(); |
| 1847 } |
| 1848 |
| 1849 @override |
| 1850 @failingTest |
| 1851 void test_typedefInClass_withReturnType() { |
| 1852 super.test_typedefInClass_withReturnType(); |
| 1853 } |
| 1854 |
| 1855 @override |
| 1856 @failingTest | 1856 @failingTest |
| 1857 void test_unexpectedTerminatorForParameterGroup_named() { | 1857 void test_unexpectedTerminatorForParameterGroup_named() { |
| 1858 super.test_unexpectedTerminatorForParameterGroup_named(); | 1858 super.test_unexpectedTerminatorForParameterGroup_named(); |
| 1859 } | 1859 } |
| 1860 | 1860 |
| 1861 @override | 1861 @override |
| 1862 @failingTest | 1862 @failingTest |
| 1863 void test_unexpectedTerminatorForParameterGroup_optional() { | 1863 void test_unexpectedTerminatorForParameterGroup_optional() { |
| 1864 super.test_unexpectedTerminatorForParameterGroup_optional(); | 1864 super.test_unexpectedTerminatorForParameterGroup_optional(); |
| 1865 } | 1865 } |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1991 } | 1991 } |
| 1992 | 1992 |
| 1993 @override | 1993 @override |
| 1994 @failingTest | 1994 @failingTest |
| 1995 void test_voidVariable_parseClassMember_noInitializer() { | 1995 void test_voidVariable_parseClassMember_noInitializer() { |
| 1996 super.test_voidVariable_parseClassMember_noInitializer(); | 1996 super.test_voidVariable_parseClassMember_noInitializer(); |
| 1997 } | 1997 } |
| 1998 | 1998 |
| 1999 @override | 1999 @override |
| 2000 @failingTest | 2000 @failingTest |
| 2001 void test_voidVariable_parseCompilationUnit_initializer() { |
| 2002 super.test_voidVariable_parseCompilationUnit_initializer(); |
| 2003 } |
| 2004 |
| 2005 @override |
| 2006 @failingTest |
| 2007 void test_voidVariable_parseCompilationUnit_noInitializer() { |
| 2008 super.test_voidVariable_parseCompilationUnit_noInitializer(); |
| 2009 } |
| 2010 |
| 2011 @override |
| 2012 @failingTest |
| 2001 void test_voidVariable_parseCompilationUnitMember_initializer() { | 2013 void test_voidVariable_parseCompilationUnitMember_initializer() { |
| 2002 super.test_voidVariable_parseCompilationUnitMember_initializer(); | 2014 super.test_voidVariable_parseCompilationUnitMember_initializer(); |
| 2003 } | 2015 } |
| 2004 | 2016 |
| 2005 @override | 2017 @override |
| 2006 @failingTest | 2018 @failingTest |
| 2007 void test_voidVariable_parseCompilationUnitMember_noInitializer() { | 2019 void test_voidVariable_parseCompilationUnitMember_noInitializer() { |
| 2008 super.test_voidVariable_parseCompilationUnitMember_noInitializer(); | 2020 super.test_voidVariable_parseCompilationUnitMember_noInitializer(); |
| 2009 } | 2021 } |
| 2010 | 2022 |
| 2011 @override | 2023 @override |
| 2012 @failingTest | |
| 2013 void test_voidVariable_parseCompilationUnit_initializer() { | |
| 2014 super.test_voidVariable_parseCompilationUnit_initializer(); | |
| 2015 } | |
| 2016 | |
| 2017 @override | |
| 2018 @failingTest | |
| 2019 void test_voidVariable_parseCompilationUnit_noInitializer() { | |
| 2020 super.test_voidVariable_parseCompilationUnit_noInitializer(); | |
| 2021 } | |
| 2022 | |
| 2023 @override | |
| 2024 @failingTest | 2024 @failingTest |
| 2025 void test_voidVariable_statement_initializer() { | 2025 void test_voidVariable_statement_initializer() { |
| 2026 super.test_voidVariable_statement_initializer(); | 2026 super.test_voidVariable_statement_initializer(); |
| 2027 } | 2027 } |
| 2028 | 2028 |
| 2029 @override | 2029 @override |
| 2030 @failingTest | 2030 @failingTest |
| 2031 void test_voidVariable_statement_noInitializer() { | 2031 void test_voidVariable_statement_noInitializer() { |
| 2032 super.test_voidVariable_statement_noInitializer(); | 2032 super.test_voidVariable_statement_noInitializer(); |
| 2033 } | 2033 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2180 */ | 2180 */ |
| 2181 class FastaParserTestCase extends Object | 2181 class FastaParserTestCase extends Object |
| 2182 with ParserTestHelpers | 2182 with ParserTestHelpers |
| 2183 implements AbstractParserTestCase { | 2183 implements AbstractParserTestCase { |
| 2184 ParserProxy _parserProxy; | 2184 ParserProxy _parserProxy; |
| 2185 analyzer.Token _fastaTokens; | 2185 analyzer.Token _fastaTokens; |
| 2186 | 2186 |
| 2187 @override | 2187 @override |
| 2188 bool allowNativeClause = false; | 2188 bool allowNativeClause = false; |
| 2189 | 2189 |
| 2190 @override | |
| 2191 GatheringErrorListener get listener => _parserProxy._errorListener; | |
| 2192 | |
| 2193 /** | 2190 /** |
| 2194 * Whether generic method comments should be enabled for the test. | 2191 * Whether generic method comments should be enabled for the test. |
| 2195 */ | 2192 */ |
| 2196 bool enableGenericMethodComments = false; | 2193 bool enableGenericMethodComments = false; |
| 2197 | 2194 |
| 2198 @override | 2195 @override |
| 2199 set enableAssertInitializer(bool value) { | 2196 set enableAssertInitializer(bool value) { |
| 2200 if (value == true) { | 2197 if (value == true) { |
| 2201 // TODO(paulberry,ahe): it looks like asserts in initializer lists are not | 2198 // TODO(paulberry,ahe): it looks like asserts in initializer lists are not |
| 2202 // supported by Fasta. | 2199 // supported by Fasta. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2223 | 2220 |
| 2224 @override | 2221 @override |
| 2225 set enableUriInPartOf(bool value) { | 2222 set enableUriInPartOf(bool value) { |
| 2226 if (value == false) { | 2223 if (value == false) { |
| 2227 throw new UnimplementedError( | 2224 throw new UnimplementedError( |
| 2228 'URIs in "part of" declarations cannot be disabled in Fasta.'); | 2225 'URIs in "part of" declarations cannot be disabled in Fasta.'); |
| 2229 } | 2226 } |
| 2230 } | 2227 } |
| 2231 | 2228 |
| 2232 @override | 2229 @override |
| 2230 GatheringErrorListener get listener => _parserProxy._errorListener; |
| 2231 |
| 2232 @override |
| 2233 analyzer.Parser get parser => _parserProxy; | 2233 analyzer.Parser get parser => _parserProxy; |
| 2234 | 2234 |
| 2235 @override | 2235 @override |
| 2236 bool get usingFastaParser => true; | 2236 bool get usingFastaParser => true; |
| 2237 | 2237 |
| 2238 @override | 2238 @override |
| 2239 void assertErrorsWithCodes(List<ErrorCode> expectedErrorCodes) { | 2239 void assertErrorsWithCodes(List<ErrorCode> expectedErrorCodes) { |
| 2240 expectedErrorCodes = expectedErrorCodes.map((code) { | 2240 expectedErrorCodes = expectedErrorCodes.map((code) { |
| 2241 if (code == ParserErrorCode.ABSTRACT_CLASS_MEMBER) | 2241 if (code == ParserErrorCode.ABSTRACT_CLASS_MEMBER) |
| 2242 return ParserErrorCode.EXTRANEOUS_MODIFIER; | 2242 return ParserErrorCode.EXTRANEOUS_MODIFIER; |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2614 super.test_parseFormalParameterList_prefixedType_partial(); | 2614 super.test_parseFormalParameterList_prefixedType_partial(); |
| 2615 } | 2615 } |
| 2616 | 2616 |
| 2617 @override | 2617 @override |
| 2618 @failingTest | 2618 @failingTest |
| 2619 void test_parseFormalParameterList_prefixedType_partial2() { | 2619 void test_parseFormalParameterList_prefixedType_partial2() { |
| 2620 // TODO(scheglov): Unimplemented: errors | 2620 // TODO(scheglov): Unimplemented: errors |
| 2621 super.test_parseFormalParameterList_prefixedType_partial2(); | 2621 super.test_parseFormalParameterList_prefixedType_partial2(); |
| 2622 } | 2622 } |
| 2623 | 2623 |
| 2624 @failingTest |
| 2625 void test_parseNormalFormalParameter_field_const_noType2() { |
| 2626 // TODO(danrubel): should not be generating an error |
| 2627 super.test_parseNormalFormalParameter_field_const_noType(); |
| 2628 assertNoErrors(); |
| 2629 } |
| 2630 |
| 2631 @failingTest |
| 2632 void test_parseNormalFormalParameter_field_const_type2() { |
| 2633 // TODO(danrubel): should not be generating an error |
| 2634 super.test_parseNormalFormalParameter_field_const_type(); |
| 2635 assertNoErrors(); |
| 2636 } |
| 2637 |
| 2624 @override | 2638 @override |
| 2625 @failingTest | 2639 @failingTest |
| 2626 void test_parseNormalFormalParameter_function_noType_nullable() { | 2640 void test_parseNormalFormalParameter_function_noType_nullable() { |
| 2627 // TODO(scheglov): Not implemented: Nnbd | 2641 // TODO(scheglov): Not implemented: Nnbd |
| 2628 super.test_parseNormalFormalParameter_function_noType_nullable(); | 2642 super.test_parseNormalFormalParameter_function_noType_nullable(); |
| 2629 } | 2643 } |
| 2630 | 2644 |
| 2631 @override | 2645 @override |
| 2632 @failingTest | 2646 @failingTest |
| 2633 void | 2647 void |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2661 | 2675 |
| 2662 @override | 2676 @override |
| 2663 @failingTest | 2677 @failingTest |
| 2664 void test_parseNormalFormalParameter_function_void_typeParameters_nullable() { | 2678 void test_parseNormalFormalParameter_function_void_typeParameters_nullable() { |
| 2665 // TODO(scheglov): Not implemented: Nnbd | 2679 // TODO(scheglov): Not implemented: Nnbd |
| 2666 super | 2680 super |
| 2667 .test_parseNormalFormalParameter_function_void_typeParameters_nullable()
; | 2681 .test_parseNormalFormalParameter_function_void_typeParameters_nullable()
; |
| 2668 } | 2682 } |
| 2669 | 2683 |
| 2670 @failingTest | 2684 @failingTest |
| 2671 void test_parseNormalFormalParameter_field_const_noType2() { | |
| 2672 // TODO(danrubel): should not be generating an error | |
| 2673 super.test_parseNormalFormalParameter_field_const_noType(); | |
| 2674 assertNoErrors(); | |
| 2675 } | |
| 2676 | |
| 2677 @failingTest | |
| 2678 void test_parseNormalFormalParameter_field_const_type2() { | |
| 2679 // TODO(danrubel): should not be generating an error | |
| 2680 super.test_parseNormalFormalParameter_field_const_type(); | |
| 2681 assertNoErrors(); | |
| 2682 } | |
| 2683 | |
| 2684 @failingTest | |
| 2685 void test_parseNormalFormalParameter_simple_const_noType2() { | 2685 void test_parseNormalFormalParameter_simple_const_noType2() { |
| 2686 // TODO(danrubel): should not be generating an error | 2686 // TODO(danrubel): should not be generating an error |
| 2687 super.test_parseNormalFormalParameter_simple_const_noType(); | 2687 super.test_parseNormalFormalParameter_simple_const_noType(); |
| 2688 assertNoErrors(); | 2688 assertNoErrors(); |
| 2689 } | 2689 } |
| 2690 | 2690 |
| 2691 @failingTest | 2691 @failingTest |
| 2692 void test_parseNormalFormalParameter_simple_const_type2() { | 2692 void test_parseNormalFormalParameter_simple_const_type2() { |
| 2693 // TODO(danrubel): should not be generating an error | 2693 // TODO(danrubel): should not be generating an error |
| 2694 super.test_parseNormalFormalParameter_simple_const_type(); | 2694 super.test_parseNormalFormalParameter_simple_const_type(); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2914 super.test_parseTryStatement_on_catch_finally(); | 2914 super.test_parseTryStatement_on_catch_finally(); |
| 2915 } | 2915 } |
| 2916 } | 2916 } |
| 2917 | 2917 |
| 2918 /** | 2918 /** |
| 2919 * Tests of the fasta parser based on [TopLevelParserTestMixin]. | 2919 * Tests of the fasta parser based on [TopLevelParserTestMixin]. |
| 2920 */ | 2920 */ |
| 2921 @reflectiveTest | 2921 @reflectiveTest |
| 2922 class TopLevelParserTest_Fasta extends FastaParserTestCase | 2922 class TopLevelParserTest_Fasta extends FastaParserTestCase |
| 2923 with TopLevelParserTestMixin { | 2923 with TopLevelParserTestMixin { |
| 2924 void test_parseClassDeclaration_native_allowed() { |
| 2925 allowNativeClause = true; |
| 2926 test_parseClassDeclaration_native(); |
| 2927 } |
| 2928 |
| 2924 void test_parseClassDeclaration_native_missing_literal() { | 2929 void test_parseClassDeclaration_native_missing_literal() { |
| 2925 createParser('class A native {}'); | 2930 createParser('class A native {}'); |
| 2926 CompilationUnitMember member = parseFullCompilationUnitMember(); | 2931 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 2927 expect(member, isNotNull); | 2932 expect(member, isNotNull); |
| 2928 if (allowNativeClause) { | 2933 if (allowNativeClause) { |
| 2929 assertNoErrors(); | 2934 assertNoErrors(); |
| 2930 } else { | 2935 } else { |
| 2931 assertErrorsWithCodes([ | 2936 assertErrorsWithCodes([ |
| 2932 ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, | 2937 ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, |
| 2933 ]); | 2938 ]); |
| 2934 } | 2939 } |
| 2935 expect(member, new isInstanceOf<ClassDeclaration>()); | 2940 expect(member, new isInstanceOf<ClassDeclaration>()); |
| 2936 ClassDeclaration declaration = member; | 2941 ClassDeclaration declaration = member; |
| 2937 expect(declaration.nativeClause, isNotNull); | 2942 expect(declaration.nativeClause, isNotNull); |
| 2938 expect(declaration.nativeClause.nativeKeyword, isNotNull); | 2943 expect(declaration.nativeClause.nativeKeyword, isNotNull); |
| 2939 expect(declaration.nativeClause.name, isNull); | 2944 expect(declaration.nativeClause.name, isNull); |
| 2940 expect(declaration.endToken.type, TokenType.CLOSE_CURLY_BRACKET); | 2945 expect(declaration.endToken.type, TokenType.CLOSE_CURLY_BRACKET); |
| 2941 } | 2946 } |
| 2942 | 2947 |
| 2943 void test_parseClassDeclaration_native_allowed() { | |
| 2944 allowNativeClause = true; | |
| 2945 test_parseClassDeclaration_native(); | |
| 2946 } | |
| 2947 | |
| 2948 void test_parseClassDeclaration_native_missing_literal_allowed() { | 2948 void test_parseClassDeclaration_native_missing_literal_allowed() { |
| 2949 allowNativeClause = true; | 2949 allowNativeClause = true; |
| 2950 test_parseClassDeclaration_native_missing_literal(); | 2950 test_parseClassDeclaration_native_missing_literal(); |
| 2951 } | 2951 } |
| 2952 | 2952 |
| 2953 void test_parseClassDeclaration_native_missing_literal_not_allowed() { | 2953 void test_parseClassDeclaration_native_missing_literal_not_allowed() { |
| 2954 allowNativeClause = false; | 2954 allowNativeClause = false; |
| 2955 test_parseClassDeclaration_native_missing_literal(); | 2955 test_parseClassDeclaration_native_missing_literal(); |
| 2956 } | 2956 } |
| 2957 | 2957 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2976 super.test_parseCompilationUnit_exportAsPrefix(); | 2976 super.test_parseCompilationUnit_exportAsPrefix(); |
| 2977 } | 2977 } |
| 2978 | 2978 |
| 2979 @override | 2979 @override |
| 2980 @failingTest | 2980 @failingTest |
| 2981 void test_parseCompilationUnit_exportAsPrefix_parameterized() { | 2981 void test_parseCompilationUnit_exportAsPrefix_parameterized() { |
| 2982 // TODO(paulberry): As of commit 5de9108 this syntax is invalid. | 2982 // TODO(paulberry): As of commit 5de9108 this syntax is invalid. |
| 2983 super.test_parseCompilationUnit_exportAsPrefix_parameterized(); | 2983 super.test_parseCompilationUnit_exportAsPrefix_parameterized(); |
| 2984 } | 2984 } |
| 2985 | 2985 |
| 2986 @override | |
| 2987 @failingTest | |
| 2988 void test_parseDirectives_mixed() { | |
| 2989 // TODO(paulberry,ahe): This test verifies the analyzer parser's ability to | |
| 2990 // stop parsing as soon as the first non-directive is encountered; this is | |
| 2991 // useful for quickly traversing an import graph. Consider adding a similar | |
| 2992 // ability to Fasta's parser. | |
| 2993 super.test_parseDirectives_mixed(); | |
| 2994 } | |
| 2995 | |
| 2996 @failingTest | 2986 @failingTest |
| 2997 void test_parseCompilationUnit_operatorAsPrefix_parameterized2() { | 2987 void test_parseCompilationUnit_operatorAsPrefix_parameterized2() { |
| 2998 // TODO(danrubel): should not be generating an error | 2988 // TODO(danrubel): should not be generating an error |
| 2999 super.test_parseCompilationUnit_operatorAsPrefix_parameterized(); | 2989 super.test_parseCompilationUnit_operatorAsPrefix_parameterized(); |
| 3000 assertNoErrors(); | 2990 assertNoErrors(); |
| 3001 } | 2991 } |
| 3002 | 2992 |
| 3003 @failingTest | 2993 @failingTest |
| 3004 void test_parseCompilationUnit_typedefAsPrefix2() { | 2994 void test_parseCompilationUnit_typedefAsPrefix2() { |
| 3005 // TODO(danrubel): should not be generating an error | 2995 // TODO(danrubel): should not be generating an error |
| 3006 super.test_parseCompilationUnit_typedefAsPrefix(); | 2996 super.test_parseCompilationUnit_typedefAsPrefix(); |
| 3007 assertNoErrors(); | 2997 assertNoErrors(); |
| 3008 } | 2998 } |
| 3009 | 2999 |
| 3010 @failingTest | 3000 @failingTest |
| 3011 void test_parseCompilationUnitMember_abstractAsPrefix2() { | 3001 void test_parseCompilationUnitMember_abstractAsPrefix2() { |
| 3012 // TODO(danrubel): should not be generating an error | 3002 // TODO(danrubel): should not be generating an error |
| 3013 super.test_parseCompilationUnitMember_abstractAsPrefix(); | 3003 super.test_parseCompilationUnitMember_abstractAsPrefix(); |
| 3014 assertNoErrors(); | 3004 assertNoErrors(); |
| 3015 } | 3005 } |
| 3006 |
| 3007 @override |
| 3008 @failingTest |
| 3009 void test_parseDirectives_mixed() { |
| 3010 // TODO(paulberry,ahe): This test verifies the analyzer parser's ability to |
| 3011 // stop parsing as soon as the first non-directive is encountered; this is |
| 3012 // useful for quickly traversing an import graph. Consider adding a similar |
| 3013 // ability to Fasta's parser. |
| 3014 super.test_parseDirectives_mixed(); |
| 3015 } |
| 3016 } | 3016 } |
| OLD | NEW |