@@ -21,15 +21,15 @@ import scala.quoted.runtime.impl.printers._
21
21
22
22
import scala .reflect .TypeTest
23
23
24
- object QuoteContextImpl {
24
+ object QuotesImpl {
25
25
26
26
type ScopeId = Int
27
27
28
28
def apply ()(using Context ): QuoteContext =
29
- new QuoteContextImpl
29
+ new QuotesImpl
30
30
31
31
def showDecompiledTree (tree : tpd.Tree )(using Context ): String = {
32
- val qctx : QuoteContextImpl = new QuoteContextImpl (using MacroExpansion .context(tree))
32
+ val qctx : QuotesImpl = new QuotesImpl (using MacroExpansion .context(tree))
33
33
if ctx.settings.color.value == " always" then
34
34
qctx.reflect.TreeMethodsImpl .temporaryShowAnsiColored(tree)
35
35
else
@@ -43,7 +43,7 @@ object QuoteContextImpl {
43
43
44
44
}
45
45
46
- class QuoteContextImpl private (using val ctx : Context ) extends QuoteContext , QuoteUnpickler , QuoteMatching :
46
+ class QuotesImpl private (using val ctx : Context ) extends QuoteContext , QuoteUnpickler , QuoteMatching :
47
47
48
48
private val yCheck : Boolean =
49
49
ctx.settings.Ycheck .value(using ctx).exists(x => x == " all" || x == " macros" )
@@ -92,11 +92,11 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
92
92
def pos : Position = self.sourcePos
93
93
def symbol : Symbol = self.symbol
94
94
def showExtractors : String =
95
- Extractors .showTree(using QuoteContextImpl .this )(self)
95
+ Extractors .showTree(using QuotesImpl .this )(self)
96
96
def show : String =
97
- SourceCode .showTree(using QuoteContextImpl .this )(self)(SyntaxHighlight .plain)
97
+ SourceCode .showTree(using QuotesImpl .this )(self)(SyntaxHighlight .plain)
98
98
def showAnsiColored : String =
99
- SourceCode .showTree(using QuoteContextImpl .this )(self)(SyntaxHighlight .ANSI )
99
+ SourceCode .showTree(using QuotesImpl .this )(self)(SyntaxHighlight .ANSI )
100
100
def isExpr : Boolean =
101
101
self match
102
102
case TermTypeTest (self) =>
@@ -106,15 +106,15 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
106
106
case _ => false
107
107
def asExpr : scala.quoted.Expr [Any ] =
108
108
if self.isExpr then
109
- new ExprImpl (self, QuoteContextImpl .this .hashCode)
109
+ new ExprImpl (self, QuotesImpl .this .hashCode)
110
110
else self match
111
111
case TermTypeTest (self) => throw new Exception (" Expected an expression. This is a partially applied Term. Try eta-expanding the term first." )
112
112
case _ => throw new Exception (" Expected a Term but was: " + self)
113
113
end extension
114
114
115
115
extension [T ](self : Tree )
116
116
def asExprOf (using tp : scala.quoted.Type [T ]): scala.quoted.Expr [T ] =
117
- QuoteContextImpl .this .asExprOf[T ](self.asExpr)(using tp)
117
+ QuotesImpl .this .asExprOf[T ](self.asExpr)(using tp)
118
118
end extension
119
119
120
120
extension [ThisTree <: Tree ](self : ThisTree ):
@@ -332,7 +332,7 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
332
332
object Term extends TermModule :
333
333
def of (expr : Expr [Any ]): Term =
334
334
val exprImpl = expr.asInstanceOf [ExprImpl ]
335
- exprImpl.checkScopeId(QuoteContextImpl .this .hashCode)
335
+ exprImpl.checkScopeId(QuotesImpl .this .hashCode)
336
336
exprImpl.tree
337
337
338
338
def betaReduce (tree : Term ): Option [Term ] =
@@ -352,11 +352,11 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
352
352
object TermMethodsImpl extends TermMethods :
353
353
extension (self : Term ):
354
354
def seal : scala.quoted.Expr [Any ] =
355
- if self.isExpr then new ExprImpl (self, QuoteContextImpl .this .hashCode)
355
+ if self.isExpr then new ExprImpl (self, QuotesImpl .this .hashCode)
356
356
else throw new Exception (" Cannot seal a partially applied Term. Try eta-expanding the term first." )
357
357
358
358
def sealOpt : Option [scala.quoted.Expr [Any ]] =
359
- if self.isExpr then Some (new ExprImpl (self, QuoteContextImpl .this .hashCode))
359
+ if self.isExpr then Some (new ExprImpl (self, QuotesImpl .this .hashCode))
360
360
else None
361
361
362
362
def tpe : TypeRepr = self.tpe
@@ -1564,18 +1564,18 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
1564
1564
object TypeReprMethodsImpl extends TypeReprMethods :
1565
1565
extension (self : TypeRepr ):
1566
1566
def showExtractors : String =
1567
- Extractors .showType(using QuoteContextImpl .this )(self)
1567
+ Extractors .showType(using QuotesImpl .this )(self)
1568
1568
1569
1569
def show : String =
1570
- SourceCode .showType(using QuoteContextImpl .this )(self)(SyntaxHighlight .plain)
1570
+ SourceCode .showType(using QuotesImpl .this )(self)(SyntaxHighlight .plain)
1571
1571
1572
1572
def showAnsiColored : String =
1573
- SourceCode .showType(using QuoteContextImpl .this )(self)(SyntaxHighlight .ANSI )
1573
+ SourceCode .showType(using QuotesImpl .this )(self)(SyntaxHighlight .ANSI )
1574
1574
1575
1575
def seal : scala.quoted.Type [_] = self.asType
1576
1576
1577
1577
def asType : scala.quoted.Type [? ] =
1578
- new TypeImpl (Inferred (self), QuoteContextImpl .this .hashCode)
1578
+ new TypeImpl (Inferred (self), QuotesImpl .this .hashCode)
1579
1579
1580
1580
def =:= (that : TypeRepr ): Boolean = self =:= that
1581
1581
def <:< (that : TypeRepr ): Boolean = self <:< that
@@ -2129,11 +2129,11 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
2129
2129
extension (self : Constant ):
2130
2130
def value : Any = self.value
2131
2131
def showExtractors : String =
2132
- Extractors .showConstant(using QuoteContextImpl .this )(self)
2132
+ Extractors .showConstant(using QuotesImpl .this )(self)
2133
2133
def show : String =
2134
- SourceCode .showConstant(using QuoteContextImpl .this )(self)(SyntaxHighlight .plain)
2134
+ SourceCode .showConstant(using QuotesImpl .this )(self)(SyntaxHighlight .plain)
2135
2135
def showAnsiColored : String =
2136
- SourceCode .showConstant(using QuoteContextImpl .this )(self)(SyntaxHighlight .ANSI )
2136
+ SourceCode .showConstant(using QuotesImpl .this )(self)(SyntaxHighlight .ANSI )
2137
2137
end extension
2138
2138
end ConstantMethodsImpl
2139
2139
@@ -2335,11 +2335,11 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
2335
2335
def children : List [Symbol ] = self.denot.children
2336
2336
2337
2337
def showExtractors : String =
2338
- Extractors .showSymbol(using QuoteContextImpl .this )(self)
2338
+ Extractors .showSymbol(using QuotesImpl .this )(self)
2339
2339
def show : String =
2340
- SourceCode .showSymbol(using QuoteContextImpl .this )(self)(SyntaxHighlight .plain)
2340
+ SourceCode .showSymbol(using QuotesImpl .this )(self)(SyntaxHighlight .plain)
2341
2341
def showAnsiColored : String =
2342
- SourceCode .showSymbol(using QuoteContextImpl .this )(self)(SyntaxHighlight .ANSI )
2342
+ SourceCode .showSymbol(using QuotesImpl .this )(self)(SyntaxHighlight .ANSI )
2343
2343
2344
2344
end extension
2345
2345
@@ -2472,11 +2472,11 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
2472
2472
def | (that : Flags ): Flags = dotc.core.Flags .or(self, that) // TODO: Replace with dotc.core.Flags.|(self)(that) once extension names have stabilized
2473
2473
def & (that : Flags ): Flags = dotc.core.Flags .and(self, that)// TODO: Replace with dotc.core.Flags.&(self)(that) once extension names have stabilized
2474
2474
def showExtractors : String =
2475
- Extractors .showFlags(using QuoteContextImpl .this )(self)
2475
+ Extractors .showFlags(using QuotesImpl .this )(self)
2476
2476
def show : String =
2477
- SourceCode .showFlags(using QuoteContextImpl .this )(self)(SyntaxHighlight .plain)
2477
+ SourceCode .showFlags(using QuotesImpl .this )(self)(SyntaxHighlight .plain)
2478
2478
def showAnsiColored : String =
2479
- SourceCode .showFlags(using QuoteContextImpl .this )(self)(SyntaxHighlight .ANSI )
2479
+ SourceCode .showFlags(using QuotesImpl .this )(self)(SyntaxHighlight .ANSI )
2480
2480
end extension
2481
2481
end FlagsMethodsImpl
2482
2482
@@ -2648,7 +2648,7 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
2648
2648
ctx1.gadt.addToConstraint(typeHoles)
2649
2649
ctx1
2650
2650
2651
- val qctx1 = QuoteContextImpl ()(using ctx1)
2651
+ val qctx1 = QuotesImpl ()(using ctx1)
2652
2652
2653
2653
val matcher = new Matcher .QuoteMatcher [qctx1.type ](qctx1) {
2654
2654
def patternHoleSymbol : qctx1.reflect.Symbol = dotc.core.Symbols .defn.QuotedRuntimePatterns_patternHole .asInstanceOf
@@ -2672,7 +2672,7 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
2672
2672
}
2673
2673
}
2674
2674
2675
- private [this ] val hash = QuoteContextImpl .scopeId(using ctx)
2675
+ private [this ] val hash = QuotesImpl .scopeId(using ctx)
2676
2676
override def hashCode : Int = hash
2677
2677
2678
- end QuoteContextImpl
2678
+ end QuotesImpl
0 commit comments