Commit 6b738550 by nzy

Add an command

parent 85ada63a
import argparse
from synthesis import synthesis, synthesis_1
from synthesis import synthesis, synthesis_1, synthesis_1_inorder
from lib import check_holes, check_hole_1, create_sketch, create_dest
import argparse
import os
......@@ -69,6 +69,7 @@ async def main():
syn_parser = subparsers.add_parser('synthesis')
syn_parser.add_argument('fun_name', nargs='?', default=None, help="Name of the function to synthesis.")
syn_parser.add_argument('--all', action='store_true', help="Compile all functions.")
syn_parser.add_argument('--sketch', default=None, help="Name of the sketch to synthesis.")
args = parser.parse_args()
if args.command == "sketch":
......@@ -92,6 +93,8 @@ async def main():
print(holes)
else:
await synthesis_1(args.fun_name)
elif args.sketch:
await synthesis_1_inorder(args.sketch)
else:
parser.print_help()
......
......@@ -38,4 +38,5 @@ async def synthesis_1_inorder(fun_name):
dependencies = json.load(f)["dependencies"]
for name in dependencies:
print(f"I am synthesizing {name}")
await synthesis_1(name)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment