pub fn parse_path(&mut self, mode: PathParsingMode) -> PResult<'a, ast::Path> {
        // Check for a whole path...
        let found = match self.token {
            token::Interpolated(token::NtPath(_)) => Some(self.bump_and_get()),
            _ => None,
        };
        if let Some(token::Interpolated(token::NtPath(path))) = found {
            return Ok(*path);
        }

        let lo = self.span.lo;
        let is_global = self.eat(&token::ModSep);

        // Parse any number of segments and bound sets. A segment is an
        // identifier followed by an optional lifetime and a set of types.
        // A bound set is a set of type parameter bounds.
        let segments = match mode {
            LifetimeAndTypesWithoutColons => {
                try!(self.parse_path_segments_without_colons())
            }
            LifetimeAndTypesWithColons => {
                try!(self.parse_path_segments_with_colons())
            }
            NoTypesAllowed => {
                try!(self.parse_path_segments_without_types())
            }
        };

        // Assemble the span.
        let span = mk_sp(lo, self.last_span.hi);

        // Assemble the result.
        Ok(ast::Path {
            span: span,
            global: is_global,
            segments: segments,
        })
    }
/// Parses a path and optional type parameter bounds, depending on the
/// mode. The `mode` parameter determines whether lifetimes, types, and/or
/// bounds are permitted and whether `::` must precede type parameter
/// groups.
Parses a path and optional type parameter bounds, depending on the
mode. The `mode` parameter determines whether lifetimes, types, and/or
bounds are permitted and whether `::` must precede type parameter
groups.
Parses a path and optional type parameter bounds depending on the mode . The ` mode ` parameter determines whether lifetimes types and / or bounds are permitted and whether ` :: ` must precede type parameter groups .
pub fn parse_path(&mut self, mode: PathParsingMode) -> PResult<'a, ast::Path> {
        // Check for a whole path...
        let found = match self.token {
            token::Interpolated(token::NtPath(_)) => Some(self.bump_and_get()),
            _ => None,
        };
        if let Some(token::Interpolated(token::NtPath(path))) = found {
            return Ok(*path);
        }
        let lo = self.span.lo;
        let is_global = self.eat(&token::ModSep);
        // Parse any number of segments and bound sets. A segment is an
        // identifier followed by an optional lifetime and a set of types.
        // A bound set is a set of type parameter bounds.
        let segments = match mode {
            LifetimeAndTypesWithoutColons => {
                try!(self.parse_path_segments_without_colons())
            }
            LifetimeAndTypesWithColons => {
                try!(self.parse_path_segments_with_colons())
            }
            NoTypesAllowed => {
                try!(self.parse_path_segments_without_types())
            }
        };
        // Assemble the span.
        let span = mk_sp(lo, self.last_span.hi);
        // Assemble the result.
        Ok(ast::Path {
            span: span,
            global: is_global,
            segments: segments,
        })
    }
pub fn parse_path ( & mut self , mode : PathParsingMode ) -> PResult < ' a , ast :: Path > { // Check for a whole path... let found = match self . token { token :: Interpolated ( token :: NtPath ( _ ) ) => Some ( self . bump_and_get ( ) ) , _ => None , } ; if let Some ( token :: Interpolated ( token :: NtPath ( path ) ) ) = found { return Ok ( * path ) ; } let lo = self . span . lo ; let is_global = self . eat ( & token :: ModSep ) ; // Parse any number of segments and bound sets. A segment is an // identifier followed by an optional lifetime and a set of types. // A bound set is a set of type parameter bounds. let segments = match mode { LifetimeAndTypesWithoutColons => { try ! ( self parse_path_segments_without_colons ( ) ) } LifetimeAndTypesWithColons => { try ! ( self parse_path_segments_with_colons ( ) ) } NoTypesAllowed => { try ! ( self parse_path_segments_without_types ( ) ) } } ; // Assemble the span. let span = mk_sp ( lo , self . last_span . hi ) ; // Assemble the result. Ok ( ast :: Path { span : span , global : is_global , segments : segments , } ) }
Parses a path and optional type parameter bounds, depending on the
mode.
Parses a path and optional type parameter bounds depending on the mode .
&mut self
mode
PathParsingMode
&mut self
mode
PathParsingMode