diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-07-06 16:46:17 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-07-06 16:46:17 +0200 |
| commit | 7661c08496b0dc9ce55657246f8e5e42051c812e (patch) | |
| tree | 125d9f3fe0dbd0eb90d93a6de31e08452cb13ae8 /src/comp/syntax | |
| parent | 4c315666dd7c2ac2d207b00ad2b5b5ca309a627f (diff) | |
Remove temporary stdlib placeholders, use actual stdlib functions
(Possible now that a snapshot took place.)
Diffstat (limited to 'src/comp/syntax')
| -rw-r--r-- | src/comp/syntax/_std.rs | 29 | ||||
| -rw-r--r-- | src/comp/syntax/ext/base.rs | 2 | ||||
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/comp/syntax/parse/token.rs | 2 | ||||
| -rw-r--r-- | src/comp/syntax/print/pprust.rs | 10 |
5 files changed, 7 insertions, 38 deletions
diff --git a/src/comp/syntax/_std.rs b/src/comp/syntax/_std.rs deleted file mode 100644 index fb4d1449a99..00000000000 --- a/src/comp/syntax/_std.rs +++ /dev/null @@ -1,29 +0,0 @@ -// FIXME all this stuff should be in the standard lib, and in fact is, -// but due to the way our snapshots currently work, rustc can't use it -// until after the next snapshot. - -fn new_str_hash[V]() -> std::map::hashmap[str, V] { - let std::map::hashfn[str] hasher = std::str::hash; - let std::map::eqfn[str] eqer = std::str::eq; - ret std::map::mk_hashmap[str, V](hasher, eqer); -} - -fn new_int_hash[V]() -> std::map::hashmap[int, V] { - fn hash_int(&int x) -> uint { ret x as uint; } - fn eq_int(&int a, &int b) -> bool { ret a == b; } - auto hasher = hash_int; - auto eqer = eq_int; - ret std::map::mk_hashmap[int, V](hasher, eqer); -} - -fn new_uint_hash[V]() -> std::map::hashmap[uint, V] { - fn hash_uint(&uint x) -> uint { ret x; } - fn eq_uint(&uint a, &uint b) -> bool { ret a == b; } - auto hasher = hash_uint; - auto eqer = eq_uint; - ret std::map::mk_hashmap[uint, V](hasher, eqer); -} - -fn istr(int i) -> str { ret std::int::to_str(i, 10u); } - -fn uistr(uint i) -> str { ret std::uint::to_str(i, 10u); } diff --git a/src/comp/syntax/ext/base.rs b/src/comp/syntax/ext/base.rs index 719e96f5fe6..a0ba306edfa 100644 --- a/src/comp/syntax/ext/base.rs +++ b/src/comp/syntax/ext/base.rs @@ -3,7 +3,7 @@ import std::option; import std::map::hashmap; import parse::parser::parse_sess; import codemap::span; -import syntax::_std::new_str_hash; +import std::map::new_str_hash; import codemap; type syntax_expander = diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index b671e9eaa69..dc19a507db5 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -12,7 +12,7 @@ import std::map::hashmap; import token::can_begin_expr; import ex=ext::base; import codemap::span; -import _std::new_str_hash; +import std::map::new_str_hash; import util::interner; tag restriction { UNRESTRICTED; RESTRICT_NO_CALL_EXPRS; } diff --git a/src/comp/syntax/parse/token.rs b/src/comp/syntax/parse/token.rs index b8ea07d50db..2ce5d9e6cb4 100644 --- a/src/comp/syntax/parse/token.rs +++ b/src/comp/syntax/parse/token.rs @@ -1,7 +1,7 @@ import ast::ty_mach; import ast::ty_mach_to_str; -import _std::new_str_hash; +import std::map::new_str_hash; import util::interner; import std::int; import std::uint; diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index b5f83c2009c..86ae4cbd295 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -8,8 +8,6 @@ import std::option; import parse::lexer; import syntax::codemap::codemap; import ast; -import _std::istr; -import _std::uistr; import option::some; import option::none; import pp::printer; @@ -1294,11 +1292,11 @@ fn print_literal(&ps s, &@ast::lit lit) { word(s.s, "'" + escape_str(str::from_bytes([ch as u8]), '\'') + "'"); } - case (ast::lit_int(?val)) { word(s.s, istr(val)); } - case (ast::lit_uint(?val)) { word(s.s, uistr(val) + "u"); } + case (ast::lit_int(?val)) { word(s.s, int::str(val)); } + case (ast::lit_uint(?val)) { word(s.s, uint::str(val) + "u"); } case (ast::lit_float(?fstr)) { word(s.s, fstr); } case (ast::lit_mach_int(?mach, ?val)) { - word(s.s, istr(val as int)); + word(s.s, int::str(val as int)); word(s.s, ast::ty_mach_to_str(mach)); } case (ast::lit_mach_float(?mach, ?val)) { @@ -1446,7 +1444,7 @@ fn constr_arg_to_str[T](fn(&T) -> str f, &ast::constr_arg_general_[T] c) -> // needed b/c constr_args_to_str needs // something that takes an alias // (argh) -fn uint_to_str(&uint i) -> str { ret uistr(i); } +fn uint_to_str(&uint i) -> str { ret uint::str(i); } fn ast_constr_to_str(&@ast::constr c) -> str { ret ast::path_to_str(c.node.path) + |
