OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 part of dart2js; | 5 part of dart2js; |
6 | 6 |
7 const DONT_KNOW_HOW_TO_FIX = "Computer says no!"; | 7 const DONT_KNOW_HOW_TO_FIX = "Computer says no!"; |
8 | 8 |
9 /** | 9 /** |
10 * The messages in this file should meet the following guide lines: | 10 * The messages in this file should meet the following guide lines: |
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1592 "'#{uri}' is not a valid URI.", | 1592 "'#{uri}' is not a valid URI.", |
1593 howToFix: DONT_KNOW_HOW_TO_FIX, | 1593 howToFix: DONT_KNOW_HOW_TO_FIX, |
1594 examples: const [ | 1594 examples: const [ |
1595 """ | 1595 """ |
1596 // can't have a '[' in a URI | 1596 // can't have a '[' in a URI |
1597 import '../../Udyn[mic ils/expect.dart'; | 1597 import '../../Udyn[mic ils/expect.dart'; |
1598 | 1598 |
1599 main() {} | 1599 main() {} |
1600 """]); | 1600 """]); |
1601 | 1601 |
| 1602 static const MessageKind INVALID_PACKAGE_URI = const MessageKind( |
| 1603 "'#{uri}' is not a valid package URI (#{exception}).", |
| 1604 howToFix: DONT_KNOW_HOW_TO_FIX, |
| 1605 examples: const [ |
| 1606 """ |
| 1607 // can't have a 'top level' package URI |
| 1608 import 'package:foo.dart'; |
| 1609 |
| 1610 main() {} |
| 1611 """, """ |
| 1612 // can't have 2 slashes |
| 1613 import 'package://foo/foo.dart'; |
| 1614 |
| 1615 main() {} |
| 1616 """, """ |
| 1617 // package name must be a valid identifier |
| 1618 import 'package:not-valid/foo.dart'; |
| 1619 |
| 1620 main() {} |
| 1621 """]); |
| 1622 |
1602 static const MessageKind READ_SCRIPT_ERROR = const MessageKind( | 1623 static const MessageKind READ_SCRIPT_ERROR = const MessageKind( |
1603 "Can't read '#{uri}' (#{exception}).", | 1624 "Can't read '#{uri}' (#{exception}).", |
1604 // Don't know how to fix since the underlying error is unknown. | 1625 // Don't know how to fix since the underlying error is unknown. |
1605 howToFix: DONT_KNOW_HOW_TO_FIX, | 1626 howToFix: DONT_KNOW_HOW_TO_FIX, |
1606 examples: const [ | 1627 examples: const [ |
1607 """ | 1628 """ |
1608 // 'foo.dart' does not exist. | 1629 // 'foo.dart' does not exist. |
1609 import 'foo.dart'; | 1630 import 'foo.dart'; |
1610 | 1631 |
1611 main() {} | 1632 main() {} |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2588 static String convertToString(value) { | 2609 static String convertToString(value) { |
2589 if (value is ErrorToken) { | 2610 if (value is ErrorToken) { |
2590 // Shouldn't happen. | 2611 // Shouldn't happen. |
2591 return value.assertionMessage; | 2612 return value.assertionMessage; |
2592 } else if (value is Token) { | 2613 } else if (value is Token) { |
2593 value = value.value; | 2614 value = value.value; |
2594 } | 2615 } |
2595 return '$value'; | 2616 return '$value'; |
2596 } | 2617 } |
2597 } | 2618 } |
OLD | NEW |