Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Dec 4, 2023
1 parent f1d04a2 commit 4b26fa9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions macro/src/dialect/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ impl DialectInput {
impl Parse for DialectInput {
fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
let mut name = None;
let mut tablegen = None;
let mut table_gen = None;
let mut td_file = None;
let mut includes = vec![];

for item in Punctuated::<InputField, Token![,]>::parse_terminated(input)? {
match item {
InputField::Name(field) => name = Some(field.value()),
InputField::TableGen(td) => tablegen = Some(td.value()),
InputField::TableGen(td) => table_gen = Some(td.value()),
InputField::TdFile(file) => td_file = Some(file.value()),
InputField::Includes(field) => {
includes = field.into_iter().map(|literal| literal.value()).collect()
Expand All @@ -48,7 +48,7 @@ impl Parse for DialectInput {

Ok(Self {
name: name.ok_or(input.error("dialect name required"))?,
table_gen: tablegen,
table_gen: table_gen,
td_file,
includes,
})
Expand All @@ -70,7 +70,7 @@ impl Parse for InputField {

if ident == format_ident!("name") {
Ok(Self::Name(input.parse()?))
} else if ident == format_ident!("tablegen") {
} else if ident == format_ident!("table_gen") {
Ok(Self::TableGen(input.parse()?))
} else if ident == format_ident!("td_file") {
Ok(Self::TdFile(input.parse()?))
Expand Down
2 changes: 1 addition & 1 deletion macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use syn::parse_macro_input;
/// ```rust
/// melior::dialect! {
/// name: "func",
/// tablegen: r#"include "mlir/Dialect/Func/IR/FuncOps.td""#
/// table_gen: r#"include "mlir/Dialect/Func/IR/FuncOps.td""#
/// }
/// ```
#[proc_macro]
Expand Down

0 comments on commit 4b26fa9

Please sign in to comment.