@@ -9,19 +9,19 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
9
9
import tasty ._
10
10
import syntaxHighlight ._
11
11
12
- def showTree (tree : Tree )( using ctx : Context ) : String =
12
+ def showTree (tree : Tree ): String =
13
13
(new Buffer ).printTree(tree).result()
14
14
15
- def showType (tpe : Type )( using ctx : Context ) : String =
15
+ def showType (tpe : Type ): String =
16
16
(new Buffer ).printType(tpe)(using None ).result()
17
17
18
- def showConstant (const : Constant )( using ctx : Context ) : String =
18
+ def showConstant (const : Constant ): String =
19
19
(new Buffer ).printConstant(const).result()
20
20
21
- def showSymbol (symbol : Symbol )( using ctx : Context ) : String =
21
+ def showSymbol (symbol : Symbol ): String =
22
22
symbol.fullName
23
23
24
- def showFlags (flags : Flags )( using ctx : Context ) : String = {
24
+ def showFlags (flags : Flags ): String = {
25
25
val flagList = List .newBuilder[String ]
26
26
if (flags.is(Flags .Abstract )) flagList += " abstract"
27
27
if (flags.is(Flags .Artifact )) flagList += " artifact"
@@ -60,7 +60,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
60
60
flagList.result().mkString(" /*" , " " , " */" )
61
61
}
62
62
63
- private class Buffer ( using ctx : Context ) {
63
+ private class Buffer {
64
64
65
65
private [this ] val sb : StringBuilder = new StringBuilder
66
66
@@ -1413,7 +1413,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1413
1413
private [this ] val names = collection.mutable.Map .empty[Symbol , String ]
1414
1414
private [this ] val namesIndex = collection.mutable.Map .empty[String , Int ]
1415
1415
1416
- private def splicedName (sym : Symbol )( using ctx : Context ) : Option [String ] = {
1416
+ private def splicedName (sym : Symbol ): Option [String ] = {
1417
1417
sym.annots.find(_.symbol.owner == Symbol .requiredClass(" scala.internal.quoted.showName" )).flatMap {
1418
1418
case Apply (_, Literal (Constant (c : String )) :: Nil ) => Some (c)
1419
1419
case Apply (_, Inlined (_, _, Literal (Constant (c : String ))) :: Nil ) => Some (c)
@@ -1434,7 +1434,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1434
1434
}
1435
1435
1436
1436
private object SpecialOp {
1437
- def unapply (arg : Tree )( using ctx : Context ) : Option [(String , List [Term ])] = arg match {
1437
+ def unapply (arg : Tree ): Option [(String , List [Term ])] = arg match {
1438
1438
case arg @ Apply (fn, args) =>
1439
1439
fn.tpe match {
1440
1440
case tpe @ TermRef (ThisType (TypeRef (_, name)), name2) if name == " <special-ops>" =>
@@ -1446,7 +1446,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1446
1446
}
1447
1447
1448
1448
private object Annotation {
1449
- def unapply (arg : Tree )( using ctx : Context ) : Option [(TypeTree , List [Term ])] = arg match {
1449
+ def unapply (arg : Tree ): Option [(TypeTree , List [Term ])] = arg match {
1450
1450
case New (annot) => Some ((annot, Nil ))
1451
1451
case Apply (Select (New (annot), " <init>" ), args) => Some ((annot, args))
1452
1452
case Apply (TypeApply (Select (New (annot), " <init>" ), targs), args) => Some ((annot, args))
@@ -1458,7 +1458,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1458
1458
private object Types {
1459
1459
1460
1460
object Sequence {
1461
- def unapply (tpe : Type )( using ctx : Context ) : Option [Type ] = tpe match {
1461
+ def unapply (tpe : Type ): Option [Type ] = tpe match {
1462
1462
case AppliedType (seq, (tp : Type ) :: Nil )
1463
1463
if seq.typeSymbol == Symbol .requiredClass(" scala.collection.Seq" ) || seq.typeSymbol == Symbol .requiredClass(" scala.collection.immutable.Seq" ) =>
1464
1464
Some (tp)
@@ -1467,7 +1467,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1467
1467
}
1468
1468
1469
1469
object Repeated {
1470
- def unapply (tpe : Type )( using ctx : Context ) : Option [Type ] = tpe match {
1470
+ def unapply (tpe : Type ): Option [Type ] = tpe match {
1471
1471
case AppliedType (rep, (tp : Type ) :: Nil ) if rep.typeSymbol == Symbol .requiredClass(" scala.<repeated>" ) => Some (tp)
1472
1472
case _ => None
1473
1473
}
@@ -1476,7 +1476,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1476
1476
}
1477
1477
1478
1478
object PackageObject {
1479
- def unapply (tree : Tree )( using ctx : Context ) : Option [Tree ] = tree match {
1479
+ def unapply (tree : Tree ): Option [Tree ] = tree match {
1480
1480
case PackageClause (_, ValDef (" package" , _, _) :: body :: Nil ) => Some (body)
1481
1481
case _ => None
1482
1482
}
0 commit comments