Skip to content

Commit 03827ba

Browse files
committed
---
yaml --- r: 4719 b: refs/heads/master c: bab29af h: refs/heads/master i: 4717: c7c1081 4715: d563bcd 4711: 5faf180 4703: 0c01df6 v: v3
1 parent 4c8fa30 commit 03827ba

File tree

3 files changed

+22
-30
lines changed

3 files changed

+22
-30
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 46658c4a9c6a6f67ae6a20f3c9f6040c212af68c
2+
refs/heads/master: bab29af449a200572d04593f6410dc94c1d20263

trunk/src/comp/syntax/ext/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn pieces_to_expr(cx: &ext_ctxt, sp: span, pieces: &[piece],
182182
}
183183
fn make_conv_call(cx: &ext_ctxt, sp: span, conv_type: str, cnv: &conv,
184184
arg: @ast::expr) -> @ast::expr {
185-
let fname = "conv_" + conv_type + "_ivec";
185+
let fname = "conv_" + conv_type;
186186
let path = make_path_vec(cx, fname);
187187
let cnv_expr = make_rt_conv_expr(cx, sp, cnv);
188188
let args = ~[cnv_expr, arg];

trunk/src/lib/extfmt.rs

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -268,34 +268,26 @@ mod rt {
268268

269269
// FIXME: May not want to use a vector here for flags;
270270
// instead just use a bool per flag
271-
type conv = {flags: vec[flag], width: count, precision: count, ty: ty};
271+
type conv = {flags: [flag], width: count, precision: count, ty: ty};
272272

273-
type conv_ivec = {flags: [flag], width: count, precision: count, ty: ty};
274-
275-
fn to_conv_ivec(cv: &conv) -> conv_ivec {
276-
{flags: ivec::from_vec(cv.flags),
277-
width: cv.width,
278-
precision: cv.precision,
279-
ty: cv.ty}
273+
// FIXME: Remove these transitional *_ivec interfaces
274+
fn conv_int_ivec(cv: &conv, i: int) -> str {
275+
conv_int(cv, i)
280276
}
281-
282-
fn conv_int(cv: &conv, i: int) -> str {
283-
conv_int_ivec(to_conv_ivec(cv), i)
277+
fn conv_uint_ivec(cv: &conv, u: uint) -> str {
278+
conv_uint(cv, u)
284279
}
285-
fn conv_uint(cv: &conv, u: uint) -> str {
286-
conv_uint_ivec(to_conv_ivec(cv), u)
280+
fn conv_bool_ivec(cv: &conv, b: bool) -> str {
281+
conv_bool(cv, b)
287282
}
288-
fn conv_bool(cv: &conv, b: bool) -> str {
289-
conv_bool_ivec(to_conv_ivec(cv), b)
283+
fn conv_char_ivec(cv: &conv, c: char) -> str {
284+
conv_char(cv, c)
290285
}
291-
fn conv_char(cv: &conv, c: char) -> str {
292-
conv_char_ivec(to_conv_ivec(cv), c)
293-
}
294-
fn conv_str(cv: &conv, s: str) -> str {
295-
conv_str_ivec(to_conv_ivec(cv), s)
286+
fn conv_str_ivec(cv: &conv, s: str) -> str {
287+
conv_str(cv, s)
296288
}
297289

298-
fn conv_int_ivec(cv: &conv_ivec, i: int) -> str {
290+
fn conv_int(cv: &conv, i: int) -> str {
299291
let radix = 10u;
300292
let prec = get_int_precision(cv);
301293
let s = int_to_str_prec(i, radix, prec);
@@ -308,7 +300,7 @@ mod rt {
308300
}
309301
ret pad(cv, s, pad_signed);
310302
}
311-
fn conv_uint_ivec(cv: &conv_ivec, u: uint) -> str {
303+
fn conv_uint(cv: &conv, u: uint) -> str {
312304
let prec = get_int_precision(cv);
313305
let rs =
314306
alt cv.ty {
@@ -320,17 +312,17 @@ mod rt {
320312
};
321313
ret pad(cv, rs, pad_unsigned);
322314
}
323-
fn conv_bool_ivec(cv: &conv_ivec, b: bool) -> str {
315+
fn conv_bool(cv: &conv, b: bool) -> str {
324316
let s = if b { "true" } else { "false" };
325317
// run the boolean conversion through the string conversion logic,
326318
// giving it the same rules for precision, etc.
327319

328320
ret conv_str_ivec(cv, s);
329321
}
330-
fn conv_char_ivec(cv: &conv_ivec, c: char) -> str {
322+
fn conv_char(cv: &conv, c: char) -> str {
331323
ret pad(cv, str::from_char(c), pad_nozero);
332324
}
333-
fn conv_str_ivec(cv: &conv_ivec, s: str) -> str {
325+
fn conv_str(cv: &conv, s: str) -> str {
334326
// For strings, precision is the maximum characters
335327
// displayed
336328

@@ -371,7 +363,7 @@ mod rt {
371363
} else { s }
372364
};
373365
}
374-
fn get_int_precision(cv: &conv_ivec) -> uint {
366+
fn get_int_precision(cv: &conv) -> uint {
375367
ret alt cv.precision {
376368
count_is(c) { c as uint }
377369
count_implied. { 1u }
@@ -385,7 +377,7 @@ mod rt {
385377
ret str::unsafe_from_bytes(svec);
386378
}
387379
tag pad_mode { pad_signed; pad_unsigned; pad_nozero; }
388-
fn pad(cv: &conv_ivec, s: str, mode: pad_mode) -> str {
380+
fn pad(cv: &conv, s: str, mode: pad_mode) -> str {
389381
let uwidth;
390382
alt cv.width {
391383
count_implied. { ret s; }
@@ -413,7 +405,7 @@ mod rt {
413405
pad_signed. { might_zero_pad = true; signed = true; }
414406
pad_unsigned. { might_zero_pad = true; }
415407
}
416-
fn have_precision(cv: &conv_ivec) -> bool {
408+
fn have_precision(cv: &conv) -> bool {
417409
ret alt cv.precision { count_implied. { false } _ { true } };
418410
}
419411
let zero_padding = false;

0 commit comments

Comments
 (0)