Skip to main content

parse

Macro parse 

Source
macro_rules! parse {
    ($src:tt as $ty:ty) => { ... };
    ($src:tt) => { ... };
}
Expand description

Parse a source string into a typed AST node, returning Result<T, ParseError>.

The type can be given explicitly with as T or inferred from context.

ยงExample

use moxy_token::*;

let token: Fn = parse!("fn").unwrap();
let token = parse!("fn" as Fn).unwrap();