File tree 1 file changed +4
-3
lines changed
compiler/src/dotty/tools/dotc/quoted
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,15 @@ object QuoteContextImpl {
16
16
17
17
def showTree (tree : tpd.Tree )(using Context ): String = {
18
18
val qctx = QuoteContextImpl ()(using MacroExpansion .context(tree))
19
- val reflCtx = ctx.asInstanceOf [qctx.tasty.Context ]
20
- val reflTree = tree.asInstanceOf [qctx.tasty.Tree ]
21
19
val syntaxHighlight =
22
20
if (ctx.settings.color.value == " always" ) SyntaxHighlight .ANSI
23
21
else SyntaxHighlight .plain
24
- new scala.tasty.reflect. SourceCodePrinter [qctx.tasty.type ](qctx.tasty)( syntaxHighlight).showTree(reflTree)( using reflCtx )
22
+ show( using qctx)(tree. asInstanceOf [qctx.tasty.Tree ], syntaxHighlight)( using ctx. asInstanceOf [qctx.tasty. Context ] )
25
23
}
26
24
25
+ private def show (using qctx : QuoteContext )(tree : qctx.tasty.Tree , syntaxHighlight : SyntaxHighlight )(using qctx.tasty.Context ) =
26
+ tree.showWith(syntaxHighlight)
27
+
27
28
private [dotty] def checkScopeId (id : ScopeId )(using Context ): Unit =
28
29
if (id != scopeId)
29
30
throw new scala.quoted.ScopeException (" Cannot call `scala.quoted.staging.run(...)` within a macro or another `run(...)`" )
You can’t perform that action at this time.
0 commit comments