Turn buildCfg into a method
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user