Skip to content

Commit 1b65a61

Browse files
committed
Couple minor bug fixes in creader, lib-bitv, int, rand, sort, sha1, uint and vec all work.
1 parent 6d857c0 commit 1b65a61

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/comp/front/creader.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ impure fn parse_ty_str(str rep, str_def sd) -> @ty.t {
6565
auto len = _str.byte_len(rep);
6666
auto st = @rec(rep=rep, mutable pos=0u, len=len);
6767
auto result = parse_ty(st, sd);
68+
if (st.pos != len) {
69+
log "parse_ty_str: incomplete parse, stopped at byte "
70+
+ _uint.to_str(st.pos, 10u) + " of "
71+
+ _uint.to_str(len, 10u) + " in str '" + rep + "'";
72+
}
6873
check(st.pos == len);
6974
ret result;
7075
}
@@ -191,6 +196,7 @@ impure fn parse_sty(@pstate st, str_def sd) -> ty.sty {
191196
inputs=func._0,
192197
output=func._1));
193198
}
199+
st.pos += 1u;
194200
ret ty.ty_obj(methods);
195201
}
196202
case ('X') {ret ty.ty_var(parse_int(st));}
@@ -544,6 +550,7 @@ fn kind_has_type_params(u8 kind_ch) -> bool {
544550
// FIXME: It'd be great if we had u8 char literals.
545551
if (kind_ch == ('c' as u8)) { ret false; }
546552
else if (kind_ch == ('f' as u8)) { ret true; }
553+
else if (kind_ch == ('F' as u8)) { ret true; }
547554
else if (kind_ch == ('y' as u8)) { ret true; }
548555
else if (kind_ch == ('o' as u8)) { ret true; }
549556
else if (kind_ch == ('t' as u8)) { ret true; }
@@ -581,6 +588,7 @@ fn lookup_def(session.session sess, int cnum, vec[ast.ident] path)
581588
auto def;
582589
if (kind_ch == ('c' as u8)) { def = ast.def_const(did); }
583590
else if (kind_ch == ('f' as u8)) { def = ast.def_fn(did); }
591+
else if (kind_ch == ('F' as u8)) { def = ast.def_native_fn(did); }
584592
else if (kind_ch == ('y' as u8)) { def = ast.def_ty(did); }
585593
else if (kind_ch == ('o' as u8)) { def = ast.def_obj(did); }
586594
else if (kind_ch == ('t' as u8)) {

0 commit comments

Comments
 (0)