Skip to content

Commit

Permalink
reuse cached frontend and middleend for server mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdvgt committed Dec 9, 2023
1 parent c918d0d commit 079fc95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ licenses/
bin
.metals/
.vscode/
.bloop/
*.tgz

notes/
Expand Down
15 changes: 8 additions & 7 deletions effekt/shared/src/main/scala/effekt/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,14 @@ trait Compiler[Executable] {
mod
}

def runMiddleend(source: Source)(using Context): Option[Typechecked] =
(Parser andThen
Namer andThen
BoxUnboxInference andThen
Typer andThen
Wellformedness andThen
AnnotateCaptures)(source)
/**
* Used by the server to typecheck, report type errors and show
* captures at boxes and definitions
*/
def runMiddleend(source: Source)(using Context): Option[Module] =
val typechecked = Frontend(source)
typechecked.foreach(res => validate(source, res.mod))
typechecked.flatMap(Middleend.run).map(_.mod)

/**
* Called after running the frontend from editor services.
Expand Down

0 comments on commit 079fc95

Please sign in to comment.