Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
mio-19 committed Oct 25, 2024
1 parent b455f05 commit c5ec665
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import scala.meta._
import chester.syntax.core._
object Scala {
case class ScalaContext()
def compile(term: core.Term)(implicit ctx: ScalaContext = null): meta.Tree = term match {
def compileExpr(term: core.Term)(implicit ctx: ScalaContext = null): meta.Tree = term match {
case IntegerTerm(i, _) => {
require(i.isValidInt)
Lit.Int(i.toInt)
Expand All @@ -18,5 +18,7 @@ object Scala {
case UnitTerm(_) => Lit.Unit()
case _ => throw new NotImplementedError(s"not implemented ${term.getClass.getName} $term")
}

def compileStmt(stmt: core.StmtTerm)(implicit ctx: ScalaContext = null): meta.Stat = stmt match {
case _ => throw new NotImplementedError(s"not implemented ${stmt.getClass.getName} $stmt")
}
}
2 changes: 1 addition & 1 deletion compiler213/shared/src/main/scala/chester/scala/Test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ object Test {
val test: meta.Term.Apply = q"function(argument)"
def callit(): Unit = {
println(test)
println(Scala.compile(core.BooleanTerm(false, meta = None)))
println(Scala.compileExpr(core.BooleanTerm(false, meta = None)))
}
}

0 comments on commit c5ec665

Please sign in to comment.