Skip to content

Add tasty.reflect.Kernel #5990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TastyConsumerPhase(consumer: TastyConsumer) extends Phase {
override def phaseName: String = "tastyConsumer"

override def run(implicit ctx: Context): Unit = {
val reflect = new ReflectionImpl(ctx)
val reflect = ReflectionImpl(ctx)
consumer(reflect)(ctx.compilationUnit.tpdTree)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class DecompilationPrinter extends Phase {
} else {
val unitFile = unit.source.toString.replace("\\", "/").replace(".class", ".tasty")
out.println(s"/** Decompiled from $unitFile */")
out.println(new ReflectionImpl(ctx).showSourceCode.showTree(unit.tpdTree)(ctx))
val refl = ReflectionImpl(ctx)
out.println(new refl.SourceCodePrinter().showTree(unit.tpdTree)(ctx))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class IDEDecompilerDriver(val settings: List[String]) extends dotc.Driver {
run.printSummary()
val unit = ctx.run.units.head

val decompiled = new ReflectionImpl(ctx).showSourceCode.showTree(unit.tpdTree)
val refl = ReflectionImpl(ctx)
val decompiled = new refl.SourceCodePrinter().showTree(unit.tpdTree)
val tree = new TastyHTMLPrinter(unit.pickled.head._2).printContents()

reporter.removeBufferedMessages.foreach(message => System.err.println(message))
Expand Down
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/quoted/QuoteDriver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class QuoteDriver extends Driver {
val tree1 =
if (ctx.settings.YshowRawQuoteTrees.value) tree
else (new TreeCleaner).transform(tree)
new ReflectionImpl(ctx).showSourceCode.showTree(tree1)
val refl = ReflectionImpl(ctx)
new refl.SourceCodePrinter().showTree(tree1)
}
withTree(expr, show, settings)
}
Expand Down
37 changes: 0 additions & 37 deletions compiler/src/dotty/tools/dotc/tastyreflect/CaseDefOpsImpl.scala

This file was deleted.

10 changes: 0 additions & 10 deletions compiler/src/dotty/tools/dotc/tastyreflect/CommentOpsImpl.scala

This file was deleted.

113 changes: 0 additions & 113 deletions compiler/src/dotty/tools/dotc/tastyreflect/ConstantOpsImpl.scala

This file was deleted.

13 changes: 0 additions & 13 deletions compiler/src/dotty/tools/dotc/tastyreflect/ContextOpsImpl.scala

This file was deleted.

132 changes: 0 additions & 132 deletions compiler/src/dotty/tools/dotc/tastyreflect/CoreImpl.scala

This file was deleted.

Loading