Turn buildCfg into a method

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
2026-06-25 09:45:30 -05:00
parent 341a0b80b4
commit c4e5747b6d
4 changed files with 21 additions and 21 deletions

View File

@@ -167,10 +167,10 @@ export GGraph (comp link loop skipto singleton wrap loop_inputs loop_outputs)
end Graph
open Graph in
def buildCfg : Stmt Graph
def Stmt.cfg : Stmt Graph
| .basic bs => singleton [bs]
| .andThen s₁ s₂ => buildCfg s₁ buildCfg s₂
| .ifElse _ s₁ s₂ => buildCfg s₁ buildCfg s₂
| .whileLoop _ s => loop (buildCfg s)
| .andThen s₁ s₂ => s₁.cfg s₂.cfg
| .ifElse _ s₁ s₂ => s₁.cfg s₂.cfg
| .whileLoop _ s => loop s.cfg
end Spa