fn parse(input: ParseStream<'_>) -> parse::Result<Self> {
        if input.is_empty() {
            return Err(input.error("call to `uri!` cannot be empty"));
        }

        // Parse the mount point and suffixing ',', if any.
        let mount_point = if input.peek(LitStr) {
            let string = input.parse::<LitStr>()?;
            let mount_point = Origin::parse_owned(string.value())
                .map(|m| m.into_normalized())
                .map_err(|_| {
                    // TODO(proc_macro): use error, add example as a help
                    parse::Error::new(string.span(), "invalid mount point; \
                    mount points must be static, absolute URIs: `/example`")
                })?;

            if !input.peek(Token![,]) && input.cursor().eof() {
                return err(string.span(), "unexpected end of input: \
                    expected ',' followed by route path");
            }

            input.parse::<Token![,]>()?;
            Some(mount_point)
        } else {
            None
        };

        // Parse the route identifier, which must always exist.
        let route_path = input.parse::<Path>()?;

        // If there are no arguments, finish early.
        if !input.peek(Token![:]) && input.cursor().eof() {
            let arguments = Args::Unnamed(Punctuated::new());
            return Ok(Self { mount_point, route_path, arguments });
        }

        // Parse arguments
        let colon = input.parse::<Token![:]>()?;
        let arguments: Punctuated<Arg, Token![,]> = input.parse_terminated(Arg::parse)?;

        // A 'colon' was used but there are no arguments.
        if arguments.is_empty() {
            return err(colon.span(), "expected argument list after `:`");
        }

        // Ensure that both types of arguments were not used at once.
        let (mut homogeneous_args, mut prev_named) = (true, None);
        for arg in &arguments {
            match prev_named {
                Some(prev_named) => homogeneous_args = prev_named == arg.is_named(),
                None => prev_named = Some(arg.is_named()),
            }
        }

        if !homogeneous_args {
            return err(arguments.span(), "named and unnamed parameters cannot be mixed");
        }

        // Create the `Args` enum, which properly record one-kind-of-argument-ness.
        let arguments = match prev_named {
            Some(true) => Args::Named(arguments),
            _ => Args::Unnamed(arguments)
        };

        Ok(Self { mount_point, route_path, arguments })
    }
// Parses the mount point, if any, route identifier, and arguments.
Parses the mount point, if any, route identifier, and arguments.
Parses the mount point if any route identifier and arguments .
fn parse(input: ParseStream<'_>) -> parse::Result<Self> {
        if input.is_empty() {
            return Err(input.error("call to `uri!` cannot be empty"));
        }
        // Parse the mount point and suffixing ',', if any.
        let mount_point = if input.peek(LitStr) {
            let string = input.parse::<LitStr>()?;
            let mount_point = Origin::parse_owned(string.value())
                .map(|m| m.into_normalized())
                .map_err(|_| {
                    // TODO(proc_macro): use error, add example as a help
                    parse::Error::new(string.span(), "invalid mount point; \
                    mount points must be static, absolute URIs: `/example`")
                })?;
            if !input.peek(Token![,]) && input.cursor().eof() {
                return err(string.span(), "unexpected end of input: \
                    expected ',' followed by route path");
            }
            input.parse::<Token![,]>()?;
            Some(mount_point)
        } else {
            None
        };
        // Parse the route identifier, which must always exist.
        let route_path = input.parse::<Path>()?;
        // If there are no arguments, finish early.
        if !input.peek(Token![:]) && input.cursor().eof() {
            let arguments = Args::Unnamed(Punctuated::new());
            return Ok(Self { mount_point, route_path, arguments });
        }
        // Parse arguments
        let colon = input.parse::<Token![:]>()?;
        let arguments: Punctuated<Arg, Token![,]> = input.parse_terminated(Arg::parse)?;
        // A 'colon' was used but there are no arguments.
        if arguments.is_empty() {
            return err(colon.span(), "expected argument list after `:`");
        }
        // Ensure that both types of arguments were not used at once.
        let (mut homogeneous_args, mut prev_named) = (true, None);
        for arg in &arguments {
            match prev_named {
                Some(prev_named) => homogeneous_args = prev_named == arg.is_named(),
                None => prev_named = Some(arg.is_named()),
            }
        }
        if !homogeneous_args {
            return err(arguments.span(), "named and unnamed parameters cannot be mixed");
        }
        // Create the `Args` enum, which properly record one-kind-of-argument-ness.
        let arguments = match prev_named {
            Some(true) => Args::Named(arguments),
            _ => Args::Unnamed(arguments)
        };
        Ok(Self { mount_point, route_path, arguments })
    }
fn parse ( input : ParseStream < ' _ > ) -> parse :: Result < Self > { if input . is_empty ( ) { return Err ( input . error ( " " ) ) ; } // Parse the mount point and suffixing ',', if any. let mount_point = if input . peek ( LitStr ) { let string = input . parse :: < LitStr > ( ) ? ; let mount_point = Origin :: parse_owned ( string . value ( ) ) . map ( | m | m . into_normalized ( ) ) . map_err ( | _ | { // TODO(proc_macro): use error, add example as a help parse :: Error :: new ( string . span ( ) , " \
 " ) } ) ? ; if ! input . peek ( Token ! [ ] ) && input . cursor ( ) . eof ( ) { return err ( string . span ( ) , " \
 " ) ; } input . parse :: < Token ! [ ] > ( ) ? ; Some ( mount_point ) } else { None } ; // Parse the route identifier, which must always exist. let route_path = input . parse :: < Path > ( ) ? ; // If there are no arguments, finish early. if ! input . peek ( Token ! [ ] ) && input . cursor ( ) . eof ( ) { let arguments = Args :: Unnamed ( Punctuated :: new ( ) ) ; return Ok ( Self { mount_point , route_path , arguments } ) ; } // Parse arguments let colon = input . parse :: < Token ! [ ] > ( ) ? ; let arguments : Punctuated < Arg , Token ! [ ] > = input . parse_terminated ( Arg :: parse ) ? ; // A 'colon' was used but there are no arguments. if arguments . is_empty ( ) { return err ( colon . span ( ) , " " ) ; } // Ensure that both types of arguments were not used at once. let ( mut homogeneous_args , mut prev_named ) = ( true , None ) ; for arg in & arguments { match prev_named { Some ( prev_named ) => homogeneous_args = prev_named == arg . is_named ( ) , None => prev_named = Some ( arg . is_named ( ) ) , } } if ! homogeneous_args { return err ( arguments . span ( ) , " " ) ; } // Create the `Args` enum, which properly record one-kind-of-argument-ness. let arguments = match prev_named { Some ( true ) => Args :: Named ( arguments ) , _ => Args :: Unnamed ( arguments ) } ; Ok ( Self { mount_point , route_path , arguments } ) }
Parses the mount point, if any, route identifier, and arguments.
Parses the mount point if any route identifier and arguments .
input
ParseStream<'_>
input
ParseStream<'_>