about summary refs log tree commit diff
path: root/src/comp/front
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-06-24 19:04:08 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2011-06-24 21:22:23 +0200
commit9643aedb049a84965ea4ac2be906ff2707d5de10 (patch)
tree3bf8252710630d05a36900226834f050dc7272f7 /src/comp/front
parentd507d5fe91ce2708e4278c8bd100932c89b5e254 (diff)
Remove uses of variable name 'res' from rustc
This in preparation of making 'res' a keyword for defining resources.
Please don't introduce too many new ones in the meantime...
Diffstat (limited to 'src/comp/front')
-rw-r--r--src/comp/front/creader.rs15
-rw-r--r--src/comp/front/lexer.rs14
-rw-r--r--src/comp/front/parser.rs14
3 files changed, 21 insertions, 22 deletions
diff --git a/src/comp/front/creader.rs b/src/comp/front/creader.rs
index fce7abe714e..27623422e5d 100644
--- a/src/comp/front/creader.rs
+++ b/src/comp/front/creader.rs
@@ -71,11 +71,11 @@ fn parse_ident(@pstate st, str_def sd, char last) -> ast::ident {
 
 fn parse_ident_(@pstate st, str_def sd, fn(char) -> bool is_last)
     -> ast::ident {
-    auto res = "";
+    auto rslt = "";
     while (! is_last(peek(st) as char)) {
-        res += str::unsafe_from_byte(next(st));
+        rslt += str::unsafe_from_byte(next(st));
     }
-    ret res;
+    ret rslt;
 }
 
 
@@ -95,17 +95,17 @@ fn parse_ty_or_bang(@pstate st, str_def sd) -> ty_or_bang {
 }
 
 fn parse_constrs(@pstate st, str_def sd) -> vec[@ty::constr_def] {
-    let vec[@ty::constr_def] res = [];
+    let vec[@ty::constr_def] rslt = [];
     alt (peek(st) as char) {
         case (':') {
             do  {
                 auto ignore = next(st);
-                vec::push(res, parse_constr(st, sd));
+                vec::push(rslt, parse_constr(st, sd));
             } while (peek(st) as char == ';')
         }
         case (_) { }
     }
-    ret res;
+    ret rslt;
 }
 
 fn parse_path(@pstate st, str_def sd) -> ast::path {
@@ -370,8 +370,7 @@ fn parse_ty_fn(@pstate st, str_def sd) ->
     }
     st.pos += 1u; // eat the ']'
     auto cs = parse_constrs(st, sd);
-    auto res = parse_ty_or_bang(st, sd);
-    alt (res) {
+    alt (parse_ty_or_bang(st, sd)) {
         case (a_bang) {
             ret tup(inputs, ty::mk_bot(st.tcx), ast::noreturn, cs);
         }
diff --git a/src/comp/front/lexer.rs b/src/comp/front/lexer.rs
index eaf1eca64ba..5b88c46af8f 100644
--- a/src/comp/front/lexer.rs
+++ b/src/comp/front/lexer.rs
@@ -158,31 +158,31 @@ fn digits_to_string(str s) -> int {
 
 fn scan_exponent(&reader rdr) -> option::t[str] {
     auto c = rdr.curr();
-    auto res = "";
+    auto rslt = "";
     if (c == 'e' || c == 'E') {
-        res += str::from_bytes([c as u8]);
+        rslt += str::from_bytes([c as u8]);
         rdr.bump();
         c = rdr.curr();
         if (c == '-' || c == '+') {
-            res += str::from_bytes([c as u8]);
+            rslt += str::from_bytes([c as u8]);
             rdr.bump();
         }
         auto exponent = scan_dec_digits(rdr);
         if (str::byte_len(exponent) > 0u) {
-            ret some(res + exponent);
+            ret some(rslt + exponent);
         } else { rdr.err("scan_exponent: bad fp literal"); fail; }
     } else { ret none[str]; }
 }
 
 fn scan_dec_digits(&reader rdr) -> str {
     auto c = rdr.curr();
-    let str res = "";
+    let str rslt = "";
     while (is_dec_digit(c) || c == '_') {
-        if (c != '_') { res += str::from_bytes([c as u8]); }
+        if (c != '_') { rslt += str::from_bytes([c as u8]); }
         rdr.bump();
         c = rdr.curr();
     }
-    ret res;
+    ret rslt;
 }
 
 fn scan_number(char c, &reader rdr) -> token::token {
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index bcf97a786e6..04dd8da3c8a 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -58,7 +58,7 @@ fn new_parser(session::session sess, eval::env env,
                      mutable uint lo,
                      mutable uint hi,
                      mutable uint last_lo,
-                     mutable restriction res,
+                     mutable restriction restr,
                      lexer::reader rdr,
                      vec[op_spec] precs,
                      mutable ast::node_id next_id_var,
@@ -75,8 +75,8 @@ fn new_parser(session::session sess, eval::env env,
             hi = rdr.get_chpos();
         }
         fn fatal(str m) -> ! { sess.span_fatal(rec(lo=lo, hi=hi), m); }
-        fn restrict(restriction r) { res = r; }
-        fn get_restriction() -> restriction { ret res; }
+        fn restrict(restriction r) { restr = r; }
+        fn get_restriction() -> restriction { ret restr; }
         fn get_session() -> session::session { ret sess; }
         fn get_span() -> common::span { ret rec(lo=lo, hi=hi); }
         fn get_lo_pos() -> uint { ret lo; }
@@ -1653,15 +1653,15 @@ fn parse_fn_decl(&parser p, ast::purity purity) -> ast::fn_decl {
     let util::common::spanned[vec[ast::arg]] inputs =
         parse_seq(token::LPAREN, token::RPAREN, some(token::COMMA), parse_arg,
                   p);
-    let ty_or_bang res;
+    let ty_or_bang rslt;
     auto constrs = parse_constrs(inputs.node, p).node;
     if (p.peek() == token::RARROW) {
         p.bump();
-        res = parse_ty_or_bang(p);
+        rslt = parse_ty_or_bang(p);
     } else {
-        res = a_ty(@spanned(inputs.span.lo, inputs.span.hi, ast::ty_nil));
+        rslt = a_ty(@spanned(inputs.span.lo, inputs.span.hi, ast::ty_nil));
     }
-    alt (res) {
+    alt (rslt) {
         case (a_ty(?t)) {
             ret rec(inputs=inputs.node,
                     output=t,