Skip to content
Snippets Groups Projects
Commit 1367da7d authored by Ali Sinan Köksal's avatar Ali Sinan Köksal
Browse files

extraction of typed expressions in funcheck

parent ebcbe6cf
Branches
Tags
No related merge requests found
......@@ -357,6 +357,7 @@ trait CodeExtraction extends Extractors {
}
case ExInt32Literal(v) => IntLiteral(v).setType(Int32Type)
case ExBooleanLiteral(v) => BooleanLiteral(v).setType(BooleanType)
case ExTyped(e,tpt) => rec(e)
case ExIdentifier(sym,tpt) => varSubsts.get(sym) match {
case Some(fun) => fun()
case None => {
......
......@@ -199,6 +199,13 @@ trait Extractors {
}
}
object ExTyped {
def unapply(tree : Typed): Option[(Tree,Tree)] = tree match {
case Typed(e,t) => Some((e,t))
case _ => None
}
}
object ExIntIdentifier {
def unapply(tree: Ident): Option[String] = tree match {
case i: Ident if i.symbol.tpe == IntClass.tpe => Some(i.symbol.name.toString)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment