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