Skip to content

Commit a7bdb9f

Browse files
committed
Move TastyFormat to separate sbt project
1 parent c5cc489 commit a7bdb9f

File tree

16 files changed

+46
-26
lines changed

16 files changed

+46
-26
lines changed

build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ val `dotty-staging` = Build.`dotty-staging`
1414
val `dotty-language-server` = Build.`dotty-language-server`
1515
val `dotty-bench` = Build.`dotty-bench`
1616
val `dotty-bench-bootstrapped` = Build.`dotty-bench-bootstrapped`
17+
val `tasty-core` = Build.`tasty-core`
18+
val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped`
1719
val `scala-library` = Build.`scala-library`
1820
val `scala-compiler` = Build.`scala-compiler`
1921
val `scala-reflect` = Build.`scala-reflect`

compiler/src/dotty/tools/dotc/core/NameTags.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
package dotty.tools
2-
package dotc
3-
package core
1+
package dotty.tools.dotc.core
42

5-
import tasty.TastyFormat
3+
import dotty.tools.tasty.TastyFormat
64

75
/** The possible tags of a NameKind */
86
object NameTags extends TastyFormat.NameTags {

compiler/src/dotty/tools/dotc/core/tasty/PositionPickler.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package dotc
33
package core
44
package tasty
55

6+
import dotty.tools.tasty.TastyFormat.SOURCE
7+
68
import ast._
79
import ast.Trees._
810
import ast.Trees.WithLazyField
@@ -12,7 +14,6 @@ import Contexts._, Symbols._, Annotations._, Decorators._
1214
import collection.mutable
1315
import TastyBuffer._
1416
import util.Spans._
15-
import TastyFormat.SOURCE
1617

1718
class PositionPickler(pickler: TastyPickler, addrOfTree: untpd.Tree => Addr) {
1819
val buf: TastyBuffer = new TastyBuffer(5000)

compiler/src/dotty/tools/dotc/core/tasty/PositionUnpickler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package dotc
33
package core
44
package tasty
55

6+
import dotty.tools.tasty.TastyFormat.SOURCE
7+
68
import util.Spans._
79
import collection.{mutable, Map}
810
import TastyBuffer.{Addr, NameRef}
9-
import TastyFormat.SOURCE
1011
import Names.TermName
1112

1213
/** Unpickler for tree positions */
@@ -61,4 +62,3 @@ class PositionUnpickler(reader: TastyReader, nameAtRef: NameRef => TermName) {
6162
def spanAt(addr: Addr): Span = spans.getOrElse(addr, NoSpan)
6263
def sourcePathAt(addr: Addr): String = sourcePaths.getOrElse(addr, "")
6364
}
64-

compiler/src/dotty/tools/dotc/core/tasty/TastyClassName.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TastyClassName(bytes: Array[Byte]) {
2020
def readName(): Option[(TermName, TermName)] = unpickle(new TreeSectionUnpickler)
2121

2222
class TreeSectionUnpickler extends SectionUnpickler[(TermName, TermName)](TreePickler.sectionName) {
23-
import TastyFormat._
23+
import dotty.tools.tasty.TastyFormat._
2424
def unpickle(reader: TastyReader, tastyName: NameTable): (TermName, TermName) = {
2525
import reader._
2626
def readName() = {

compiler/src/dotty/tools/dotc/core/tasty/TastyHeaderUnpickler.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ package tasty
44

55
import java.util.UUID
66

7-
import dotty.tools.dotc.core.tasty.TastyFormat.{MajorVersion, MinorVersion, header}
8-
import dotty.tools.dotc.core.tasty.TastyUnpickler.UnpickleException
7+
import dotty.tools.tasty.TastyFormat.{MajorVersion, MinorVersion, header}
98

109
class TastyHeaderUnpickler(reader: TastyReader) {
1110
import reader._

compiler/src/dotty/tools/dotc/core/tasty/TastyPickler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package dotc
33
package core
44
package tasty
55

6-
import TastyFormat._
6+
import dotty.tools.tasty.TastyFormat._
7+
78
import collection.mutable
89
import TastyBuffer._
910
import core.Symbols.{Symbol, ClassSymbol}
@@ -78,4 +79,3 @@ class TastyPickler(val rootCls: ClassSymbol) {
7879

7980
val treePkl: TreePickler = new TreePickler(this)
8081
}
81-

compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class TastyPrinter(bytes: Array[Byte])(implicit ctx: Context) {
4949
}
5050

5151
class TreeSectionUnpickler extends SectionUnpickler[String](TreePickler.sectionName) {
52-
import TastyFormat._
52+
import dotty.tools.tasty.TastyFormat._
5353

5454
private val sb: StringBuilder = new StringBuilder
5555

compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ package dotty.tools.dotc
22
package core
33
package tasty
44

5+
import dotty.tools.tasty.TastyFormat.NameTags._
6+
57
import scala.collection.mutable
6-
import TastyFormat.NameTags._
78
import TastyBuffer.NameRef
89
import Names.{TermName, termName, EmptyTermName}
910
import NameKinds._
1011

1112
object TastyUnpickler {
12-
class UnpickleException(msg: String) extends RuntimeException(msg)
1313

1414
abstract class SectionUnpickler[R](val name: String) {
1515
def unpickle(reader: TastyReader, nameAtRef: NameTable): R

compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ package dotc
33
package core
44
package tasty
55

6+
import dotty.tools.tasty.TastyFormat._
7+
68
import ast.Trees._
79
import ast.{untpd, tpd}
8-
import TastyFormat._
910
import Contexts._, Symbols._, Types._, Names._, Constants._, Decorators._, Annotations._, Flags._
1011
import typer.Inliner
1112
import NameKinds._

0 commit comments

Comments
 (0)