Commit 18cbf312 authored by Sapphie's avatar Sapphie
Browse files

Implement Ident and fix up some exceptions

parent d93765fe
......@@ -82,15 +82,15 @@ object CL3ToCPSTranslator extends (S.Tree => C.Tree) {
val name = Symbol.fresh("v")
val body = ctx(C.AtomN(name))
val start: C.Tree = C.LetP(name, p, Seq(), body)
args.foldLeft(start){
args.foldLeft(start) {
case (C.LetP(_, _, s, _), e) =>
transform(e)(v => {
C.LetP(name, p, s :+ v, body)
})
case _ => ???
case _ => throw new Exception("unreachable code")
}
}
case _ => ???
case S.Ident(id) => ctx(C.AtomN(id))
}
}
......@@ -109,8 +109,7 @@ object CL3ToCPSTranslator extends (S.Tree => C.Tree) {
transform(e)(v => {
C.If(p, s :+ v, thenC, elseC)
})
case _ => ??? // put some exception here idk
// (this is just to shut the compiler up)
case _ => throw new Exception("unreachable code")
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment