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/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
10 import 'package:analyzer/src/generated/error.dart'; | 10 import 'package:analyzer/src/generated/error.dart'; |
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 | 1295 |
1296 void test_invalidInterpolationIdentifier_startWithDigit() { | 1296 void test_invalidInterpolationIdentifier_startWithDigit() { |
1297 parse4("parseStringLiteral", "'\$1'", [ParserErrorCode.MISSING_IDENTIFIER]); | 1297 parse4("parseStringLiteral", "'\$1'", [ParserErrorCode.MISSING_IDENTIFIER]); |
1298 } | 1298 } |
1299 | 1299 |
1300 void test_invalidOperator() { | 1300 void test_invalidOperator() { |
1301 parse3("parseClassMember", <Object>["C"], "void operator ===(x) {}", | 1301 parse3("parseClassMember", <Object>["C"], "void operator ===(x) {}", |
1302 [ParserErrorCode.INVALID_OPERATOR]); | 1302 [ParserErrorCode.INVALID_OPERATOR]); |
1303 } | 1303 } |
1304 | 1304 |
| 1305 void test_invalidOperatorAfterSuper_assignableExpression() { |
| 1306 _enableNullAwareOperators = true; |
| 1307 parse3('parseAssignableExpression', <Object>[false], 'super?.v', |
| 1308 [ParserErrorCode.INVALID_OPERATOR_FOR_SUPER]); |
| 1309 } |
| 1310 |
| 1311 void test_invalidOperatorAfterSuper_primaryExpression() { |
| 1312 _enableNullAwareOperators = true; |
| 1313 parse4('parsePrimaryExpression', 'super?.v', |
| 1314 [ParserErrorCode.INVALID_OPERATOR_FOR_SUPER]); |
| 1315 } |
| 1316 |
1305 void test_invalidOperatorForSuper() { | 1317 void test_invalidOperatorForSuper() { |
1306 parse4("parseUnaryExpression", "++super", | 1318 parse4("parseUnaryExpression", "++super", |
1307 [ParserErrorCode.INVALID_OPERATOR_FOR_SUPER]); | 1319 [ParserErrorCode.INVALID_OPERATOR_FOR_SUPER]); |
1308 } | 1320 } |
1309 | 1321 |
1310 void test_invalidStarAfterAsync() { | 1322 void test_invalidStarAfterAsync() { |
1311 parse3("parseFunctionBody", <Object>[ | 1323 parse3("parseFunctionBody", <Object>[ |
1312 false, | 1324 false, |
1313 null, | 1325 null, |
1314 false | 1326 false |
(...skipping 8820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10135 new Scanner(null, new CharSequenceReader(source), listener); | 10147 new Scanner(null, new CharSequenceReader(source), listener); |
10136 Token tokenStream = scanner.tokenize(); | 10148 Token tokenStream = scanner.tokenize(); |
10137 // | 10149 // |
10138 // Parse the source. | 10150 // Parse the source. |
10139 // | 10151 // |
10140 Parser parser = new Parser(null, listener); | 10152 Parser parser = new Parser(null, listener); |
10141 return invokeParserMethodImpl( | 10153 return invokeParserMethodImpl( |
10142 parser, methodName, <Object>[tokenStream], tokenStream) as Token; | 10154 parser, methodName, <Object>[tokenStream], tokenStream) as Token; |
10143 } | 10155 } |
10144 } | 10156 } |
OLD | NEW |