Skip to content

Commit

Permalink
feat(compiler): Allow redeclaring services (and abilities) [LNG-360] (#…
Browse files Browse the repository at this point in the history
…1135)

* Reverse ability search order

* Gather arrows from imported services

* Add test

* Refactor AquaContext

* Add test for abilities

* Update cache
  • Loading branch information
InversionSpaces authored May 10, 2024
1 parent 6cc068a commit faf5b80
Show file tree
Hide file tree
Showing 7 changed files with 465 additions and 176 deletions.
12 changes: 4 additions & 8 deletions compiler/src/main/scala/aqua/compiler/CompilerAPI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,11 @@ object CompilerAPI extends Logging {
filesWithContext.toList
// Process all contexts maintaining Cache
.traverse { case (i, rawContext) =>
for {
cache <- State.get[AquaContext.Cache]
_ = logger.trace(s"Going to prepare exports for $i...")
(exp, expCache) = AquaContext.exportsFromRaw(rawContext, cache)
_ = logger.trace(s"AquaProcessed prepared for $i")
_ <- State.set(expCache)
} yield AquaProcessed(i, exp)
AquaContext
.exportsFromRaw(rawContext)
.map(exp => AquaProcessed(i, exp))
}
.runA(AquaContext.Cache())
.runA(AquaContext.Cache.empty)
// Convert result List to Chain
.map(Chain.fromSeq)
.value
Expand Down
Loading

0 comments on commit faf5b80

Please sign in to comment.