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 4260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4271 [ | 4271 [ |
4272 ParserErrorCode.MISSING_IDENTIFIER, | 4272 ParserErrorCode.MISSING_IDENTIFIER, |
4273 ParserErrorCode.MISSING_IDENTIFIER, | 4273 ParserErrorCode.MISSING_IDENTIFIER, |
4274 ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]); | 4274 ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]); |
4275 EngineTestCase.assertInstanceOf( | 4275 EngineTestCase.assertInstanceOf( |
4276 (obj) => obj is BinaryExpression, | 4276 (obj) => obj is BinaryExpression, |
4277 BinaryExpression, | 4277 BinaryExpression, |
4278 expression.leftOperand); | 4278 expression.leftOperand); |
4279 } | 4279 } |
4280 | 4280 |
| 4281 void test_nonStringLiteralUri_import() { |
| 4282 ParserTestCase.parseCompilationUnit( |
| 4283 "import dart:io; class C {}", |
| 4284 [ParserErrorCode.NON_STRING_LITERAL_AS_URI]); |
| 4285 } |
| 4286 |
4281 void test_prefixExpression_missing_operand_minus() { | 4287 void test_prefixExpression_missing_operand_minus() { |
4282 PrefixExpression expression = | 4288 PrefixExpression expression = |
4283 ParserTestCase.parseExpression("-", [ParserErrorCode.MISSING_IDENTIFIER]
); | 4289 ParserTestCase.parseExpression("-", [ParserErrorCode.MISSING_IDENTIFIER]
); |
4284 EngineTestCase.assertInstanceOf( | 4290 EngineTestCase.assertInstanceOf( |
4285 (obj) => obj is SimpleIdentifier, | 4291 (obj) => obj is SimpleIdentifier, |
4286 SimpleIdentifier, | 4292 SimpleIdentifier, |
4287 expression.operand); | 4293 expression.operand); |
4288 expect(expression.operand.isSynthetic, isTrue); | 4294 expect(expression.operand.isSynthetic, isTrue); |
4289 expect(expression.operator.type, TokenType.MINUS); | 4295 expect(expression.operator.type, TokenType.MINUS); |
4290 } | 4296 } |
(...skipping 6625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10916 // Parse the source. | 10922 // Parse the source. |
10917 // | 10923 // |
10918 Parser parser = new Parser(null, listener); | 10924 Parser parser = new Parser(null, listener); |
10919 return invokeParserMethodImpl( | 10925 return invokeParserMethodImpl( |
10920 parser, | 10926 parser, |
10921 methodName, | 10927 methodName, |
10922 <Object>[tokenStream], | 10928 <Object>[tokenStream], |
10923 tokenStream) as Token; | 10929 tokenStream) as Token; |
10924 } | 10930 } |
10925 } | 10931 } |
OLD | NEW |