Skip to content

Commit

Permalink
Handle choose type in loader
Browse files Browse the repository at this point in the history
  • Loading branch information
klntsky committed Nov 22, 2024
1 parent 55a83e4 commit c2c6779
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/src/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ def extract_parameter_set(ast):
extract_parameter_set(expr, assigned)
elif ast["type"] == "comment":
pass
elif ast["type"] == "choose":
res = res.then(extract_parameter_set(ast["criterion"]))
acc = ParameterSet()
for option in ast["options"]:
acc = acc.alternative(
extract_parameter_set(
option["option"] + option["description"]
)
)
if ast["default"] is not None:
acc = acc.alternative(extract_parameter_set(ast["default"]))
res = res.then(acc)
elif ast["type"] == "if_then_else":
res = res.then(extract_parameter_set(ast["condition"])).then(
extract_parameter_set(ast["then"]).alternative(
Expand Down

0 comments on commit c2c6779

Please sign in to comment.