From 95bbe8ed73dc2469ea39efa4e698d27a6d296720 Mon Sep 17 00:00:00 2001 From: DieMyst Date: Wed, 19 Apr 2023 14:04:27 +0400 Subject: [PATCH] printlns --- aqua-src/antithesis.aqua | 15 ++++++--------- .../scala/aqua/model/inline/ArrowInliner.scala | 6 ++++++ .../scala/aqua/model/transform/Transform.scala | 2 ++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/aqua-src/antithesis.aqua b/aqua-src/antithesis.aqua index ff45751f..7d5ba17e 100644 --- a/aqua-src/antithesis.aqua +++ b/aqua-src/antithesis.aqua @@ -1,10 +1,7 @@ -func returnCall() -> string -> string: - closure = (s: string) -> string: - <- s - closure("123asdf") - <- closure +service Op("op"): + noop() -func test() -> string: - a = returnCall() - b = a("arg") - <- b \ No newline at end of file +func test(): + a:*string + on a[0] via a[1]: + Op.noop() \ No newline at end of file diff --git a/model/inline/src/main/scala/aqua/model/inline/ArrowInliner.scala b/model/inline/src/main/scala/aqua/model/inline/ArrowInliner.scala index d7af9c33..64ce18dc 100644 --- a/model/inline/src/main/scala/aqua/model/inline/ArrowInliner.scala +++ b/model/inline/src/main/scala/aqua/model/inline/ArrowInliner.scala @@ -50,11 +50,16 @@ object ArrowInliner extends Logging { // Now, substitute the arrows that were received as function arguments // Use the new op tree (args are replaced with values, names are unique & safe) callableFuncBodyNoTopology <- TagInliner.handleTree(tree, fn.funcName) + + _ = println("func no topology: " + callableFuncBodyNoTopology.show) + callableFuncBody = fn.capturedTopology .fold[OpModel](SeqModel)(ApplyTopologyModel.apply) .wrap(callableFuncBodyNoTopology) + _ = println("func topology: " + callableFuncBody.show) + // Fix return values with exports collected in the body resolvedResult <- RawValueInliner.valueListToModel(result) // Fix the return values @@ -196,6 +201,7 @@ object ArrowInliner extends Logging { for { _ <- Arrows[S].resolved(passArrows) av <- ArrowInliner.inline(arrow, call) + _ = println("after inlining: " + av._1.show) // find and get resolved arrows if we return them from the function returnedArrows = av._2.collect { case VarModel(name, ArrowType(_, _), _) => name diff --git a/model/transform/src/main/scala/aqua/model/transform/Transform.scala b/model/transform/src/main/scala/aqua/model/transform/Transform.scala index faf8fda8..4931bc67 100644 --- a/model/transform/src/main/scala/aqua/model/transform/Transform.scala +++ b/model/transform/src/main/scala/aqua/model/transform/Transform.scala @@ -68,6 +68,8 @@ object Transform extends Logging { // Resolve the topology, clear the resulting tree val resultingTree = preparedFunc.flatMap(tree => Topology.resolve(tree).map(clear(_))) + println("resultingTree: " + resultingTree.value.show) + resultingTree.map(res => FuncRes( func.funcName,