@@ -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
@@ -1559,18 +1559,18 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
1559
1559
object TypeReprMethodsImpl extends TypeReprMethods :
1560
1560
extension (self : TypeRepr ):
1561
1561
def showExtractors : String =
1562
- Extractors .showType(using QuoteContextImpl .this )(self)
1562
+ Extractors .showType(using QuotesImpl .this )(self)
1563
1563
1564
1564
def show : String =
1565
- SourceCode .showType(using QuoteContextImpl .this )(self)(SyntaxHighlight .plain)
1565
+ SourceCode .showType(using QuotesImpl .this )(self)(SyntaxHighlight .plain)
1566
1566
1567
1567
def showAnsiColored : String =
1568
- SourceCode .showType(using QuoteContextImpl .this )(self)(SyntaxHighlight .ANSI )
1568
+ SourceCode .showType(using QuotesImpl .this )(self)(SyntaxHighlight .ANSI )
1569
1569
1570
1570
def seal : scala.quoted.Type [_] = self.asType
1571
1571
1572
1572
def asType : scala.quoted.Type [? ] =
1573
- new TypeImpl (Inferred (self), QuoteContextImpl .this .hashCode)
1573
+ new TypeImpl (Inferred (self), QuotesImpl .this .hashCode)
1574
1574
1575
1575
def =:= (that : TypeRepr ): Boolean = self =:= that
1576
1576
def <:< (that : TypeRepr ): Boolean = self <:< that
@@ -2124,11 +2124,11 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
2124
2124
extension (self : Constant ):
2125
2125
def value : Any = self.value
2126
2126
def showExtractors : String =
2127
- Extractors .showConstant(using QuoteContextImpl .this )(self)
2127
+ Extractors .showConstant(using QuotesImpl .this )(self)
2128
2128
def show : String =
2129
- SourceCode .showConstant(using QuoteContextImpl .this )(self)(SyntaxHighlight .plain)
2129
+ SourceCode .showConstant(using QuotesImpl .this )(self)(SyntaxHighlight .plain)
2130
2130
def showAnsiColored : String =
2131
- SourceCode .showConstant(using QuoteContextImpl .this )(self)(SyntaxHighlight .ANSI )
2131
+ SourceCode .showConstant(using QuotesImpl .this )(self)(SyntaxHighlight .ANSI )
2132
2132
end extension
2133
2133
end ConstantMethodsImpl
2134
2134
@@ -2330,11 +2330,11 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
2330
2330
def children : List [Symbol ] = self.denot.children
2331
2331
2332
2332
def showExtractors : String =
2333
- Extractors .showSymbol(using QuoteContextImpl .this )(self)
2333
+ Extractors .showSymbol(using QuotesImpl .this )(self)
2334
2334
def show : String =
2335
- SourceCode .showSymbol(using QuoteContextImpl .this )(self)(SyntaxHighlight .plain)
2335
+ SourceCode .showSymbol(using QuotesImpl .this )(self)(SyntaxHighlight .plain)
2336
2336
def showAnsiColored : String =
2337
- SourceCode .showSymbol(using QuoteContextImpl .this )(self)(SyntaxHighlight .ANSI )
2337
+ SourceCode .showSymbol(using QuotesImpl .this )(self)(SyntaxHighlight .ANSI )
2338
2338
2339
2339
end extension
2340
2340
@@ -2467,11 +2467,11 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
2467
2467
def | (that : Flags ): Flags = dotc.core.Flags .or(self, that) // TODO: Replace with dotc.core.Flags.|(self)(that) once extension names have stabilized
2468
2468
def & (that : Flags ): Flags = dotc.core.Flags .and(self, that)// TODO: Replace with dotc.core.Flags.&(self)(that) once extension names have stabilized
2469
2469
def showExtractors : String =
2470
- Extractors .showFlags(using QuoteContextImpl .this )(self)
2470
+ Extractors .showFlags(using QuotesImpl .this )(self)
2471
2471
def show : String =
2472
- SourceCode .showFlags(using QuoteContextImpl .this )(self)(SyntaxHighlight .plain)
2472
+ SourceCode .showFlags(using QuotesImpl .this )(self)(SyntaxHighlight .plain)
2473
2473
def showAnsiColored : String =
2474
- SourceCode .showFlags(using QuoteContextImpl .this )(self)(SyntaxHighlight .ANSI )
2474
+ SourceCode .showFlags(using QuotesImpl .this )(self)(SyntaxHighlight .ANSI )
2475
2475
end extension
2476
2476
end FlagsMethodsImpl
2477
2477
@@ -2643,7 +2643,7 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
2643
2643
ctx1.gadt.addToConstraint(typeHoles)
2644
2644
ctx1
2645
2645
2646
- val qctx1 = QuoteContextImpl ()(using ctx1)
2646
+ val qctx1 = QuotesImpl ()(using ctx1)
2647
2647
2648
2648
val matcher = new Matcher .QuoteMatcher [qctx1.type ](qctx1) {
2649
2649
def patternHoleSymbol : qctx1.reflect.Symbol = dotc.core.Symbols .defn.QuotedRuntimePatterns_patternHole .asInstanceOf
@@ -2667,7 +2667,7 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu
2667
2667
}
2668
2668
}
2669
2669
2670
- private [this ] val hash = QuoteContextImpl .scopeId(using ctx)
2670
+ private [this ] val hash = QuotesImpl .scopeId(using ctx)
2671
2671
override def hashCode : Int = hash
2672
2672
2673
- end QuoteContextImpl
2673
+ end QuotesImpl
0 commit comments