| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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('compiler'); | 5 #library('compiler'); |
| 6 | 6 |
| 7 #import('dart:uri'); | 7 #import('dart:uri'); |
| 8 #import('implementation/apiimpl.dart'); | 8 #import('implementation/apiimpl.dart'); |
| 9 | 9 |
| 10 // Unless explicitly allowed, passing [:null:] for any argument to the | 10 // Unless explicitly allowed, passing [:null:] for any argument to the |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 * reporting a compilation error. The specification says: | 64 * reporting a compilation error. The specification says: |
| 65 * | 65 * |
| 66 * "A compile-time error must be reported by a Dart compiler before | 66 * "A compile-time error must be reported by a Dart compiler before |
| 67 * the erroneous code is executed." and "If a compile-time error | 67 * the erroneous code is executed." and "If a compile-time error |
| 68 * occurs within the code of a running isolate A, A is immediately | 68 * occurs within the code of a running isolate A, A is immediately |
| 69 * suspended." | 69 * suspended." |
| 70 * | 70 * |
| 71 * This means that the compiler can generate code that when executed | 71 * This means that the compiler can generate code that when executed |
| 72 * terminates execution. | 72 * terminates execution. |
| 73 */ | 73 */ |
| 74 static final Diagnostic ERROR = const Diagnostic(1, 'error'); | 74 static const Diagnostic ERROR = const Diagnostic(1, 'error'); |
| 75 | 75 |
| 76 /** | 76 /** |
| 77 * A warning as identified by the "Dart Programming Language | 77 * A warning as identified by the "Dart Programming Language |
| 78 * Specification" [http://www.dartlang.org/docs/spec/]. | 78 * Specification" [http://www.dartlang.org/docs/spec/]. |
| 79 */ | 79 */ |
| 80 static final Diagnostic WARNING = const Diagnostic(2, 'warning'); | 80 static const Diagnostic WARNING = const Diagnostic(2, 'warning'); |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * Any other warning that is not covered by [WARNING]. | 83 * Any other warning that is not covered by [WARNING]. |
| 84 */ | 84 */ |
| 85 static final Diagnostic LINT = const Diagnostic(4, 'lint'); | 85 static const Diagnostic LINT = const Diagnostic(4, 'lint'); |
| 86 | 86 |
| 87 /** | 87 /** |
| 88 * Informational messages. | 88 * Informational messages. |
| 89 */ | 89 */ |
| 90 static final Diagnostic INFO = const Diagnostic(8, 'info'); | 90 static const Diagnostic INFO = const Diagnostic(8, 'info'); |
| 91 | 91 |
| 92 /** | 92 /** |
| 93 * Informational messages that shouldn't be printed unless | 93 * Informational messages that shouldn't be printed unless |
| 94 * explicitly requested by the user of a compiler. | 94 * explicitly requested by the user of a compiler. |
| 95 */ | 95 */ |
| 96 static final Diagnostic VERBOSE_INFO = const Diagnostic(16, 'verbose info'); | 96 static const Diagnostic VERBOSE_INFO = const Diagnostic(16, 'verbose info'); |
| 97 | 97 |
| 98 /** | 98 /** |
| 99 * An internal error in the compiler. | 99 * An internal error in the compiler. |
| 100 */ | 100 */ |
| 101 static final Diagnostic CRASH = const Diagnostic(32, 'crash'); | 101 static const Diagnostic CRASH = const Diagnostic(32, 'crash'); |
| 102 | 102 |
| 103 /** | 103 /** |
| 104 * An [int] representation of this kind. The ordinals are designed | 104 * An [int] representation of this kind. The ordinals are designed |
| 105 * to be used as bitsets. | 105 * to be used as bitsets. |
| 106 */ | 106 */ |
| 107 final int ordinal; | 107 final int ordinal; |
| 108 | 108 |
| 109 /** | 109 /** |
| 110 * The name of this kind. | 110 * The name of this kind. |
| 111 */ | 111 */ |
| 112 final String name; | 112 final String name; |
| 113 | 113 |
| 114 /** | 114 /** |
| 115 * This constructor is not private to support user-defined | 115 * This constructor is not private to support user-defined |
| 116 * diagnostic kinds. | 116 * diagnostic kinds. |
| 117 */ | 117 */ |
| 118 const Diagnostic(this.ordinal, this.name); | 118 const Diagnostic(this.ordinal, this.name); |
| 119 | 119 |
| 120 String toString() => name; | 120 String toString() => name; |
| 121 } | 121 } |
| OLD | NEW |