| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.modifier; | 5 library fasta.modifier; |
| 6 | 6 |
| 7 import 'errors.dart' show | 7 import 'errors.dart' show internalError; |
| 8 internalError; | |
| 9 | 8 |
| 10 enum ModifierEnum { | 9 enum ModifierEnum { |
| 11 Abstract, | 10 Abstract, |
| 12 Const, | 11 Const, |
| 13 External, | 12 External, |
| 14 Final, | 13 Final, |
| 15 Static, | 14 Static, |
| 16 | 15 |
| 17 // Not a real modifier. | 16 // Not a real modifier. |
| 18 Var, | 17 Var, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 static int validate(List<Modifier> modifiers, {bool isAbstract: false}) { | 66 static int validate(List<Modifier> modifiers, {bool isAbstract: false}) { |
| 68 // TODO(ahe): Implement modifier validation: ordering and uniqueness. | 67 // TODO(ahe): Implement modifier validation: ordering and uniqueness. |
| 69 int result = isAbstract ? abstractMask : 0; | 68 int result = isAbstract ? abstractMask : 0; |
| 70 if (modifiers == null) return result; | 69 if (modifiers == null) return result; |
| 71 for (Modifier modifier in modifiers) { | 70 for (Modifier modifier in modifiers) { |
| 72 result |= modifier.mask; | 71 result |= modifier.mask; |
| 73 } | 72 } |
| 74 return result; | 73 return result; |
| 75 } | 74 } |
| 76 } | 75 } |
| OLD | NEW |