diff options
| author | Marvin Löbel <loebel.marvin@gmail.com> | 2013-09-02 02:50:59 +0200 |
|---|---|---|
| committer | Marvin Löbel <loebel.marvin@gmail.com> | 2013-09-02 02:51:21 +0200 |
| commit | 857f8673206fd2d8803e02c68cdeb38e26b95df0 (patch) | |
| tree | 7cfb11be2843774595371087f2829d0e2e830fe2 /src/libsyntax/ext/deriving | |
| parent | 1f4aba8cbf7caa3a82b52b6f171221ed6067eed5 (diff) | |
| download | rust-857f8673206fd2d8803e02c68cdeb38e26b95df0.tar.gz rust-857f8673206fd2d8803e02c68cdeb38e26b95df0.zip | |
Renamed syntax::ast::ident -> Ident
Diffstat (limited to 'src/libsyntax/ext/deriving')
| -rw-r--r-- | src/libsyntax/ext/deriving/generic.rs | 56 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/mod.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/rand.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/to_str.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/ty.rs | 14 |
5 files changed, 43 insertions, 43 deletions
diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs index c8853e36cdd..eb05f87a8ce 100644 --- a/src/libsyntax/ext/deriving/generic.rs +++ b/src/libsyntax/ext/deriving/generic.rs @@ -163,7 +163,7 @@ StaticEnum(<ast::enum_def of C>, ~[(<ident of C0>, Left(1)), */ use ast; -use ast::{enum_def, expr, ident, Generics, struct_def}; +use ast::{enum_def, expr, Ident, Generics, struct_def}; use ext::base::ExtCtxt; use ext::build::AstBuilder; @@ -216,9 +216,9 @@ pub struct MethodDef<'self> { /// All the data about the data structure/method being derived upon. pub struct Substructure<'self> { /// ident of self - type_ident: ident, + type_ident: Ident, /// ident of the method - method_ident: ident, + method_ident: Ident, /// dereferenced access to any Self or Ptr(Self, _) arguments self_args: &'self [@expr], /// verbatim access to any other arguments @@ -234,26 +234,26 @@ pub enum SubstructureFields<'self> { ident is the ident of the current field (`None` for all fields in tuple structs). */ - Struct(~[(Option<ident>, @expr, ~[@expr])]), + Struct(~[(Option<Ident>, @expr, ~[@expr])]), /** Matching variants of the enum: variant index, ast::variant, fields: `(field ident, self, [others])`, where the field ident is only non-`None` in the case of a struct variant. */ - EnumMatching(uint, &'self ast::variant, ~[(Option<ident>, @expr, ~[@expr])]), + EnumMatching(uint, &'self ast::variant, ~[(Option<Ident>, @expr, ~[@expr])]), /** non-matching variants of the enum, [(variant index, ast::variant, [field ident, fields])] (i.e. all fields for self are in the first tuple, for other1 are in the second tuple, etc.) */ - EnumNonMatching(&'self [(uint, ast::variant, ~[(Option<ident>, @expr)])]), + EnumNonMatching(&'self [(uint, ast::variant, ~[(Option<Ident>, @expr)])]), /// A static method where Self is a struct - StaticStruct(&'self ast::struct_def, Either<uint, ~[ident]>), + StaticStruct(&'self ast::struct_def, Either<uint, ~[Ident]>), /// A static method where Self is an enum - StaticEnum(&'self ast::enum_def, ~[(ident, Either<uint, ~[ident]>)]) + StaticEnum(&'self ast::enum_def, ~[(Ident, Either<uint, ~[Ident]>)]) } @@ -273,7 +273,7 @@ representing each variant: (variant index, ast::variant instance, pub type EnumNonMatchFunc<'self> = &'self fn(@ExtCtxt, Span, &[(uint, ast::variant, - ~[(Option<ident>, @expr)])], + ~[(Option<Ident>, @expr)])], &[@expr]) -> @expr; @@ -315,7 +315,7 @@ impl<'self> TraitDef<'self> { * */ fn create_derived_impl(&self, cx: @ExtCtxt, span: Span, - type_ident: ident, generics: &Generics, + type_ident: Ident, generics: &Generics, methods: ~[@ast::method]) -> @ast::item { let trait_path = self.path.to_path(cx, span, type_ident, generics); @@ -375,7 +375,7 @@ impl<'self> TraitDef<'self> { fn expand_struct_def(&self, cx: @ExtCtxt, span: Span, struct_def: &struct_def, - type_ident: ident, + type_ident: Ident, generics: &Generics) -> @ast::item { let methods = do self.methods.map |method_def| { let (explicit_self, self_args, nonself_args, tys) = @@ -406,7 +406,7 @@ impl<'self> TraitDef<'self> { fn expand_enum_def(&self, cx: @ExtCtxt, span: Span, enum_def: &enum_def, - type_ident: ident, + type_ident: Ident, generics: &Generics) -> @ast::item { let methods = do self.methods.map |method_def| { let (explicit_self, self_args, nonself_args, tys) = @@ -439,7 +439,7 @@ impl<'self> MethodDef<'self> { fn call_substructure_method(&self, cx: @ExtCtxt, span: Span, - type_ident: ident, + type_ident: Ident, self_args: &[@expr], nonself_args: &[@expr], fields: &SubstructureFields) @@ -456,7 +456,7 @@ impl<'self> MethodDef<'self> { } fn get_ret_ty(&self, cx: @ExtCtxt, span: Span, - generics: &Generics, type_ident: ident) -> ast::Ty { + generics: &Generics, type_ident: Ident) -> ast::Ty { self.ret_ty.to_ty(cx, span, type_ident, generics) } @@ -465,8 +465,8 @@ impl<'self> MethodDef<'self> { } fn split_self_nonself_args(&self, cx: @ExtCtxt, span: Span, - type_ident: ident, generics: &Generics) - -> (ast::explicit_self, ~[@expr], ~[@expr], ~[(ident, ast::Ty)]) { + type_ident: Ident, generics: &Generics) + -> (ast::explicit_self, ~[@expr], ~[@expr], ~[(Ident, ast::Ty)]) { let mut self_args = ~[]; let mut nonself_args = ~[]; @@ -511,10 +511,10 @@ impl<'self> MethodDef<'self> { } fn create_method(&self, cx: @ExtCtxt, span: Span, - type_ident: ident, + type_ident: Ident, generics: &Generics, explicit_self: ast::explicit_self, - arg_types: ~[(ident, ast::Ty)], + arg_types: ~[(Ident, ast::Ty)], body: @expr) -> @ast::method { // create the generics that aren't for Self let fn_generics = self.generics.to_generics(cx, span, type_ident, generics); @@ -571,7 +571,7 @@ impl<'self> MethodDef<'self> { cx: @ExtCtxt, span: Span, struct_def: &struct_def, - type_ident: ident, + type_ident: Ident, self_args: &[@expr], nonself_args: &[@expr]) -> @expr { @@ -625,7 +625,7 @@ impl<'self> MethodDef<'self> { cx: @ExtCtxt, span: Span, struct_def: &struct_def, - type_ident: ident, + type_ident: Ident, self_args: &[@expr], nonself_args: &[@expr]) -> @expr { @@ -667,7 +667,7 @@ impl<'self> MethodDef<'self> { cx: @ExtCtxt, span: Span, enum_def: &enum_def, - type_ident: ident, + type_ident: Ident, self_args: &[@expr], nonself_args: &[@expr]) -> @expr { @@ -702,12 +702,12 @@ impl<'self> MethodDef<'self> { fn build_enum_match(&self, cx: @ExtCtxt, span: Span, enum_def: &enum_def, - type_ident: ident, + type_ident: Ident, self_args: &[@expr], nonself_args: &[@expr], matching: Option<uint>, matches_so_far: &mut ~[(uint, ast::variant, - ~[(Option<ident>, @expr)])], + ~[(Option<Ident>, @expr)])], match_count: uint) -> @expr { if match_count == self_args.len() { // we've matched against all arguments, so make the final @@ -852,7 +852,7 @@ impl<'self> MethodDef<'self> { cx: @ExtCtxt, span: Span, enum_def: &enum_def, - type_ident: ident, + type_ident: Ident, self_args: &[@expr], nonself_args: &[@expr]) -> @expr { @@ -874,7 +874,7 @@ impl<'self> MethodDef<'self> { } fn summarise_struct(cx: @ExtCtxt, span: Span, - struct_def: &struct_def) -> Either<uint, ~[ident]> { + struct_def: &struct_def) -> Either<uint, ~[Ident]> { let mut named_idents = ~[]; let mut unnamed_count = 0; for field in struct_def.fields.iter() { @@ -913,11 +913,11 @@ enum StructType { fn create_struct_pattern(cx: @ExtCtxt, span: Span, - struct_ident: ident, + struct_ident: Ident, struct_def: &struct_def, prefix: &str, mutbl: ast::mutability) - -> (@ast::pat, ~[(Option<ident>, @expr)]) { + -> (@ast::pat, ~[(Option<Ident>, @expr)]) { if struct_def.fields.is_empty() { return ( cx.pat_ident_binding_mode( @@ -977,7 +977,7 @@ fn create_enum_variant_pattern(cx: @ExtCtxt, variant: &ast::variant, prefix: &str, mutbl: ast::mutability) - -> (@ast::pat, ~[(Option<ident>, @expr)]) { + -> (@ast::pat, ~[(Option<Ident>, @expr)]) { let variant_ident = variant.node.name; match variant.node.kind { diff --git a/src/libsyntax/ext/deriving/mod.rs b/src/libsyntax/ext/deriving/mod.rs index 0123044478c..7fd44bfad01 100644 --- a/src/libsyntax/ext/deriving/mod.rs +++ b/src/libsyntax/ext/deriving/mod.rs @@ -18,7 +18,7 @@ library. */ -use ast::{enum_def, ident, item, Generics, struct_def}; +use ast::{enum_def, Ident, item, Generics, struct_def}; use ast::{MetaItem, MetaList, MetaNameValue, MetaWord}; use ext::base::ExtCtxt; use ext::build::AstBuilder; @@ -47,13 +47,13 @@ pub mod generic; pub type ExpandDerivingStructDefFn<'self> = &'self fn(@ExtCtxt, Span, x: &struct_def, - ident, + Ident, y: &Generics) -> @item; pub type ExpandDerivingEnumDefFn<'self> = &'self fn(@ExtCtxt, Span, x: &enum_def, - ident, + Ident, y: &Generics) -> @item; diff --git a/src/libsyntax/ext/deriving/rand.rs b/src/libsyntax/ext/deriving/rand.rs index 485df6084a8..b24c8eb84ab 100644 --- a/src/libsyntax/ext/deriving/rand.rs +++ b/src/libsyntax/ext/deriving/rand.rs @@ -9,7 +9,7 @@ // except according to those terms. use ast; -use ast::{MetaItem, item, expr, ident}; +use ast::{MetaItem, item, expr, Ident}; use codemap::Span; use ext::base::ExtCtxt; use ext::build::{AstBuilder, Duplicate}; @@ -129,8 +129,8 @@ fn rand_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr { }; fn rand_thing(cx: @ExtCtxt, span: Span, - ctor_ident: ident, - summary: &Either<uint, ~[ident]>, + ctor_ident: Ident, + summary: &Either<uint, ~[Ident]>, rand_call: &fn() -> @expr) -> @expr { match *summary { Left(count) => { diff --git a/src/libsyntax/ext/deriving/to_str.rs b/src/libsyntax/ext/deriving/to_str.rs index 1b136983de8..eecce06f69f 100644 --- a/src/libsyntax/ext/deriving/to_str.rs +++ b/src/libsyntax/ext/deriving/to_str.rs @@ -47,8 +47,8 @@ fn to_str_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr { let to_str = cx.ident_of("to_str"); - let doit = |start: &str, end: @str, name: ast::ident, - fields: &[(Option<ast::ident>, @expr, ~[@expr])]| { + let doit = |start: &str, end: @str, name: ast::Ident, + fields: &[(Option<ast::Ident>, @expr, ~[@expr])]| { if fields.len() == 0 { cx.expr_str_uniq(span, cx.str_of(name)) } else { diff --git a/src/libsyntax/ext/deriving/ty.rs b/src/libsyntax/ext/deriving/ty.rs index f0b22d9b288..6c1b8100f42 100644 --- a/src/libsyntax/ext/deriving/ty.rs +++ b/src/libsyntax/ext/deriving/ty.rs @@ -14,7 +14,7 @@ explicit `Self` type to use when specifying impls to be derived. */ use ast; -use ast::{expr,Generics,ident}; +use ast::{expr,Generics,Ident}; use ext::base::ExtCtxt; use ext::build::AstBuilder; use codemap::{Span,respan}; @@ -59,7 +59,7 @@ impl<'self> Path<'self> { pub fn to_ty(&self, cx: @ExtCtxt, span: Span, - self_ty: ident, + self_ty: Ident, self_generics: &Generics) -> ast::Ty { cx.ty_path(self.to_path(cx, span, self_ty, self_generics), None) @@ -67,7 +67,7 @@ impl<'self> Path<'self> { pub fn to_path(&self, cx: @ExtCtxt, span: Span, - self_ty: ident, + self_ty: Ident, self_generics: &Generics) -> ast::Path { let idents = self.path.map(|s| cx.ident_of(*s) ); @@ -120,7 +120,7 @@ impl<'self> Ty<'self> { pub fn to_ty(&self, cx: @ExtCtxt, span: Span, - self_ty: ident, + self_ty: Ident, self_generics: &Generics) -> ast::Ty { match *self { @@ -158,7 +158,7 @@ impl<'self> Ty<'self> { pub fn to_path(&self, cx: @ExtCtxt, span: Span, - self_ty: ident, + self_ty: Ident, self_generics: &Generics) -> ast::Path { match *self { @@ -186,7 +186,7 @@ impl<'self> Ty<'self> { fn mk_ty_param(cx: @ExtCtxt, span: Span, name: &str, bounds: &[Path], - self_ident: ident, self_generics: &Generics) -> ast::TyParam { + self_ident: Ident, self_generics: &Generics) -> ast::TyParam { let bounds = opt_vec::from( do bounds.map |b| { let path = b.to_path(cx, span, self_ident, self_generics); @@ -217,7 +217,7 @@ impl<'self> LifetimeBounds<'self> { pub fn to_generics(&self, cx: @ExtCtxt, span: Span, - self_ty: ident, + self_ty: Ident, self_generics: &Generics) -> Generics { let lifetimes = do self.lifetimes.map |lt| { |
