(name)
| 169 | return ''.join(map(str.capitalize, parts)) |
| 170 | |
| 171 | def pascalize_const(name): |
| 172 | parts = name.split('_',2) |
| 173 | match = re.match('^(CC|DISP|MOD|DIR|BCAST|RM|FLAGS|SIZE|BR_DISP_SIZE)_', parts[2]) |
| 174 | if match: |
| 175 | parts = name.split('_', 2 + match.group(0).count('_')) |
| 176 | item = camelize(parts[-1]) |
| 177 | if item[0].isdigit(): |
| 178 | item = parts[-2].lower() + item |
| 179 | return (pascalize('_'.join(parts[0:-1])), item) |
| 180 | |
| 181 | def enum_type(name, templ): |
| 182 | for enum_type, pattern in templ['enum_types'].items(): |