about summary refs log tree commit diff
path: root/src/comp/syntax/parse
diff options
context:
space:
mode:
authorKevin Cantu <me@kevincantu.org>2012-02-11 23:49:03 -0800
committerKevin Cantu <me@kevincantu.org>2012-02-12 15:30:20 -0800
commit944f5a65983e929f63c9867c3e635997f89cbe85 (patch)
tree124225ae4cddcca1d250c991bc9b95ad3a913431 /src/comp/syntax/parse
parent5fb0906f43f1b684aec610581da0d7c93948de37 (diff)
(core::str) move push_byte, push_bytes, pop_byte, and shift_byte into str::unsafe
Diffstat (limited to 'src/comp/syntax/parse')
-rw-r--r--src/comp/syntax/parse/lexer.rs16
-rw-r--r--src/comp/syntax/parse/token.rs2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/comp/syntax/parse/lexer.rs b/src/comp/syntax/parse/lexer.rs
index 42cc5400b0c..5a8d72ce01f 100644
--- a/src/comp/syntax/parse/lexer.rs
+++ b/src/comp/syntax/parse/lexer.rs
@@ -149,11 +149,11 @@ fn scan_exponent(rdr: reader) -> option<str> {
     let c = rdr.curr;
     let rslt = "";
     if c == 'e' || c == 'E' {
-        str::push_byte(rslt, c as u8);
+        str::push_char(rslt, c);
         rdr.bump();
         c = rdr.curr;
         if c == '-' || c == '+' {
-            str::push_byte(rslt, c as u8);
+            str::push_char(rslt, c);
             rdr.bump();
         }
         let exponent = scan_digits(rdr, 10u);
@@ -170,7 +170,7 @@ fn scan_digits(rdr: reader, radix: uint) -> str {
         if c == '_' { rdr.bump(); cont; }
         alt char::maybe_digit(c) {
           some(d) if (d as uint) < radix {
-            str::push_byte(rslt, c as u8);
+            str::push_char(rslt, c);
             rdr.bump();
           }
           _ { break; }
@@ -472,11 +472,11 @@ fn next_token_inner(rdr: reader) -> token::token {
                 let escaped = rdr.curr;
                 rdr.bump();
                 alt escaped {
-                  'n' { str::push_byte(accum_str, '\n' as u8); }
-                  'r' { str::push_byte(accum_str, '\r' as u8); }
-                  't' { str::push_byte(accum_str, '\t' as u8); }
-                  '\\' { str::push_byte(accum_str, '\\' as u8); }
-                  '"' { str::push_byte(accum_str, '"' as u8); }
+                  'n' { str::push_char(accum_str, '\n'); }
+                  'r' { str::push_char(accum_str, '\r'); }
+                  't' { str::push_char(accum_str, '\t'); }
+                  '\\' { str::push_char(accum_str, '\\'); }
+                  '"' { str::push_char(accum_str, '"'); }
                   '\n' { consume_whitespace(rdr); }
                   'x' {
                     str::push_char(accum_str, scan_numeric_escape(rdr, 2u));
diff --git a/src/comp/syntax/parse/token.rs b/src/comp/syntax/parse/token.rs
index 14f7c055743..60949f7793c 100644
--- a/src/comp/syntax/parse/token.rs
+++ b/src/comp/syntax/parse/token.rs
@@ -139,7 +139,7 @@ fn to_str(r: reader, t: token) -> str {
         // FIXME: escape.
         let tmp = "'";
         str::push_char(tmp, c as char);
-        str::push_byte(tmp, '\'' as u8);
+        str::push_char(tmp, '\'');
         ret tmp;
       }
       LIT_INT(i, t) {