(self: Instruction)
| 1155 | } |
| 1156 | |
| 1157 | const toParseableInstruction = (self: Instruction): Array<ParseableInstruction> => { |
| 1158 | switch (self._tag) { |
| 1159 | case "Empty": { |
| 1160 | return Arr.empty() |
| 1161 | } |
| 1162 | case "Single": |
| 1163 | case "KeyValueMap": |
| 1164 | case "Variadic": { |
| 1165 | return Arr.of(self) |
| 1166 | } |
| 1167 | case "Map": |
| 1168 | case "WithDefault": |
| 1169 | case "WithFallback": { |
| 1170 | return toParseableInstruction(self.options as Instruction) |
| 1171 | } |
| 1172 | case "Both": |
| 1173 | case "OrElse": { |
| 1174 | return Arr.appendAll( |
| 1175 | toParseableInstruction(self.left as Instruction), |
| 1176 | toParseableInstruction(self.right as Instruction) |
| 1177 | ) |
| 1178 | } |
| 1179 | } |
| 1180 | } |
| 1181 | |
| 1182 | /** @internal */ |
| 1183 | const keyValueSplitter = /=(.*)/ |