Skip to content

Commit 583c4e6

Browse files
committed
Tweak formatting, separate types with whitespace
1 parent 31ea16e commit 583c4e6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

serialization/python_pickle.ksy

+12
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,15 @@ types:
108108
encoding: ASCII
109109
terminator: 0x0a # "\n"
110110
doc: Integer, encoded with the ASCII characters [0-9-].
111+
111112
decimalnl_long:
112113
seq:
113114
- id: val
114115
type: str
115116
encoding: ASCII
116117
terminator: 0x0a # "\n"
117118
doc: Integer, encoded with the ASCII chracters [0-9-], followed by 'L'.
119+
118120
# TODO Can kaitai express constraint that these are quoted?
119121
stringnl:
120122
seq:
@@ -123,27 +125,31 @@ types:
123125
encoding: ASCII
124126
terminator: 0x0a # "\n"
125127
doc: Quoted string, possibly containing Python string escapes.
128+
126129
stringnl_noescape:
127130
seq:
128131
- id: val
129132
type: str
130133
encoding: ASCII
131134
terminator: 0x0a # "\n"
132135
doc: Unquoted string, does not contain string escapes.
136+
133137
stringnl_noescape_pair:
134138
seq:
135139
- id: val1
136140
type: stringnl_noescape
137141
- id: val2
138142
type: stringnl_noescape
139143
doc: Pair of unquoted, unescaped strings.
144+
140145
unicodestringnl:
141146
seq:
142147
- id: val
143148
type: str
144149
encoding: ASCII
145150
terminator: 0x0a # "\n"
146151
doc: Unquoted string, containing Python Unicode escapes.
152+
147153
floatnl:
148154
seq:
149155
- id: val
@@ -153,6 +159,7 @@ types:
153159
doc: |
154160
Double float, encoded with the ASCII characters [0-9.e+-], '-inf', 'inf',
155161
or 'nan'.
162+
156163
long1:
157164
seq:
158165
- id: len
@@ -162,6 +169,7 @@ types:
162169
doc: |
163170
Large signed integer, in the range -2**(8*255-1) to 2**(8*255-1)-1,
164171
encoded as two's complement.
172+
165173
long4:
166174
seq:
167175
- id: len
@@ -171,6 +179,7 @@ types:
171179
doc: |
172180
Large signed integer, in the range -2**(8*2**32-1) to 2**(8*2**32-1)-1,
173181
encoded as two's complement.
182+
174183
string1:
175184
seq:
176185
- id: len
@@ -192,6 +201,7 @@ types:
192201
- `pickle.Unpickler` objects default to ASCII, which can be overriden
193202
- `pickletools.dis` uses latin1, and cannot be overriden
194203
doc-ref: https://github.com/python/cpython/blob/bb8071a4/Lib/pickle.py#L486-L495
204+
195205
string4:
196206
seq:
197207
- id: len
@@ -208,13 +218,15 @@ types:
208218
209219
See the documentation for `string1` for further detail about encodings.
210220
doc-ref: https://github.com/python/cpython/blob/bb8071a4/Lib/pickle.py#L486-L495
221+
211222
bytes1:
212223
seq:
213224
- id: len
214225
type: u1
215226
- id: val
216227
size: len
217228
doc: Length prefixed byte string, between 0 and 255 bytes long.
229+
218230
bytes4:
219231
seq:
220232
- id: len

0 commit comments

Comments
 (0)