From d39da6f97819becd9ea41c194b5f0daa178814fe Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sun, 6 Mar 2011 13:56:38 -0500 Subject: Remove typestate workarounds --- src/comp/front/extfmt.rs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/comp/front/extfmt.rs') diff --git a/src/comp/front/extfmt.rs b/src/comp/front/extfmt.rs index 7201a17c..255614d0 100644 --- a/src/comp/front/extfmt.rs +++ b/src/comp/front/extfmt.rs @@ -244,9 +244,7 @@ fn parse_count(str s, uint i, uint lim) -> tup(count, uint) { ret tup(count_implied, i); } - // FIXME: These inner functions are just to avoid a rustboot - // "Unsatisfied precondition constraint" bug with alts nested in ifs - fn parse_star_count(str s, uint i, uint lim) -> tup(count, uint) { + if (s.(i) == ('*' as u8)) { auto param = parse_parameter(s, i + 1u, lim); auto j = param._1; alt (param._0) { @@ -257,9 +255,7 @@ fn parse_count(str s, uint i, uint lim) -> tup(count, uint) { ret tup(count_is_param(n), j); } } - } - - fn parse_count_(str s, uint i, uint lim) -> tup(count, uint) { + } else { auto num = peek_num(s, i, lim); alt (num) { case (none[tup(uint, uint)]) { @@ -270,12 +266,6 @@ fn parse_count(str s, uint i, uint lim) -> tup(count, uint) { } } } - - if (s.(i) == ('*' as u8)) { - ret parse_star_count(s, i, lim); - } else { - ret parse_count_(s, i, lim); - } } fn parse_precision(str s, uint i, uint lim) -> tup(count, uint) { @@ -318,9 +308,6 @@ fn parse_type(str s, uint i, uint lim) -> tup(ty, uint) { } else if (_str.eq(tstr, "t")) { t = ty_bits; } else { - // FIXME: This is a hack to avoid 'unsatisfied precondition - // constraint' on uninitialized variable t below - t = ty_bool; log "unknown type in conversion"; fail; } -- cgit v1.2.3