| 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 4611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4622 } | 4622 } |
| 4623 | 4623 |
| 4624 void test_function_literal_allowed_in_ParenthesizedExpression_in_ConstructorFi
eldInitializer() { | 4624 void test_function_literal_allowed_in_ParenthesizedExpression_in_ConstructorFi
eldInitializer() { |
| 4625 ParserTestCase.parseCompilationUnit("class C { C() : a = (() {}); }"); | 4625 ParserTestCase.parseCompilationUnit("class C { C() : a = (() {}); }"); |
| 4626 } | 4626 } |
| 4627 | 4627 |
| 4628 void test_function_literal_allowed_in_StringInterpolation_in_ConstructorFieldI
nitializer() { | 4628 void test_function_literal_allowed_in_StringInterpolation_in_ConstructorFieldI
nitializer() { |
| 4629 ParserTestCase.parseCompilationUnit("class C { C() : a = \"\${(){}}\"; }"); | 4629 ParserTestCase.parseCompilationUnit("class C { C() : a = \"\${(){}}\"; }"); |
| 4630 } | 4630 } |
| 4631 | 4631 |
| 4632 void test_import_as_show() { |
| 4633 ParserTestCase.parseCompilationUnit("import 'dart:math' as M show E;"); |
| 4634 } |
| 4635 |
| 4636 void test_import_show_hide() { |
| 4637 ParserTestCase.parseCompilationUnit( |
| 4638 "import 'import1_lib.dart' show hide, show hide ugly;"); |
| 4639 } |
| 4640 |
| 4632 void test_isFunctionDeclaration_nameButNoReturn_block() { | 4641 void test_isFunctionDeclaration_nameButNoReturn_block() { |
| 4633 expect(_isFunctionDeclaration("f() {}"), isTrue); | 4642 expect(_isFunctionDeclaration("f() {}"), isTrue); |
| 4634 } | 4643 } |
| 4635 | 4644 |
| 4636 void test_isFunctionDeclaration_nameButNoReturn_expression() { | 4645 void test_isFunctionDeclaration_nameButNoReturn_expression() { |
| 4637 expect(_isFunctionDeclaration("f() => e"), isTrue); | 4646 expect(_isFunctionDeclaration("f() => e"), isTrue); |
| 4638 } | 4647 } |
| 4639 | 4648 |
| 4640 void test_isFunctionDeclaration_normalReturn_block() { | 4649 void test_isFunctionDeclaration_normalReturn_block() { |
| 4641 expect(_isFunctionDeclaration("C f() {}"), isTrue); | 4650 expect(_isFunctionDeclaration("C f() {}"), isTrue); |
| (...skipping 5599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10241 new Scanner(null, new CharSequenceReader(source), listener); | 10250 new Scanner(null, new CharSequenceReader(source), listener); |
| 10242 Token tokenStream = scanner.tokenize(); | 10251 Token tokenStream = scanner.tokenize(); |
| 10243 // | 10252 // |
| 10244 // Parse the source. | 10253 // Parse the source. |
| 10245 // | 10254 // |
| 10246 Parser parser = new Parser(null, listener); | 10255 Parser parser = new Parser(null, listener); |
| 10247 return invokeParserMethodImpl( | 10256 return invokeParserMethodImpl( |
| 10248 parser, methodName, <Object>[tokenStream], tokenStream) as Token; | 10257 parser, methodName, <Object>[tokenStream], tokenStream) as Token; |
| 10249 } | 10258 } |
| 10250 } | 10259 } |
| OLD | NEW |