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.ast_test; | 5 library engine.ast_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/java_core.dart'; | 8 import 'package:analyzer/src/generated/java_core.dart'; |
9 import 'package:analyzer/src/generated/java_engine.dart' show Predicate; | 9 import 'package:analyzer/src/generated/java_engine.dart' show Predicate; |
10 import 'package:analyzer/src/generated/java_engine.dart'; | 10 import 'package:analyzer/src/generated/java_engine.dart'; |
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 "e as T", | 1681 "e as T", |
1682 AstFactory.asExpression( | 1682 AstFactory.asExpression( |
1683 AstFactory.identifier3("e"), AstFactory.typeName4("T"))); | 1683 AstFactory.identifier3("e"), AstFactory.typeName4("T"))); |
1684 } | 1684 } |
1685 | 1685 |
1686 void test_visitAssertStatement() { | 1686 void test_visitAssertStatement() { |
1687 _assertSource( | 1687 _assertSource( |
1688 "assert (a);", AstFactory.assertStatement(AstFactory.identifier3("a"))); | 1688 "assert (a);", AstFactory.assertStatement(AstFactory.identifier3("a"))); |
1689 } | 1689 } |
1690 | 1690 |
| 1691 void test_visitAssertStatement_withMessage() { |
| 1692 _assertSource( |
| 1693 "assert (a, b);", |
| 1694 AstFactory.assertStatement( |
| 1695 AstFactory.identifier3("a"), AstFactory.identifier3('b'))); |
| 1696 } |
| 1697 |
1691 void test_visitAssignmentExpression() { | 1698 void test_visitAssignmentExpression() { |
1692 _assertSource( | 1699 _assertSource( |
1693 "a = b", | 1700 "a = b", |
1694 AstFactory.assignmentExpression(AstFactory.identifier3("a"), | 1701 AstFactory.assignmentExpression(AstFactory.identifier3("a"), |
1695 TokenType.EQ, AstFactory.identifier3("b"))); | 1702 TokenType.EQ, AstFactory.identifier3("b"))); |
1696 } | 1703 } |
1697 | 1704 |
1698 void test_visitAwaitExpression() { | 1705 void test_visitAwaitExpression() { |
1699 _assertSource( | 1706 _assertSource( |
1700 "await e;", AstFactory.awaitExpression(AstFactory.identifier3("e"))); | 1707 "await e;", AstFactory.awaitExpression(AstFactory.identifier3("e"))); |
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3894 static const List<WrapperKind> values = const [ | 3901 static const List<WrapperKind> values = const [ |
3895 PREFIXED_LEFT, | 3902 PREFIXED_LEFT, |
3896 PREFIXED_RIGHT, | 3903 PREFIXED_RIGHT, |
3897 PROPERTY_LEFT, | 3904 PROPERTY_LEFT, |
3898 PROPERTY_RIGHT, | 3905 PROPERTY_RIGHT, |
3899 NONE | 3906 NONE |
3900 ]; | 3907 ]; |
3901 | 3908 |
3902 const WrapperKind(String name, int ordinal) : super(name, ordinal); | 3909 const WrapperKind(String name, int ordinal) : super(name, ordinal); |
3903 } | 3910 } |
OLD | NEW |