Skip to content
Snippets Groups Projects
Commit bf8889f4 authored by Emmanouil (Manos) Koukoutos's avatar Emmanouil (Manos) Koukoutos
Browse files

Extract string literals in degenerate cases

parent fcd94c47
No related branches found
No related tags found
No related merge requests found
...@@ -154,9 +154,11 @@ trait ASTExtractors { ...@@ -154,9 +154,11 @@ trait ASTExtractors {
object ExStringLiteral { object ExStringLiteral {
def unapply(tree: Apply): Option[String] = tree match { def unapply(tree: Tree): Option[String] = tree match {
case Apply(ExSelected("leon", "lang", "string", "package", "strToStr"), (str: Literal) :: Nil) => case Apply(ExSelected("leon", "lang", "string", "package", "strToStr"), (str: Literal) :: Nil) =>
Some(str.value.stringValue) Some(str.value.stringValue)
case Literal(c @ Constant(i)) if c.tpe == StringClass.tpe =>
Some(c.stringValue)
case _ => case _ =>
None None
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment