File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
compiler/src/dotty/tools/dotc/core/tasty
tasty/src/dotty/tools/tasty Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import dotty.tools.tasty.TastyBuffer
6
6
import dotty .tools .tasty .TastyFormat .AttributesSection
7
7
8
8
import java .nio .charset .StandardCharsets
9
+ import dotty .tools .tasty .TastyFormat
9
10
10
11
object AttributePickler :
11
12
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ class AttributeUnpickler(reader: TastyReader):
13
13
private [tasty] lazy val attributes : List [String ] = {
14
14
val attributesBuilder = List .newBuilder[String ]
15
15
while (! isAtEnd) {
16
+ val kind = readNat()
17
+ assert(kind == TastyFormat .FLAGattr , " Malformed attribute kind" )
16
18
val length = readNat()
17
19
val bytes = readBytes(length)
18
20
val attribute = new String (bytes, StandardCharsets .UTF_8 )
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ Standard Section: "Comments" Comment*
270
270
271
271
Standard Section: "Attributes" Attribute*
272
272
```none
273
- Attribute = UTF8 // attributes match the regex [a-zA-Z0-9]+
273
+ Attribute = FLAGattr UTF8 // attributes match the regex [a-zA-Z0-9]+
274
274
```
275
275
276
276
**************************************************************************************/
@@ -606,6 +606,11 @@ object TastyFormat {
606
606
final val firstNatASTTreeTag = IDENT
607
607
final val firstLengthTreeTag = PACKAGE
608
608
609
+
610
+ // Attribute tags
611
+
612
+ final val FLAGattr = 1
613
+
609
614
/** Useful for debugging */
610
615
def isLegalTag (tag : Int ): Boolean =
611
616
firstSimpleTreeTag <= tag && tag <= SPLITCLAUSE ||
You can’t perform that action at this time.
0 commit comments