forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
However, the A.tasty and B_rename.tasty files from the repo in the issue don't seem to load inside the dotty repo ???
- Loading branch information
Issac Kurian
committed
Nov 29, 2022
1 parent
5c9b6e2
commit ed6132b
Showing
21 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
51 changes: 51 additions & 0 deletions
51
tasty-inspector/src/scala/tasty/inspector/RunTastyInspector.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package scala.tasty.inspector | ||
|
||
import scala.quoted.* | ||
|
||
import scala.io.Source | ||
|
||
import java.io.File | ||
import java.nio.file.Path | ||
import java.nio.file.Files | ||
import java.nio.file.Paths | ||
import java.text.Collator | ||
import java.util.stream.Collectors | ||
import scala.jdk.CollectionConverters._ | ||
|
||
import java.net.URLClassLoader | ||
|
||
|
||
object StacktracesInspector extends Inspector: | ||
override def inspect(using q: Quotes)(tastys: List[Tasty[quotes.type]]): Unit = | ||
import q.reflect.* | ||
|
||
for tasty <- tastys do | ||
println("AST:") | ||
println(tasty.ast.getClass) | ||
|
||
def main(args: Array[String]): Unit = | ||
val files: List[Path] = Files.walk(Paths.get("src/resources")).collect(Collectors.toList).asScala.toList.filter(_.toString.endsWith("tasty")) | ||
|
||
val (arr, rest) = files.partition(_.toString.contains("Array")) | ||
|
||
|
||
rest.foreach { f => | ||
println("Class Name:") | ||
println(f.toString) | ||
TastyInspector.inspectTastyFiles(List(f.toAbsolutePath.toString))(StacktracesInspector) | ||
println() | ||
} | ||
|
||
|
||
println("How many Array.tasty files are there:") | ||
println(arr.size) | ||
println("How many Array.tasty files with different size are there: ") | ||
println(arr.map(f => Files.readAllBytes(f).toArray.size).distinct.size) | ||
|
||
arr.foreach { f => | ||
println("Class Name:") | ||
println(f.toString) | ||
TastyInspector.inspectTastyFiles(List(f.toAbsolutePath.toString))(StacktracesInspector) | ||
println() | ||
} | ||
|