@@ -65,31 +65,13 @@ pub mod ct {
65
65
FlagSignAlways ,
66
66
FlagAlternate ,
67
67
}
68
- #[ cfg( stage0) ]
69
- pub enum Count {
70
- CountIs ( int ) ,
71
- CountIsParam ( int ) ,
72
- CountIsNextParam ,
73
- CountImplied ,
74
- }
75
- #[ cfg( stage1) ]
76
- #[ cfg( stage2) ]
77
68
pub enum Count {
78
69
CountIs ( uint ) ,
79
70
CountIsParam ( uint ) ,
80
71
CountIsNextParam ,
81
72
CountImplied ,
82
73
}
83
74
84
- #[ cfg( stage0) ]
85
- pub type Conv =
86
- { param : Option < int > ,
87
- flags : ~[ Flag ] ,
88
- width : Count ,
89
- precision : Count ,
90
- ty: Ty } ;
91
- #[ cfg( stage1) ]
92
- #[ cfg( stage2) ]
93
75
// A formatted conversion from an expression to a string
94
76
pub type Conv =
95
77
{ param : Option < uint > ,
@@ -176,24 +158,6 @@ pub mod ct {
176
158
ty: ty.ty}),
177
159
next: ty.next};
178
160
}
179
- #[cfg(stage0)]
180
- pub fn parse_parameter(s: &str, i: uint, lim: uint) ->
181
- {param: Option<int>, next: uint} {
182
- if i >= lim { return {param: None, next: i}; }
183
- let num = peek_num(s, i, lim);
184
- return match num {
185
- None => {param: None, next: i},
186
- Some(t) => {
187
- let n = t.num as int;
188
- let j = t.next;
189
- if j < lim && s[j] == '$' as u8 {
190
- {param: Some(n), next: j + 1}
191
- } else { {param: None, next: i} }
192
- }
193
- };
194
- }
195
- #[cfg(stage1)]
196
- #[cfg(stage2)]
197
161
pub fn parse_parameter(s: &str, i: uint, lim: uint) ->
198
162
{param: Option<uint>, next: uint} {
199
163
if i >= lim { return {param: None, next: i}; }
@@ -237,31 +201,6 @@ pub mod ct {
237
201
more(FlagAlternate, s, i, lim)
238
202
} else { {flags: move noflags, next: i} };
239
203
}
240
- #[cfg(stage0)]
241
- pub fn parse_count(s: &str, i: uint, lim: uint)
242
- -> {count: Count, next: uint} {
243
- return if i >= lim {
244
- {count: CountImplied, next: i}
245
- } else if s[i] == '*' as u8 {
246
- let param = parse_parameter(s, i + 1, lim);
247
- let j = param.next;
248
- match param.param {
249
- None => {count: CountIsNextParam, next: j},
250
- Some(n) => {count: CountIsParam(n), next: j}
251
- }
252
- } else {
253
- let num = peek_num(s, i, lim);
254
- match num {
255
- None => {count: CountImplied, next: i},
256
- Some(num) => {
257
- count: CountIs(num.num as int),
258
- next: num.next
259
- }
260
- }
261
- };
262
- }
263
- #[cfg(stage1)]
264
- #[cfg(stage2)]
265
204
pub fn parse_count(s: &str, i: uint, lim: uint)
266
205
-> {count: Count, next: uint} {
267
206
return if i >= lim {
@@ -346,10 +285,6 @@ pub mod rt {
346
285
pub const flag_sign_always : u32 = 0b00000000001000u32;
347
286
pub const flag_alternate : u32 = 0b00000000010000u32;
348
287
349
- #[cfg(stage0)]
350
- pub enum Count { CountIs(int), CountImplied, }
351
- #[cfg(stage1)]
352
- #[cfg(stage2)]
353
288
pub enum Count { CountIs(uint), CountImplied, }
354
289
355
290
pub enum Ty { TyDefault, TyBits, TyHexUpper, TyHexLower, TyOctal, }
0 commit comments