From 76c0d687453cb1da2e76a1c8e007ac080f8aa0d7 Mon Sep 17 00:00:00 2001 From: varkor Date: Fri, 23 Feb 2018 17:48:54 +0000 Subject: Rename "parameter" to "arg" --- src/libsyntax/ast.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/libsyntax/ast.rs') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 7bcaf9bbd52..7ff00123624 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -135,27 +135,27 @@ pub struct PathSegment { /// `Some` means that parameter list is supplied (`Path`) /// but it can be empty (`Path<>`). /// `P` is used as a size optimization for the common case with no parameters. - pub parameters: Option>, + pub args: Option>, } impl PathSegment { pub fn from_ident(ident: Ident) -> Self { - PathSegment { ident, parameters: None } + PathSegment { ident, args: None } } pub fn crate_root(span: Span) -> Self { PathSegment::from_ident(Ident::new(keywords::CrateRoot.name(), span)) } } -/// Parameters of a path segment. +/// Arguments of a path segment. /// /// E.g. `` as in `Foo` or `(A, B)` as in `Foo(A, B)` #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum GenericArgs { /// The `<'a, A,B,C>` in `foo::bar::baz::<'a, A,B,C>` - AngleBracketed(AngleBracketedParameterData), + AngleBracketed(AngleBracketedArgs), /// The `(A,B)` and `C` in `Foo(A,B) -> C` - Parenthesized(ParenthesizedParameterData), + Parenthesized(ParenthesizedArgData), } impl GenericArgs { @@ -168,28 +168,28 @@ impl GenericArgs { } #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] -pub enum AngleBracketedParam { +pub enum GenericArg { Lifetime(Lifetime), Type(P), } /// A path like `Foo<'a, T>` #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Default)] -pub struct AngleBracketedParameterData { +pub struct AngleBracketedArgs { /// Overall span pub span: Span, - /// The parameters for this path segment. - pub parameters: Vec, + /// The arguments for this path segment. + pub args: Vec, /// Bindings (equality constraints) on associated types, if present. /// /// E.g., `Foo`. pub bindings: Vec, } -impl AngleBracketedParameterData { +impl AngleBracketedArgs { pub fn lifetimes(&self) -> impl DoubleEndedIterator { - self.parameters.iter().filter_map(|p| { - if let AngleBracketedParam::Lifetime(lt) = p { + self.args.iter().filter_map(|p| { + if let GenericArg::Lifetime(lt) = p { Some(lt) } else { None @@ -198,8 +198,8 @@ impl AngleBracketedParameterData { } pub fn types(&self) -> impl DoubleEndedIterator> { - self.parameters.iter().filter_map(|p| { - if let AngleBracketedParam::Type(ty) = p { + self.args.iter().filter_map(|p| { + if let GenericArg::Type(ty) = p { Some(ty) } else { None @@ -208,13 +208,13 @@ impl AngleBracketedParameterData { } } -impl Into>> for AngleBracketedParameterData { +impl Into>> for AngleBracketedArgs { fn into(self) -> Option> { Some(P(GenericArgs::AngleBracketed(self))) } } -impl Into>> for ParenthesizedParameterData { +impl Into>> for ParenthesizedArgData { fn into(self) -> Option> { Some(P(GenericArgs::Parenthesized(self))) } @@ -222,7 +222,7 @@ impl Into>> for ParenthesizedParameterData { /// A path like `Foo(A,B) -> C` #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] -pub struct ParenthesizedParameterData { +pub struct ParenthesizedArgData { /// Overall span pub span: Span, -- cgit 1.4.1-3-g733a5