Lines Matching full:parse
11 /// Support for checking the next token in a stream to decide how to parse.
20 /// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek
21 /// [`ParseStream::lookahead1`]: crate::parse::ParseBuffer::lookahead1
30 /// use syn::parse::{Parse, ParseStream};
49 /// impl Parse for GenericParam {
50 /// fn parse(input: ParseStream) -> Result<Self> {
53 /// input.parse().map(GenericParam::Type)
55 /// input.parse().map(GenericParam::Lifetime)
57 /// input.parse().map(GenericParam::Const)
91 /// Looks at the next token in the parse stream to determine whether it
110 /// Triggers an error at the current position of the parse stream.
154 /// Use [`ParseStream::peek`] to peek one of these types in a parse stream
159 /// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek
166 /// Pseudo-token used for peeking the end of a parse stream.
170 /// - [`ParseStream::peek`][crate::parse::ParseBuffer::peek]
171 /// - [`ParseStream::peek2`][crate::parse::ParseBuffer::peek2]
172 /// - [`ParseStream::peek3`][crate::parse::ParseBuffer::peek3]
176 /// point in the parse stream.
192 /// consuming the comma from the parse stream, because if it isn't a trailing
198 /// use syn::parse::{End, Parse, ParseStream, Result};
206 /// impl Parse for FormatArgs {
207 /// fn parse(input: ParseStream) -> Result<Self> {
208 /// let template: LitStr = input.parse()?;
213 /// input.parse::<Option<Token![,]>>()?;
216 /// input.parse()?
253 /// we'd need a parse stream actually advanced past the comma before being able
259 /// # use syn::parse::{ParseStream, Result};
262 /// # fn parse(input: ParseStream) -> Result<()> {
263 /// use syn::parse::discouraged::Speculative as _;
266 /// ahead.parse::<Option<Token![,]>>()?;
271 /// input.parse()?
281 /// # use syn::parse::{ParseStream, Result};
284 /// # fn parse(input: ParseStream) -> Result<()> {
287 /// let comma: Option<Token![,]> = input.parse()?;
291 /// input.parse::<TokenStream>()?.to_tokens(&mut args);