[PATCH] D74681: [mlir][DeclarativeParser] Add basic support for optional groups in the assembly format.
River Riddle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 21 13:16:10 PST 2020
rriddle added inline comments.
================
Comment at: mlir/docs/OpDefinitions.md:655
+ // of operands.
+ let assemblyFormat = "attr-dict ($operands? `:` type($operands))";
+}
----------------
antiagainst wrote:
> antiagainst wrote:
> > It's sort of counter intuitive for me to see this. I'd assume something like `($operands` `:` type($operands))?` would be more natural. But maybe that's drawing too much from regex background. What about something like `($operands^` `:` type($operands))?` so one uses `^` to mean anchor and still retain overall similarity with regex?
> Reformat:
>
>
> It's sort of counter intuitive for me to see this. I'd assume something like `($operands : type($operands))?` would be more natural. But maybe that's drawing too much from regex background. What about something like `($operands^ : type($operands))?` so one uses `^` to mean anchor and still retain overall similarity with regex?
I was reaching for something like this but glossed over using ^. Looks much better now, thanks Lei!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74681/new/
https://reviews.llvm.org/D74681
More information about the llvm-commits
mailing list