@@ -21,10 +21,10 @@ trait TreeOpsImpl extends scala.tasty.reflect.TreeOps with CoreImpl with Helpers
21
21
}
22
22
23
23
object PackageClause extends PackageClauseModule {
24
- def apply (pid : Ref , stats : List [Tree ])(implicit ctx : Context ): PackageClause =
24
+ def apply (pid : Term . Ref , stats : List [Tree ])(implicit ctx : Context ): PackageClause =
25
25
tpd.PackageDef (pid.asInstanceOf [tpd.RefTree ], stats)
26
26
27
- def unapply (tree : Tree )(implicit ctx : Context ): Option [(Ref , List [Tree ])] = tree match {
27
+ def unapply (tree : Tree )(implicit ctx : Context ): Option [(Term . Ref , List [Tree ])] = tree match {
28
28
case x : tpd.PackageDef => Some ((x.pid, x.stats))
29
29
case _ => None
30
30
}
@@ -34,8 +34,6 @@ trait TreeOpsImpl extends scala.tasty.reflect.TreeOps with CoreImpl with Helpers
34
34
35
35
}
36
36
37
- // ----- Statements -----------------------------------------------
38
-
39
37
object Import extends ImportModule {
40
38
def apply (expr : Term , selectors : List [ImportSelector ])(implicit ctx : Context ): Import =
41
39
tpd.Import (expr, selectors)
@@ -51,6 +49,15 @@ trait TreeOpsImpl extends scala.tasty.reflect.TreeOps with CoreImpl with Helpers
51
49
def selector (implicit ctx : Context ): List [ImportSelector ] = imp.selectors
52
50
}
53
51
52
+ object IsStatement extends IsStatementModule {
53
+ /** Matches any Statement and returns it */
54
+ def unapply (tree : Tree )(implicit ctx : Context ): Option [Statement ] = tree match {
55
+ case IsDefinition (tree) => Some (tree)
56
+ case tree if tree.isTerm => Some (tree)
57
+ case _ => None
58
+ }
59
+ }
60
+
54
61
// ----- Definitions ----------------------------------------------
55
62
56
63
object IsDefinition extends IsDefinitionModule {
@@ -737,10 +744,9 @@ trait TreeOpsImpl extends scala.tasty.reflect.TreeOps with CoreImpl with Helpers
737
744
738
745
object SelectOuter extends SelectOuterModule {
739
746
740
- def apply (call : Option [TermOrTypeTree ], bindings : List [Definition ], expansion : Term )(implicit ctx : Context ): Inlined =
741
- tpd.Inlined (call.getOrElse(tpd.EmptyTree ), bindings.map { case b : tpd.MemberDef => b }, expansion)
747
+ def apply (qualifier : Term , levels : Int , tpe : Type )(implicit ctx : Context ): SelectOuter = ???
742
748
743
- def copy (original : Tree )(call : Option [ TermOrTypeTree ], bindings : List [ Definition ], expansion : Term )(implicit ctx : Context ): Inlined = ???
749
+ def copy (original : Tree )(qualifier : Term , levels : Int , tpe : Type )(implicit ctx : Context ): SelectOuter = ???
744
750
745
751
def unapply (x : Term )(implicit ctx : Context ): Option [(Term , Int , Type )] = x match {
746
752
case x : tpd.Select =>
0 commit comments