Skip to content

Commit f413839

Browse files
committed
Merge pull request #1 from xeno-by/master
Quasiquotification
2 parents 3067152 + f88d08c commit f413839

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

dsl-macros/src/main/scala/ddl/TableMacros.scala

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,16 @@ object TableMacros extends ReflectionUtils {
2525
val table_string_interpolator_name = newTermName("t")
2626

2727
def findTableName(t: Tree): Boolean = t match {
28-
case
29-
Select(Apply(Select(_, named_string_interpolator_candidate), List(Apply(Select(Select(Ident(scala_term_candidate), string_context_candidate), apply_candidate), List(Literal(Constant(_)))))), table_interpolator_name_candidate)
30-
if named_string_interpolator_term == named_string_interpolator_candidate
31-
&& scala_term == scala_term_candidate
32-
&& string_context_name == string_context_candidate
33-
&& apply_term == apply_candidate
34-
&& table_string_interpolator_name == table_interpolator_name_candidate
35-
=>
28+
case q"${_}.NamedStringInterpolator(scala.StringContext.apply(${_})).t" =>
3629
true
3730
case _ =>
3831
false
3932
}
4033

4134
def extractTableName(t: Tree): Option[String] = t match {
4235
case
43-
Select(Apply(Select(_, _), List(Apply(_, List(Literal(Constant(table_name)))))), _)
36+
q"${_}(${_}(${Literal(Constant(table_name: String))})).${_}"
37+
// Select(Apply(Select(_, _), List(Apply(_, List(Literal(Constant(table_name)))))), _)
4438
=>
4539
Some(table_name.toString.trim)
4640
case _ =>

0 commit comments

Comments
 (0)