| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library engine.parser_test; | 5 library engine.parser_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
| 8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
| 9 import 'package:analyzer/src/generated/error.dart'; | 9 import 'package:analyzer/src/generated/error.dart'; |
| 10 import 'package:analyzer/src/generated/incremental_scanner.dart'; | 10 import 'package:analyzer/src/generated/incremental_scanner.dart'; |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 void test_classTypeAlias_abstractAfterEq() { | 843 void test_classTypeAlias_abstractAfterEq() { |
| 844 // This syntax has been removed from the language in favor of | 844 // This syntax has been removed from the language in favor of |
| 845 // "abstract class A = B with C;" (issue 18098). | 845 // "abstract class A = B with C;" (issue 18098). |
| 846 ParserTestCase.parse3( | 846 ParserTestCase.parse3( |
| 847 "parseCompilationUnitMember", | 847 "parseCompilationUnitMember", |
| 848 <Object>[emptyCommentAndMetadata()], | 848 <Object>[emptyCommentAndMetadata()], |
| 849 "class A = abstract B with C;", | 849 "class A = abstract B with C;", |
| 850 [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN]); | 850 [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN]); |
| 851 } | 851 } |
| 852 | 852 |
| 853 void test_colonInPlaceOfIn() { |
| 854 ParserTestCase.parseStatement( |
| 855 "for (var x : list) {}", |
| 856 [ParserErrorCode.COLON_IN_PLACE_OF_IN]); |
| 857 } |
| 858 |
| 853 void test_constAndFinal() { | 859 void test_constAndFinal() { |
| 854 ParserTestCase.parse3( | 860 ParserTestCase.parse3( |
| 855 "parseClassMember", | 861 "parseClassMember", |
| 856 <Object>["C"], | 862 <Object>["C"], |
| 857 "const final int x;", | 863 "const final int x;", |
| 858 [ParserErrorCode.CONST_AND_FINAL]); | 864 [ParserErrorCode.CONST_AND_FINAL]); |
| 859 } | 865 } |
| 860 | 866 |
| 861 void test_constAndVar() { | 867 void test_constAndVar() { |
| 862 ParserTestCase.parse3( | 868 ParserTestCase.parse3( |
| (...skipping 10087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10950 // Parse the source. | 10956 // Parse the source. |
| 10951 // | 10957 // |
| 10952 Parser parser = new Parser(null, listener); | 10958 Parser parser = new Parser(null, listener); |
| 10953 return invokeParserMethodImpl( | 10959 return invokeParserMethodImpl( |
| 10954 parser, | 10960 parser, |
| 10955 methodName, | 10961 methodName, |
| 10956 <Object>[tokenStream], | 10962 <Object>[tokenStream], |
| 10957 tokenStream) as Token; | 10963 tokenStream) as Token; |
| 10958 } | 10964 } |
| 10959 } | 10965 } |
| OLD | NEW |