(call)
| 834 | # describing the corresponding output constant. See load_fields(). |
| 835 | # |
| 836 | def parse_field(call): |
| 837 | # Replace newlines with spaces. |
| 838 | for ii in range(0, len(call)): |
| 839 | if (call[ii] == '\n'): |
| 840 | call[ii] == ' ' |
| 841 | |
| 842 | idx = call.find('(') |
| 843 | kind = call[0:idx] |
| 844 | rest = call[idx + 1:len(call) - 1] |
| 845 | args = split_commas(rest) |
| 846 | |
| 847 | klass = args[0] |
| 848 | field = args[1] |
| 849 | dtype = None |
| 850 | offset = None |
| 851 | if not (kind.startswith('SMI_ACCESSORS') or |
| 852 | kind.startswith('ACCESSORS_TO_SMI')): |
| 853 | dtype = re.sub(r'[<> ,]+', '_', args[2]).lstrip('(').rstrip(')') |
| 854 | offset = args[3] |
| 855 | else: |
| 856 | offset = args[2] |
| 857 | dtype = 'SMI' |
| 858 | |
| 859 | if offset.startswith("offsetof(") or offset.startswith( |
| 860 | "OFFSET_OF_DATA_START("): |
| 861 | offsetof_fields.append((klass, field, offset)) |
| 862 | value = 'OffsetsForDebug::%s_%s' % (klass, field) |
| 863 | else: |
| 864 | value = '%s::%s' % (klass, offset) |
| 865 | |
| 866 | assert (offset is not None and dtype is not None) |
| 867 | return ({'name': 'class_%s__%s__%s' % (klass, field, dtype), 'value': value}) |
| 868 | |
| 869 | # |
| 870 | # Load field offset information from objects-inl.h etc. |
no test coverage detected