| 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 internalError; | 7 import 'errors.dart' show internalError; |
| 8 | 8 |
| 9 enum ModifierEnum { | 9 enum ModifierEnum { |
| 10 Abstract, | 10 Abstract, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 const int constMask = abstractMask << 1; | 23 const int constMask = abstractMask << 1; |
| 24 | 24 |
| 25 const int covariantMask = constMask << 1; | 25 const int covariantMask = constMask << 1; |
| 26 | 26 |
| 27 const int externalMask = covariantMask << 1; | 27 const int externalMask = covariantMask << 1; |
| 28 | 28 |
| 29 const int finalMask = externalMask << 1; | 29 const int finalMask = externalMask << 1; |
| 30 | 30 |
| 31 const int staticMask = finalMask << 1; | 31 const int staticMask = finalMask << 1; |
| 32 | 32 |
| 33 const int namedMixinApplicationMask = staticMask << 1; |
| 34 |
| 33 /// Not a real modifier, and by setting it to zero, it is automatically ignored | 35 /// Not a real modifier, and by setting it to zero, it is automatically ignored |
| 34 /// by [Modifier.validate] below. | 36 /// by [Modifier.validate] below. |
| 35 const int varMask = 0; | 37 const int varMask = 0; |
| 36 | 38 |
| 37 const Modifier Abstract = const Modifier(ModifierEnum.Abstract, abstractMask); | 39 const Modifier Abstract = const Modifier(ModifierEnum.Abstract, abstractMask); |
| 38 | 40 |
| 39 const Modifier Const = const Modifier(ModifierEnum.Const, constMask); | 41 const Modifier Const = const Modifier(ModifierEnum.Const, constMask); |
| 40 | 42 |
| 41 const Modifier Covariant = | 43 const Modifier Covariant = |
| 42 const Modifier(ModifierEnum.Covariant, covariantMask); | 44 const Modifier(ModifierEnum.Covariant, covariantMask); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // TODO(ahe): Rename this method, validation is now taken care of by the | 76 // TODO(ahe): Rename this method, validation is now taken care of by the |
| 75 // parser. | 77 // parser. |
| 76 int result = isAbstract ? abstractMask : 0; | 78 int result = isAbstract ? abstractMask : 0; |
| 77 if (modifiers == null) return result; | 79 if (modifiers == null) return result; |
| 78 for (Modifier modifier in modifiers) { | 80 for (Modifier modifier in modifiers) { |
| 79 result |= modifier.mask; | 81 result |= modifier.mask; |
| 80 } | 82 } |
| 81 return result; | 83 return result; |
| 82 } | 84 } |
| 83 } | 85 } |
| OLD | NEW |