From 361ee5a68bf23c9fc65aee39618b5d1b0db4941b Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Fri, 1 Apr 2011 17:48:47 -0700 Subject: Oops -- if we're going to use the pretty-printer, we need it to work. --- src/comp/pretty/pprust.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/comp/pretty') diff --git a/src/comp/pretty/pprust.rs b/src/comp/pretty/pprust.rs index b0d6fb94..28f64c89 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");} -- cgit v1.2.3 From b8bb2e118e9815316320f946ef3fc7e6909ed7c9 Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Tue, 5 Apr 2011 14:18:44 -0700 Subject: Further on the path toward self-awareness. Mostly: * Merciless refactoring of trans.rs so that trans_call can work for self-calls as well as other kinds of calls Also: * Various changes to go with having idents, rather than exprs, in expr_call_self AST nodes * Added missing case for SELF token to token.to_str() --- src/comp/pretty/pprust.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/comp/pretty') diff --git a/src/comp/pretty/pprust.rs b/src/comp/pretty/pprust.rs index 28f64c89..7e0fb6cb 100644 --- a/src/comp/pretty/pprust.rs +++ b/src/comp/pretty/pprust.rs @@ -454,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); @@ -723,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)) { -- cgit v1.2.3