Convert std::uint to istrs. Issue #855
This commit is contained in:
parent
69e6abf9ce
commit
ee2a11eb4f
19 changed files with 99 additions and 73 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue