@@ -39,13 +39,14 @@ object QuotesImpl {
39
39
class QuotesImpl private (using val ctx : Context ) extends Quotes , QuoteUnpickler , QuoteMatching :
40
40
41
41
private val xCheckMacro : Boolean = ctx.settings.XcheckMacros .value
42
+ private val quoteMatcher : QuoteMatcher = QuoteMatcher (ctx.settings.YdebugMacros .value)
42
43
43
44
extension [T ](self : scala.quoted.Expr [T ])
44
45
def show : String =
45
46
reflect.Printer .TreeCode .show(reflect.asTerm(self))
46
47
47
48
def matches (that : scala.quoted.Expr [Any ]): Boolean =
48
- QuoteMatcher .treeMatch(reflect.asTerm(self), reflect.asTerm(that)).nonEmpty
49
+ quoteMatcher .treeMatch(reflect.asTerm(self), reflect.asTerm(that)).nonEmpty
49
50
50
51
def valueOrAbort (using fromExpr : FromExpr [T ]): T =
51
52
def reportError =
@@ -3159,14 +3160,14 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
3159
3160
def unapply [TypeBindings , Tup <: Tuple ](scrutinee : scala.quoted.Expr [Any ])(using pattern : scala.quoted.Expr [Any ]): Option [Tup ] =
3160
3161
val scrutineeTree = reflect.asTerm(scrutinee)
3161
3162
val patternTree = reflect.asTerm(pattern)
3162
- QuoteMatcher .treeMatch(scrutineeTree, patternTree).asInstanceOf [Option [Tup ]]
3163
+ quoteMatcher .treeMatch(scrutineeTree, patternTree).asInstanceOf [Option [Tup ]]
3163
3164
end ExprMatch
3164
3165
3165
3166
object TypeMatch extends TypeMatchModule :
3166
3167
def unapply [TypeBindings , Tup <: Tuple ](scrutinee : scala.quoted.Type [? ])(using pattern : scala.quoted.Type [? ]): Option [Tup ] =
3167
3168
val scrutineeTree = reflect.TypeTree .of(using scrutinee)
3168
3169
val patternTree = reflect.TypeTree .of(using pattern)
3169
- QuoteMatcher .treeMatch(scrutineeTree, patternTree).asInstanceOf [Option [Tup ]]
3170
+ quoteMatcher .treeMatch(scrutineeTree, patternTree).asInstanceOf [Option [Tup ]]
3170
3171
end TypeMatch
3171
3172
3172
3173
end QuotesImpl
0 commit comments