From 74c69e1053188d92b86bc8b28cbf1af87d31ea2d Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 14 Aug 2012 16:54:13 -0700 Subject: Convert more core types to camel case --- src/libsyntax/ast_map.rs | 4 ++-- src/libsyntax/attr.rs | 14 +++++++------- src/libsyntax/codemap.rs | 4 ++-- src/libsyntax/ext/pipes/proto.rs | 6 +++--- src/libsyntax/ext/qquote.rs | 4 ++-- src/libsyntax/ext/simplext.rs | 4 ++-- src/libsyntax/ext/tt/earley_parser.rs | 4 ++-- src/libsyntax/parse/attr.rs | 10 +++++----- src/libsyntax/parse/lexer.rs | 24 ++++++++++++------------ src/libsyntax/parse/parser.rs | 16 ++++++++-------- src/libsyntax/print/pp.rs | 4 ++-- src/libsyntax/print/pprust.rs | 4 ++-- src/libsyntax/util/interner.rs | 4 ++-- 13 files changed, 51 insertions(+), 51 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index 241a212c2ac..5b2b4fb0561 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -205,8 +205,8 @@ fn map_item(i: @item, cx: ctx, v: vt) { } item_foreign_mod(nm) => { let abi = match attr::foreign_abi(i.attrs) { - either::left(msg) => cx.diag.span_fatal(i.span, msg), - either::right(abi) => abi + either::Left(msg) => cx.diag.span_fatal(i.span, msg), + either::Right(abi) => abi }; for nm.items.each |nitem| { cx.map.insert(nitem.id, diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 65c2e00faca..7c04d6e4570 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -2,7 +2,7 @@ import std::map; import std::map::hashmap; -import either::either; +import either::Either; import diagnostic::span_handler; import ast_util::{spanned, dummy_spanned}; import parse::comments::{doc_comment_style, strip_doc_comment_decoration}; @@ -330,22 +330,22 @@ fn find_linkage_metas(attrs: ~[ast::attribute]) -> ~[@ast::meta_item] { } } -fn foreign_abi(attrs: ~[ast::attribute]) -> either<~str, ast::foreign_abi> { +fn foreign_abi(attrs: ~[ast::attribute]) -> Either<~str, ast::foreign_abi> { return match attr::first_attr_value_str_by_name(attrs, ~"abi") { option::none => { - either::right(ast::foreign_abi_cdecl) + either::Right(ast::foreign_abi_cdecl) } option::some(@~"rust-intrinsic") => { - either::right(ast::foreign_abi_rust_intrinsic) + either::Right(ast::foreign_abi_rust_intrinsic) } option::some(@~"cdecl") => { - either::right(ast::foreign_abi_cdecl) + either::Right(ast::foreign_abi_cdecl) } option::some(@~"stdcall") => { - either::right(ast::foreign_abi_stdcall) + either::Right(ast::foreign_abi_stdcall) } option::some(t) => { - either::left(~"unsupported abi: " + *t) + either::Left(~"unsupported abi: " + *t) } }; } diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 0d8566ae42c..e0e93b1eda5 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -1,4 +1,4 @@ -import dvec::dvec; +import dvec::{DVec, dvec}; export filename; export filemap; @@ -48,7 +48,7 @@ type filemap = @{name: filename, substr: file_substr, src: @~str, start_pos: file_pos, mut lines: ~[file_pos]}; -type codemap = @{files: dvec}; +type codemap = @{files: DVec}; type loc = {file: filemap, line: uint, col: uint}; diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs index 5fba31ed6e7..100f248a7ad 100644 --- a/src/libsyntax/ext/pipes/proto.rs +++ b/src/libsyntax/ext/pipes/proto.rs @@ -1,5 +1,5 @@ import to_str::ToStr; -import dvec::dvec; +import dvec::{DVec, dvec}; import ast::{ident}; @@ -62,7 +62,7 @@ enum state { span: span, dir: direction, ty_params: ~[ast::ty_param], - messages: dvec, + messages: DVec, proto: protocol, }), } @@ -112,7 +112,7 @@ fn protocol(name: ident, +span: span) -> protocol { class protocol_ { let name: ident; let span: span; - let states: dvec; + let states: DVec; let mut bounded: option; diff --git a/src/libsyntax/ext/qquote.rs b/src/libsyntax/ext/qquote.rs index c5af28bc0b3..6b5dce312d6 100644 --- a/src/libsyntax/ext/qquote.rs +++ b/src/libsyntax/ext/qquote.rs @@ -2,7 +2,7 @@ import ast::{crate, expr_, mac_invoc, mac_aq, mac_var}; import parse::parser; import parse::parser::parse_from_source_str; -import dvec::dvec; +import dvec::{DVec, dvec}; import fold::*; import visit::*; @@ -20,7 +20,7 @@ struct gather_item { constr: ~str; } -type aq_ctxt = @{lo: uint, gather: dvec}; +type aq_ctxt = @{lo: uint, gather: DVec}; enum fragment { from_expr(@ast::expr), from_ty(@ast::ty) diff --git a/src/libsyntax/ext/simplext.rs b/src/libsyntax/ext/simplext.rs index 98289152d33..e8899a2e541 100644 --- a/src/libsyntax/ext/simplext.rs +++ b/src/libsyntax/ext/simplext.rs @@ -1,6 +1,6 @@ import codemap::span; import std::map::{hashmap, str_hash, box_str_hash}; -import dvec::dvec; +import dvec::{DVec, dvec}; import base::*; @@ -124,7 +124,7 @@ fn compose_sels(s1: selector, s2: selector) -> selector { type binders = {real_binders: hashmap, - literal_ast_matchers: dvec}; + literal_ast_matchers: DVec}; type bindings = hashmap>; fn acumm_bindings(_cx: ext_ctxt, _b_dest: bindings, _b_src: bindings) { } diff --git a/src/libsyntax/ext/tt/earley_parser.rs b/src/libsyntax/ext/tt/earley_parser.rs index 7cc9b0e1dc2..b6dc1c05a2c 100644 --- a/src/libsyntax/ext/tt/earley_parser.rs +++ b/src/libsyntax/ext/tt/earley_parser.rs @@ -7,7 +7,7 @@ import parse::parser::{parser,SOURCE_FILE}; //import parse::common::parser_common; import parse::common::*; //resolve bug? import parse::parse_sess; -import dvec::dvec; +import dvec::{DVec, dvec}; import ast::{matcher, match_tok, match_seq, match_nonterminal, ident}; import ast_util::mk_sp; import std::map::{hashmap, box_str_hash}; @@ -42,7 +42,7 @@ type matcher_pos = ~{ sep: option, mut idx: uint, mut up: matcher_pos_up, // mutable for swapping only - matches: ~[dvec<@named_match>], + matches: ~[DVec<@named_match>], match_lo: uint, match_hi: uint, sp_lo: uint, }; 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>; +type attr_or_ext = option>; 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; +type arg_or_capture_item = Either; 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())); } diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 0d81d40ca8c..7282eaafb79 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -1,5 +1,5 @@ import io::WriterUtil; -import dvec::dvec; +import dvec::{DVec, dvec}; /* * This pretty-printer is a direct reimplementation of Philip Karlton's @@ -222,7 +222,7 @@ type printer_ = { mut top: uint, // index of top of scan_stack mut bottom: uint, // index of bottom of scan_stack // stack of blocks-in-progress being flushed by print - print_stack: dvec, + print_stack: DVec, // buffered indentation to avoid writing trailing whitespace mut pending_indentation: int, mut token_tree_last_was_ident: bool diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 05b6ca8c504..de1cd2c3df0 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -7,7 +7,7 @@ import pp::{break_offset, word, printer, import diagnostic; import ast::{required, provided}; import ast_util::{operator_prec}; -import dvec::dvec; +import dvec::{DVec, dvec}; import parse::classify::*; import util::interner; @@ -35,7 +35,7 @@ type ps = literals: option<~[comments::lit]>, mut cur_cmnt: uint, mut cur_lit: uint, - boxes: dvec, + boxes: DVec, ann: pp_ann}; fn ibox(s: ps, u: uint) { diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index e003408f3fd..9b7398d16c7 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -3,11 +3,11 @@ // type, and vice versa. import std::map; import std::map::{hashmap, hashfn, eqfn}; -import dvec::dvec; +import dvec::{DVec, dvec}; type hash_interner = {map: hashmap, - vect: dvec, + vect: DVec, hasher: hashfn, eqer: eqfn}; -- cgit 1.4.1-3-g733a5