mlirformat-macros 0.2.2
“Proc macros for mlirformat: #[mlir::op], #[mlir::dialect]”
Package first published within seven daysPackage under two months old
SHA-256c6d9106aa60fe2621244d9fa73ab2e59f56140b8ef7bf8d741e868ffcc8b78ce
MaleculeO(S)H(Db)Md
Evidence
1:20… spells each field's MLIR role in its serde name and forwards the conversions.
2
3use proc_macro2::TokenStream as Ts;
4use quote::quote;
5use syn::parse::{Parse, ParseStream};
6use syn::punctuated::Punctuated;
7use syn::{Error, Fields, Ident, ItemStruct, LitStr, Meta, Token, Type, parse_quote};
8
9pub struct OpArgs {
⋯5 lines
15}
16
17impl Parse for OpArgs {
18 fn parse(input: ParseStream) -> syn::Result<Self> {
19 let mut a = Self { nam …
114:5… _ => Kind::Successor,
115 };
116 if found.replace(kind).is_some() {
117 return Err(Error::new_spanned(a, "one role per field"));
118 }
119 }
120 f.at …
136:30… :new_spanned(&item, "#[mlir::op] needs a struct with named fields"));
137 };
138 let marked = named.named.iter_mut().map(Marked::of).collect …
1//! `#[mlir::op]` and `#[mlir::dialect]`. Neither writes conversion code: `op` spells each
2//! field's MLIR role in i …
32:81… ..>` bodies
33//! (`Dialect::parse_params`).
34
35use proc_macro::TokenStream;
36use syn::{Error, ItemEnum, ItemStruct, parse_macro_input};
37
38mod dialect;
⋯4 lines
No evidence locations were recorded for this file. Raw result