Struct arithmetic_typing::Annotated
source · pub struct Annotated<T>(/* private fields */);
Expand description
Grammar with support of type annotations. Works as a decorator.
§Examples
use arithmetic_parser::grammars::{F32Grammar, Parse};
use arithmetic_typing::Annotated;
let code = "x: [Num] = (1, 2, 3);";
let ast = Annotated::<F32Grammar>::parse_statements(code)?;
Trait Implementations§
source§impl<T: ParseLiteral> Grammar for Annotated<T>
impl<T: ParseLiteral> Grammar for Annotated<T>
source§impl<T: ParseLiteral> Parse for Annotated<T>
impl<T: ParseLiteral> Parse for Annotated<T>
Supports all syntax features.
source§fn parse_statements<'a, I>(input: I) -> Result<Block<'a, Self::Base>, Error>where
I: IntoInputSpan<'a>,
Self: Sized,
fn parse_statements<'a, I>(input: I) -> Result<Block<'a, Self::Base>, Error>where
I: IntoInputSpan<'a>,
Self: Sized,
Parses a list of statements.
source§fn parse_streaming_statements<'a, I>(
input: I,
) -> Result<Block<'a, Self::Base>, Error>where
I: IntoInputSpan<'a>,
Self: Sized,
fn parse_streaming_statements<'a, I>(
input: I,
) -> Result<Block<'a, Self::Base>, Error>where
I: IntoInputSpan<'a>,
Self: Sized,
Parses a potentially incomplete list of statements.
source§impl<T: ParseLiteral> ParseLiteral for Annotated<T>
impl<T: ParseLiteral> ParseLiteral for Annotated<T>
Auto Trait Implementations§
impl<T> Freeze for Annotated<T>
impl<T> RefUnwindSafe for Annotated<T>where
T: RefUnwindSafe,
impl<T> Send for Annotated<T>where
T: Send,
impl<T> Sync for Annotated<T>where
T: Sync,
impl<T> Unpin for Annotated<T>where
T: Unpin,
impl<T> UnwindSafe for Annotated<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more