aboutsummaryrefslogtreecommitdiff
path: root/src/comp/pretty
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-04-06 10:25:32 -0700
committerPatrick Walton <[email protected]>2011-04-06 10:25:32 -0700
commitd9da43984b5e9d50f711320d2afc3307537dfb44 (patch)
tree6b9b3eefc8909c7621c01b7e039375deb019e7b1 /src/comp/pretty
parentrustc: Make type_of() return the type of the wrapper for native functions. li... (diff)
parentMinimal testcase for next bootstrap blocker. (diff)
downloadrust-d9da43984b5e9d50f711320d2afc3307537dfb44.tar.xz
rust-d9da43984b5e9d50f711320d2afc3307537dfb44.zip
Merge branch 'master' of github.com:graydon/rust
Diffstat (limited to 'src/comp/pretty')
-rw-r--r--src/comp/pretty/pprust.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/comp/pretty/pprust.rs b/src/comp/pretty/pprust.rs
index b0d6fb94..7e0fb6cb 100644
--- a/src/comp/pretty/pprust.rs
+++ b/src/comp/pretty/pprust.rs
@@ -379,6 +379,11 @@ impure fn print_literal(ps s, @ast.lit lit) {
wrd(s.s, common.istr(val as int));
wrd(s.s, common.ty_mach_to_str(mach));
}
+ case (ast.lit_mach_float(?mach,?val)) {
+ // val is already a str
+ wrd(s.s, val);
+ wrd(s.s, common.ty_mach_to_str(mach));
+ }
case (ast.lit_nil) {wrd(s.s, "()");}
case (ast.lit_bool(?val)) {
if (val) {wrd(s.s, "true");} else {wrd(s.s, "false");}
@@ -449,9 +454,9 @@ impure fn print_expr(ps s, &@ast.expr expr) {
commasep_exprs(s, args);
pclose(s);
}
- case (ast.expr_call_self(?func,?args,_)) {
+ case (ast.expr_call_self(?ident,?args,_)) {
wrd(s.s, "self.");
- print_expr(s, func);
+ print_ident(s, ident);
popen(s);
commasep_exprs(s, args);
pclose(s);
@@ -718,6 +723,10 @@ impure fn print_decl(ps s, @ast.decl decl) {
end(s.s);
}
+impure fn print_ident(ps s, ast.ident ident) {
+ wrd(s.s, ident);
+}
+
impure fn print_for_decl(ps s, @ast.decl decl) {
alt (decl.node) {
case (ast.decl_local(?loc)) {