diff --git a/compiler213/shared/src/main/scala/chester/backend/scala/Scala.scala b/compiler213/shared/src/main/scala/chester/backend/scala/Scala.scala index 69e4955a..6a9710db 100644 --- a/compiler213/shared/src/main/scala/chester/backend/scala/Scala.scala +++ b/compiler213/shared/src/main/scala/chester/backend/scala/Scala.scala @@ -7,8 +7,14 @@ import chester.syntax.core._ object Scala { case class ScalaContext() def compile(term: core.Term)(implicit ctx: ScalaContext): meta.Tree = term match { - case IntegerTerm(i, _) => Lit.Int(i.toInt) - case _ => throw new NotImplementedError(s"not implemented ${term.getClass.getName} $term") + case IntegerTerm(i, _) => { + require(i.isValidInt) + Lit.Int(i.toInt) + } + case IntTerm(i, _) => Lit.Int(i) + case StringTerm(s, _) => Lit.String(s) + case SymbolTerm(s, _) => Lit.Symbol(Symbol(s)) + case _ => throw new NotImplementedError(s"not implemented ${term.getClass.getName} $term") } }