| 69 | | |
|---|
| | 69 | |
|---|
| | 70 | let option_detail stream = |
|---|
| | 71 | let value = |
|---|
| | 72 | u30 stream in |
|---|
| | 73 | match u8 stream with |
|---|
| | 74 | 0x03 -> |
|---|
| | 75 | `Int value |
|---|
| | 76 | | 0x04 -> |
|---|
| | 77 | `UInt value |
|---|
| | 78 | | 0x06 -> |
|---|
| | 79 | `Double value |
|---|
| | 80 | | 0x01 -> |
|---|
| | 81 | `String value |
|---|
| | 82 | | 0x0B -> |
|---|
| | 83 | `Bool true |
|---|
| | 84 | | 0x0A -> |
|---|
| | 85 | `Bool false |
|---|
| | 86 | | 0x0C -> |
|---|
| | 87 | `Null |
|---|
| | 88 | | 0x00 -> |
|---|
| | 89 | `Undefined |
|---|
| | 90 | | 0x08 | 0x16 | 0x17 | 0x18 | 0x19 | 0x1A | 0x05 -> |
|---|
| | 91 | `Namespace value |
|---|
| | 92 | |
|---|
| | 93 | let option_info stream = |
|---|
| | 94 | array option_detail stream |
|---|
| | 95 | |
|---|
| | 96 | let has x y = |
|---|
| | 97 | x land y = y |
|---|
| | 98 | |
|---|
| | 99 | let method_info stream = |
|---|
| | 100 | let param_count = |
|---|
| | 101 | u30 stream in |
|---|
| | 102 | let return_type = |
|---|
| | 103 | u30 stream in |
|---|
| | 104 | let param_types = |
|---|
| | 105 | times u30 param_count stream in |
|---|
| | 106 | let name = |
|---|
| | 107 | u30 stream in |
|---|
| | 108 | let flags = |
|---|
| | 109 | u8 stream in |
|---|
| | 110 | let options = |
|---|
| | 111 | if has flags 0x08 then |
|---|
| | 112 | Some (option_info stream ) |
|---|
| | 113 | else |
|---|
| | 114 | None in |
|---|
| | 115 | let param_names = |
|---|
| | 116 | if has flags 0x80 then |
|---|
| | 117 | Some (times u30 param_count stream) |
|---|
| | 118 | else |
|---|
| | 119 | None in |
|---|
| | 120 | {| param_types = param_types; |
|---|
| | 121 | return_type = return_type; |
|---|
| | 122 | name = name; |
|---|
| | 123 | need_arguments = has flags 0x01; |
|---|
| | 124 | need_activation = has flags 0x02; |
|---|
| | 125 | need_rest = has flags 0x04; |
|---|
| | 126 | need_optional = has flags 0x08; |
|---|
| | 127 | sex_dxns = has flags 0x40; |
|---|
| | 128 | has_param_names = has flags 0x80; |
|---|
| | 129 | options = options; |
|---|
| | 130 | param_info = param_names |
|---|
| | 131 | |} |
|---|
| | 132 | |
|---|
| | 133 | let item_info stream = |
|---|
| | 134 | {| key=u30 stream; |
|---|
| | 135 | value=u30 stream |} |
|---|
| | 136 | |
|---|
| | 137 | let metadata_info stream = |
|---|
| | 138 | {| name = u30 stream; |
|---|
| | 139 | items = array item_info stream |
|---|
| | 140 | |} |
|---|
| | 141 | |
|---|