| 103 | | (* |
|---|
| 104 | | <InstanceInfo nameIndex="1" superIndex="2" hasProtectedNS="1" interface="0" final="0" sealed="1" protectedNS="3" iInitIndex="1"> |
|---|
| 105 | | <interfaces/> |
|---|
| 106 | | <traits/> |
|---|
| 107 | | </InstanceInfo> |
|---|
| 108 | | *) |
|---|
| | 105 | let from_trait trait = |
|---|
| | 106 | element |
|---|
| | 107 | "TraitInfo" |
|---|
| | 108 | [ "nameIndex" ,Int32.to_string trait#name; |
|---|
| | 109 | "hasMetadata",some trait#metadata; |
|---|
| | 110 | "override" ,bool trait#attr_override; |
|---|
| | 111 | "final" ,bool trait#attr_final] |
|---|
| | 112 | [ elem "trait" [ |
|---|
| | 113 | match trait#data with |
|---|
| | 114 | `Class t -> |
|---|
| | 115 | attr "Class" ["slotID",Int32.to_string t#slot_id;"classInfo",Int32.to_string t#classi] |
|---|
| | 116 | | `Slot t -> |
|---|
| | 117 | attr "Slot" @@ ([ |
|---|
| | 118 | "slotID" ,Int32.to_string t#slot_id; |
|---|
| | 119 | "typeIndex" ,Int32.to_string t#type_name; |
|---|
| | 120 | "valueIndex",Int32.to_string t#vindex; |
|---|
| | 121 | ] @ match t#vkind with |
|---|
| | 122 | None -> [ ] |
|---|
| | 123 | | Some kind -> ["valueKind",string_of_int kind]) |
|---|
| | 124 | | `Const t -> |
|---|
| | 125 | attr "Slot" @@ ([ |
|---|
| | 126 | "slotID" ,Int32.to_string t#slot_id; |
|---|
| | 127 | "typeIndex" ,Int32.to_string t#type_name; |
|---|
| | 128 | "valueIndex",Int32.to_string t#vindex; |
|---|
| | 129 | ] @ match t#vkind with |
|---|
| | 130 | None -> [ ] |
|---|
| | 131 | | Some kind -> ["valueKind",string_of_int kind]) |
|---|
| | 132 | | `Function t -> |
|---|
| | 133 | attr "Function" ["slotID",Int32.to_string t#slot_id; |
|---|
| | 134 | "methodInfo",Int32.to_string t#functioni] |
|---|
| | 135 | | `Getter t -> |
|---|
| | 136 | attr "Getter" ["dispID",Int32.to_string t#disp_id; |
|---|
| | 137 | "methodInfo",Int32.to_string t#methodi] |
|---|
| | 138 | | `Method t -> |
|---|
| | 139 | attr "Method" ["dispID",Int32.to_string t#disp_id;"methodInfo",Int32.to_string t#methodi] |
|---|
| | 140 | | `Setter t -> |
|---|
| | 141 | attr "Setter" ["dispID",Int32.to_string t#disp_id;"methodInfo",Int32.to_string t#methodi] |
|---|
| | 142 | ]] |
|---|
| | 143 | |
|---|
| | 144 | |
|---|
| 113 | | ["nameIndex" ,"1"; |
|---|
| 114 | | "superIndex","2"; |
|---|
| 115 | | "hasProtectedNS","1"; |
|---|
| 116 | | "interface","0"; |
|---|
| 117 | | "final","0"; |
|---|
| 118 | | "sealed","1"; |
|---|
| 119 | | "protectedNS","3"; |
|---|
| 120 | | "iInitIndex","1"] |
|---|
| 121 | | []) +> |
|---|
| | 149 | (["nameIndex" ,Int32.to_string i#name; |
|---|
| | 150 | "superIndex" ,Int32.to_string i#super_name; |
|---|
| | 151 | "hasProtectedNS",bool i#is_protected; |
|---|
| | 152 | "interface" ,bool i#is_interface; |
|---|
| | 153 | "final" ,bool i#is_final; |
|---|
| | 154 | "sealed" ,bool i#is_sealed; |
|---|
| | 155 | "iInitIndex" ,Int32.to_string i#iinit] @ |
|---|
| | 156 | (match i#protectedNs with |
|---|
| | 157 | None -> [] |
|---|
| | 158 | | Some x -> |
|---|
| | 159 | ["protectedNS",Int32.to_string x])) |
|---|
| | 160 | @@ [elem "interfaces" @@ List.map u30 i#interface; |
|---|
| | 161 | elem "traits" @@ List.map from_trait i#trait]) +> |
|---|