aboutsummaryrefslogtreecommitdiff
path: root/src/comp/fe/token.rs
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-08-31 11:36:36 -0700
committerGraydon Hoare <[email protected]>2010-08-31 12:42:24 -0700
commit2f3201a64c43762052bc13022ddb5695c11ea516 (patch)
tree46c5a58517b2d09c3fa5bf5abb140e5b6a5f95ad /src/comp/fe/token.rs
parentTurn native OCaml code generation on for the Mac (diff)
downloadrust-2f3201a64c43762052bc13022ddb5695c11ea516.tar.xz
rust-2f3201a64c43762052bc13022ddb5695c11ea516.zip
Reinstate commit 9f0eaa65817303b8768c80454734144c176fda43 with sufficient fixes to hopefully not break tinderboxes.
Diffstat (limited to 'src/comp/fe/token.rs')
-rw-r--r--src/comp/fe/token.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/comp/fe/token.rs b/src/comp/fe/token.rs
index 5e8171bc..2ec492fa 100644
--- a/src/comp/fe/token.rs
+++ b/src/comp/fe/token.rs
@@ -275,8 +275,9 @@ fn to_str(token t) -> str {
}
case (LIT_CHAR(c)) {
// FIXME: escape and encode.
- auto tmp = "";
- tmp += (c as u8);
+ auto tmp = "'";
+ tmp += c as u8;
+ tmp += '\'' as u8;
ret tmp;
}
@@ -285,7 +286,7 @@ fn to_str(token t) -> str {
}
/* Name components */
- case (IDENT(s)) { ret s; }
+ case (IDENT(s)) { auto si = "ident:"; si += s; ret si; }
case (IDX(i)) { ret "_" + _int.to_str(i, 10u); }
case (UNDERSCORE()) { ret "_"; }