about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-08-14 16:54:13 -0700
committerBrian Anderson <banderson@mozilla.com>2012-08-15 14:14:20 -0700
commit74c69e1053188d92b86bc8b28cbf1af87d31ea2d (patch)
tree8c07fc440e572eb59787705a9dd11fcd789430e0 /src/libsyntax/parse
parent8be0f665bcda9f5e4077d0be6ebc6aa382e72319 (diff)
downloadrust-74c69e1053188d92b86bc8b28cbf1af87d31ea2d.tar.gz
rust-74c69e1053188d92b86bc8b28cbf1af87d31ea2d.zip
Convert more core types to camel case
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/attr.rs10
-rw-r--r--src/libsyntax/parse/lexer.rs24
-rw-r--r--src/libsyntax/parse/parser.rs16
3 files changed, 25 insertions, 25 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs
index a93d25ced00..cbb6709d9c8 100644
--- a/src/libsyntax/parse/attr.rs
+++ b/src/libsyntax/parse/attr.rs
@@ -1,4 +1,4 @@
-import either::{either, left, right};
+import either::{Either, Left, Right};
 import ast_util::spanned;
 import common::*; //resolve bug?
 
@@ -7,7 +7,7 @@ export parser_attr;
 
 // A type to distingush between the parsing of item attributes or syntax
 // extensions, which both begin with token.POUND
-type attr_or_ext = option<either<~[ast::attribute], @ast::expr>>;
+type attr_or_ext = option<Either<~[ast::attribute], @ast::expr>>;
 
 trait parser_attr {
     fn parse_outer_attrs_or_ext(first_item_attrs: ~[ast::attribute])
@@ -36,18 +36,18 @@ impl parser: parser_attr {
                 self.bump();
                 let first_attr =
                     self.parse_attribute_naked(ast::attr_outer, lo);
-                return some(left(vec::append(~[first_attr],
+                return some(Left(vec::append(~[first_attr],
                                           self.parse_outer_attributes())));
             } else if !(self.look_ahead(1u) == token::LT
                         || self.look_ahead(1u) == token::LBRACKET
                         || self.look_ahead(1u) == token::POUND
                         || expect_item_next) {
                 self.bump();
-                return some(right(self.parse_syntax_ext_naked(lo)));
+                return some(Right(self.parse_syntax_ext_naked(lo)));
             } else { return none; }
         }
         token::DOC_COMMENT(_) => {
-          return some(left(self.parse_outer_attributes()));
+          return some(Left(self.parse_outer_attributes()));
         }
         _ => return none
       }
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index 23f5eac07df..99768d558ab 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -340,40 +340,40 @@ fn scan_number(c: char, rdr: string_reader) -> token::token {
     if c == 'u' || c == 'i' {
         let signed = c == 'i';
         let mut tp = {
-            if signed { either::left(ast::ty_i) }
-            else { either::right(ast::ty_u) }
+            if signed { either::Left(ast::ty_i) }
+            else { either::Right(ast::ty_u) }
         };
         bump(rdr);
         c = rdr.curr;
         if c == '8' {
             bump(rdr);
-            tp = if signed { either::left(ast::ty_i8) }
-                      else { either::right(ast::ty_u8) };
+            tp = if signed { either::Left(ast::ty_i8) }
+                      else { either::Right(ast::ty_u8) };
         }
         n = nextch(rdr);
         if c == '1' && n == '6' {
             bump(rdr);
             bump(rdr);
-            tp = if signed { either::left(ast::ty_i16) }
-                      else { either::right(ast::ty_u16) };
+            tp = if signed { either::Left(ast::ty_i16) }
+                      else { either::Right(ast::ty_u16) };
         } else if c == '3' && n == '2' {
             bump(rdr);
             bump(rdr);
-            tp = if signed { either::left(ast::ty_i32) }
-                      else { either::right(ast::ty_u32) };
+            tp = if signed { either::Left(ast::ty_i32) }
+                      else { either::Right(ast::ty_u32) };
         } else if c == '6' && n == '4' {
             bump(rdr);
             bump(rdr);
-            tp = if signed { either::left(ast::ty_i64) }
-                      else { either::right(ast::ty_u64) };
+            tp = if signed { either::Left(ast::ty_i64) }
+                      else { either::Right(ast::ty_u64) };
         }
         if str::len(num_str) == 0u {
             rdr.fatal(~"no valid digits found for number");
         }
         let parsed = option::get(u64::from_str_radix(num_str, base as u64));
         match tp {
-          either::left(t) => return token::LIT_INT(parsed as i64, t),
-          either::right(t) => return token::LIT_UINT(parsed, t)
+          either::Left(t) => return token::LIT_INT(parsed as i64, t),
+          either::Right(t) => return token::LIT_UINT(parsed, t)
         }
     }
     let mut is_float = false;
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index feb19d6780c..f894f6fae82 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1,7 +1,7 @@
 import print::pprust::expr_to_str;
 
 import result::result;
-import either::{either, left, right};
+import either::{Either, Left, Right};
 import std::map::{hashmap, str_hash};
 import token::{can_begin_expr, is_ident, is_ident_or_path, is_plain_ident,
                INTERPOLATED};
@@ -102,7 +102,7 @@ enum class_contents { ctor_decl(fn_decl, ~[attribute], blk, codemap::span),
                       dtor_decl(blk, ~[attribute], codemap::span),
                       members(~[@class_member]) }
 
-type arg_or_capture_item = either<arg, capture_item>;
+type arg_or_capture_item = Either<arg, capture_item>;
 type item_info = (ident, item_, option<~[attribute]>);
 
 enum item_or_view_item {
@@ -557,9 +557,9 @@ class parser {
         }
 
         if self.eat_keyword(~"move") {
-            either::right(parse_capture_item(self, true))
+            either::Right(parse_capture_item(self, true))
         } else if self.eat_keyword(~"copy") {
-            either::right(parse_capture_item(self, false))
+            either::Right(parse_capture_item(self, false))
         } else {
             parse_arg_fn(self)
         }
@@ -570,7 +570,7 @@ class parser {
         let i = self.parse_value_ident();
         self.expect(token::COLON);
         let t = self.parse_ty(false);
-        either::left({mode: m, ty: t, ident: i, id: self.get_id()})
+        either::Left({mode: m, ty: t, ident: i, id: self.get_id()})
     }
 
     fn parse_arg_or_capture_item() -> arg_or_capture_item {
@@ -588,7 +588,7 @@ class parser {
                   node: ty_infer,
                   span: mk_sp(p.span.lo, p.span.hi)}
             };
-            either::left({mode: m, ty: t, ident: i, id: p.get_id()})
+            either::Left({mode: m, ty: t, ident: i, id: p.get_id()})
         }
     }
 
@@ -2051,8 +2051,8 @@ class parser {
             let mut item_attrs;
             match self.parse_outer_attrs_or_ext(first_item_attrs) {
               none => item_attrs = ~[],
-              some(left(attrs)) => item_attrs = attrs,
-              some(right(ext)) => {
+              some(Left(attrs)) => item_attrs = attrs,
+              some(Right(ext)) => {
                 return @spanned(lo, ext.span.hi,
                                 stmt_expr(ext, self.get_id()));
               }