diff --git a/src/compiler/pipeline.py b/src/compiler/pipeline.py index e2ffc58..66d81d6 100644 --- a/src/compiler/pipeline.py +++ b/src/compiler/pipeline.py @@ -41,6 +41,40 @@ def build_points_env(ast: Program) -> Dict[str, PointDef]: points_env[point_def.name] = point_def return points_env + +def print_compilation_summary(ast: Program, points_env: Dict[str, PointDef]) -> None: + """Print a summary of the points and panels found during compilation.""" + print("\n" + "=" * 50) + print("COMPILATION SUMMARY") + print("=" * 50) + + # Print points summary + if points_env: + print(f"\nšŸ“ Points Found: {len(points_env)}") + for name in sorted(points_env.keys()): + print(f" • {name}") + else: + print("\nšŸ“ Points Found: 0") + + # Print panels summary + components = ast.components or [] + total_panels = 0 + + if components: + print(f"\nšŸ“ Panels Found:") + for comp in components: + panels = comp.panels or [] + panel_names = [p.name for p in panels] + total_panels += len(panel_names) + print(f" Component '{comp.name}':") + for panel_name in panel_names: + print(f" • {panel_name}") + print(f"\n Total: {total_panels} panel(s) in {len(components)} component(s)") + else: + print("\nšŸ“ Panels Found: 0") + + print("=" * 50 + "\n") + def mirror_coordinates(point, axis, bbox=None): """Mirror a [x, y] coordinate based on axis and optional bounding box.""" x, y = point @@ -958,6 +992,9 @@ def compile_program(ast: Program, measurements: dict): # Build a points environment from the AST so measurement expressions # that reference points can be evaluated. points_env = build_points_env(ast) + + # Print summary of points and panels found + print_compilation_summary(ast, points_env) # Start with the provided measurements (usually converted by the CLI # into the garment units). We'll augment/override these with any