Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
mio-19 committed Dec 5, 2024
1 parent 3c32657 commit cdee74e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ lazy val interpreter = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(CrossType.Full)
.in(file("interpreter"))
.dependsOn(eval, parser)
.dependsOn(eval, parser, tyck)
.settings(commonSettings)
// https://github.com/b-studios/scala-graal-truffle-example/blob/c2747a6eece156f878c5b934116aaa00a2cd6311/build.sbt
.settings(
Expand Down
10 changes: 8 additions & 2 deletions interpreter/jvm/src/main/scala/chester/truffle/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ package chester.truffle

import com.oracle.truffle.api.{CallTarget, TruffleLanguage}
import chester.parser.*
import chester.tyck.*

object Utils {
@throws[Exception]
def parse(request: TruffleLanguage.ParsingRequest): CallTarget = {
val parsed = Parser.parseExpr(FileNameAndContent(request.getSource.getPath, request.getSource.getCharacters.toString))
???
Parser.parseTopLevel(FileNameAndContent(request.getSource.getPath, request.getSource.getCharacters.toString)) match {
case Left(err) => ???
case Right(result) => Tycker.check(parsedBlock) match {
case TyckResult.Success(result, _, _) => ???
case TyckResult.Failure(errors, _, _, _) => ???
}
}
}
}

0 comments on commit cdee74e

Please sign in to comment.