diff options
Diffstat (limited to 'src/comp/syntax')
| -rw-r--r-- | src/comp/syntax/parse/token.rs | 3 | ||||
| -rw-r--r-- | src/comp/syntax/print/pprust.rs | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/comp/syntax/parse/token.rs b/src/comp/syntax/parse/token.rs index 7e93444e09b..994c4e03b34 100644 --- a/src/comp/syntax/parse/token.rs +++ b/src/comp/syntax/parse/token.rs @@ -6,6 +6,7 @@ import util::interner; import std::int; import std::uint; import std::str; +import std::istr; type str_num = uint; @@ -146,7 +147,7 @@ fn to_str(r: lexer::reader, t: token) -> str { LIT_INT(i) { ret int::to_str(i, 10u); } - LIT_UINT(u) { ret uint::to_str(u, 10u); } + LIT_UINT(u) { ret istr::to_estr(uint::to_str(u, 10u)); } LIT_MACH_INT(tm, i) { ret int::to_str(i, 10u) + "_" + ty_mach_to_str(tm); } diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index 52ee1eaeacc..81220647288 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -3,6 +3,7 @@ import std::vec; import std::int; import std::io; import std::str; +import std::istr; import std::uint; import std::option; import parse::lexer; @@ -1498,7 +1499,7 @@ fn print_literal(s: &ps, lit: &@ast::lit) { "'"); } ast::lit_int(val) { word(s.s, int::str(val)); } - ast::lit_uint(val) { word(s.s, uint::str(val) + "u"); } + ast::lit_uint(val) { word(s.s, istr::to_estr(uint::str(val)) + "u"); } ast::lit_float(fstr) { word(s.s, fstr); } ast::lit_mach_int(mach, val) { word(s.s, int::str(val as int)); @@ -1660,7 +1661,7 @@ fn constr_arg_to_str<T>(f: &fn(&T) -> str, c: &ast::constr_arg_general_<T>) -> // needed b/c constr_args_to_str needs // something that takes an alias // (argh) -fn uint_to_str(i: &uint) -> str { ret uint::str(i); } +fn uint_to_str(i: &uint) -> str { ret istr::to_estr(uint::str(i)); } fn ast_ty_fn_constr_to_str(c: &@ast::constr) -> str { ret path_to_str(c.node.path) + |
