diff options
author | Pauli Nieminen <pauli.nieminen@linux.intel.com> | 2012-05-17 07:14:47 +0300 |
---|---|---|
committer | Pauli Nieminen <pauli.nieminen@linux.intel.com> | 2012-06-09 15:30:33 +0300 |
commit | 13993a0a23536d90f4f14a32d3db2bab576dead7 (patch) | |
tree | fc018ad25ff3cef605132611b144c86aeaa9d1ae | |
parent | 38d626a34859c4ff2847079272e3c3fdd79c7fc4 (diff) |
glapi: Split enum value parsing to help function
No functional changes just preparing GLES parsing.
Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
-rw-r--r-- | glapi/parse_glspec.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/glapi/parse_glspec.py b/glapi/parse_glspec.py index 241bb1c6..c3ea1db6 100644 --- a/glapi/parse_glspec.py +++ b/glapi/parse_glspec.py @@ -459,20 +459,23 @@ class Api(object): # # 'CLIENT_ALL_ATTRIB_BITS': { 'value_int': 4294967295, # 'value_str': "0xFFFFFFFF" } + def parse_enum(self, m): + name, value = m.groups() + if value.startswith('GL_'): + value_rhs = value[3:] + value_int = self.enums[value_rhs]['value_int'] + else: + value_int = decode_enum_value(value) + self.enums[name] = { + 'value_str': value, + 'value_int': value_int + } + def read_enumext_spec(self, f): for line in filter_comments(f): m = ENUM_REGEXP.match(line) - if m: - name, value = m.groups() - if value.startswith('GL_'): - value_rhs = value[3:] - value_int = self.enums[value_rhs]['value_int'] - else: - value_int = decode_enum_value(value) - self.enums[name] = { - 'value_str': value, - 'value_int': value_int - } + if m: + self.parse_enum(m) # Convert the stored API into JSON. To make diffing easier, all # dictionaries are sorted by key, and all sets are sorted by set |