Skip to content

Commit 738613a

Browse files
authored
Merge pull request #7616 from dotty-staging/independent-tasty-lib
Independent tasty-core library
2 parents 65a404f + 14e3150 commit 738613a

40 files changed

+148
-76
lines changed

build.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ 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`
19+
val `tasty-core-scala2` = Build.`tasty-core-scala2`
1720
val `scala-library` = Build.`scala-library`
1821
val `scala-compiler` = Build.`scala-compiler`
1922
val `scala-reflect` = Build.`scala-reflect`

compiler/src/dotty/tools/backend/jvm/GenBCode.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ import Decorators._
2020

2121
import java.io.DataOutputStream
2222

23+
import dotty.tools.tasty.{ TastyBuffer, TastyHeaderUnpickler }
2324

2425
import scala.tools.asm
2526
import scala.tools.asm.Handle
2627
import scala.tools.asm.tree._
2728
import tpd._
2829
import StdNames._
29-
import dotty.tools.dotc.core.tasty.{TastyBuffer, TastyHeaderUnpickler}
3030
import dotty.tools.io._
3131

3232
class GenBCode extends Phase {

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/classfile/ClassfileParser.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 classfile
55

6+
import dotty.tools.tasty.{ TastyReader, TastyHeaderUnpickler }
7+
68
import Contexts._, Symbols._, Types._, Names._, StdNames._, NameOps._, Scopes._, Decorators._
79
import SymDenotations._, unpickleScala2.Scala2Unpickler._, Constants._, Annotations._, util.Spans._
810
import NameKinds.DefaultGetterName
9-
import dotty.tools.dotc.core.tasty.{TastyHeaderUnpickler, TastyReader}
1011
import ast.tpd._
1112
import java.io.{ ByteArrayInputStream, ByteArrayOutputStream, DataInputStream, IOException }
1213

@@ -1183,4 +1184,3 @@ class ClassfileParser(
11831184
throw new RuntimeException("bad constant pool tag " + in.buf(start) + " at byte " + start)
11841185
}
11851186
}
1186-

compiler/src/dotty/tools/dotc/core/quoted/PickledQuotes.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ import dotty.tools.dotc.core.Mode
1212
import dotty.tools.dotc.core.Symbols._
1313
import dotty.tools.dotc.core.Types._
1414
import dotty.tools.dotc.core.tasty.TreePickler.Hole
15-
import dotty.tools.dotc.core.tasty.{PositionPickler, TastyPickler, TastyPrinter, TastyString}
15+
import dotty.tools.dotc.core.tasty.{ PositionPickler, TastyPickler, TastyPrinter }
1616
import dotty.tools.dotc.core.tasty.TreeUnpickler.UnpickleMode
1717
import dotty.tools.dotc.quoted.QuoteContext
1818
import dotty.tools.dotc.tastyreflect.ReflectionImpl
1919

20+
import dotty.tools.tasty.TastyString
21+
2022
import scala.internal.quoted._
2123
import scala.reflect.ClassTag
2224

compiler/src/dotty/tools/dotc/core/quoted/QuoteUnpickler.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import dotty.tools.dotc.core.tasty._
44
import dotty.tools.dotc.core.tasty.TastyUnpickler.NameTable
55
import dotty.tools.dotc.core.tasty.TreeUnpickler.UnpickleMode
66

7+
import dotty.tools.tasty.TastyReader
8+
79
object QuoteUnpickler {
810
class QuotedTreeSectionUnpickler(posUnpickler: Option[PositionUnpickler], splices: Seq[Any])
911
extends DottyUnpickler.TreeSectionUnpickler(posUnpickler, None) {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ package dotty.tools.dotc.core.tasty
33
import dotty.tools.dotc.ast.tpd
44
import dotty.tools.dotc.core.Comments.{Comment, CommentsContext, ContextDocstrings}
55
import dotty.tools.dotc.core.Contexts.Context
6-
import dotty.tools.dotc.core.tasty.TastyBuffer.{Addr, NoAddr}
6+
7+
import dotty.tools.tasty.TastyBuffer
8+
import TastyBuffer.{Addr, NoAddr}
79

810
import java.nio.charset.Charset
911

@@ -40,4 +42,3 @@ class CommentPickler(pickler: TastyPickler, addrOfTree: tpd.Tree => Addr)(implic
4042
}
4143
}
4244
}
43-

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package dotty.tools.dotc.core.tasty
22

33
import dotty.tools.dotc.core.Comments.Comment
4-
import dotty.tools.dotc.core.tasty.TastyBuffer.Addr
54
import dotty.tools.dotc.util.Spans.Span
65

6+
import dotty.tools.tasty.{TastyReader, TastyBuffer}
7+
import TastyBuffer.Addr
8+
79
import scala.collection.mutable.HashMap
810

911
import java.nio.charset.Charset
@@ -29,4 +31,3 @@ class CommentUnpickler(reader: TastyReader) {
2931
def commentAt(addr: Addr): Option[Comment] =
3032
comments.get(addr)
3133
}
32-

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import classfile.ClassfileParser
1010
import Names.SimpleName
1111
import TreeUnpickler.UnpickleMode
1212

13+
import dotty.tools.tasty.TastyReader
14+
1315
object DottyUnpickler {
1416

1517
/** Exception thrown if classfile is corrupted */

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

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

6+
import dotty.tools.tasty.TastyBuffer
7+
import TastyBuffer._
8+
69
import collection.mutable
710
import Names.{Name, chrs, SimpleName, DerivedName, TypeName}
811
import NameKinds._
912
import Decorators._
10-
import TastyBuffer._
1113
import scala.io.Codec
1214

1315
class NameBuffer extends TastyBuffer(10000) {

0 commit comments

Comments
 (0)