@@ -10,15 +10,16 @@ lower case letter*_ are for explanation of semantic content only, they
10
10
can be dropped without changing the grammar.
11
11
12
12
Micro-syntax:
13
-
13
+ ```none
14
14
LongInt = Digit* StopDigit -- big endian 2's complement, value fits in a Long w/o overflow
15
15
Int = LongInt -- big endian 2's complement, fits in an Int w/o overflow
16
16
Nat = LongInt -- non-negative value, fits in an Int without overflow
17
17
Digit = 0 | ... | 127
18
18
StopDigit = 128 | ... | 255 -- value = digit - 128
19
+ ```
19
20
20
21
Macro-format:
21
-
22
+ ```none
22
23
File = Header majorVersion_Nat minorVersion_Nat experimentalVersion_Nat VersionString UUID
23
24
nameTable_Length Name* Section*
24
25
Header = 0x5CA1AB1F
@@ -48,13 +49,14 @@ Macro-format:
48
49
// If positive, this is a NameRef for the fully qualified name of a term parameter.
49
50
50
51
NameRef = Nat // ordinal number of name in name table, starting from 1.
52
+ ```
51
53
52
54
Note: Unqualified names in the name table are strings. The context decides whether a name is
53
55
a type-name or a term-name. The same string can represent both.
54
56
55
57
56
58
Standard-Section: "ASTs" TopLevelStat*
57
-
59
+ ```none
58
60
TopLevelStat = PACKAGE Length Path TopLevelStat* -- package path { topLevelStats }
59
61
Stat
60
62
@@ -220,22 +222,23 @@ Standard-Section: "ASTs" TopLevelStat*
220
222
| CONTRAVARIANT
221
223
222
224
Annotation = ANNOTATION Length tycon_Type fullAnnotation_Term -- An annotation, given (class) type of constructor, and full application tree
225
+ ```
223
226
224
227
Note: The signature of a SELECTin or TERMREFin node is the signature of the selected symbol,
225
228
not the signature of the reference. The latter undergoes an asSeenFrom but the former
226
229
does not.
227
230
228
231
Note: Tree tags are grouped into 5 categories that determine what follows, and thus allow to compute the size of the tagged tree in a generic way.
229
-
232
+ ```none
230
233
Category 1 (tags 1-59) : tag
231
234
Category 2 (tags 60-89) : tag Nat
232
235
Category 3 (tags 90-109) : tag AST
233
236
Category 4 (tags 110-127): tag Nat AST
234
237
Category 5 (tags 128-255): tag Length <payload>
235
-
238
+ ```
236
239
237
240
Standard-Section: "Positions" LinesSizes Assoc*
238
-
241
+ ```none
239
242
LinesSizes = Nat Nat* // Number of lines followed by the size of each line not counting the trailing `\n`
240
243
241
244
Assoc = Header offset_Delta? offset_Delta? point_Delta?
@@ -251,15 +254,17 @@ Standard-Section: "Positions" LinesSizes Assoc*
251
254
SOURCE = 4 // Impossible as header, since addr_Delta = 0 implies that we refer to the
252
255
// same tree as the previous one, but then hasStartDiff = 1 implies that
253
256
// the tree's range starts later than the range of itself.
257
+ ```
254
258
255
259
All elements of a position section are serialized as Ints
256
260
257
261
258
262
Standard Section: "Comments" Comment*
259
-
263
+ ```none
260
264
Comment = Length Bytes LongInt // Raw comment's bytes encoded as UTF-8, followed by the comment's coordinates.
265
+ ```
261
266
262
-
267
+ * @syntax markdown
263
268
**************************************************************************************/
264
269
265
270
object TastyFormat {
0 commit comments