OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Resolves the values used for constants and enums.""" | 5 """Resolves the values used for constants and enums.""" |
6 | 6 |
7 from itertools import ifilter | 7 from itertools import ifilter |
8 import mojom.generate.module as mojom | 8 import mojom.generate.module as mojom |
9 | 9 |
10 def ResolveConstants(module, expression_to_text): | 10 def ResolveConstants(module, expression_to_text): |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 if isinstance(field.default, (mojom.ConstantValue, mojom.EnumValue)): | 82 if isinstance(field.default, (mojom.ConstantValue, mojom.EnumValue)): |
83 field.default.resolved_value = GetResolvedValue(field.default) | 83 field.default.resolved_value = GetResolvedValue(field.default) |
84 | 84 |
85 for interface in module.interfaces: | 85 for interface in module.interfaces: |
86 for constant in interface.constants: | 86 for constant in interface.constants: |
87 ResolveConstant(constant) | 87 ResolveConstant(constant) |
88 for enum in interface.enums: | 88 for enum in interface.enums: |
89 ResolveEnum(enum) | 89 ResolveEnum(enum) |
90 | 90 |
91 return module | 91 return module |
OLD | NEW |