[mlir][AttrType] Emit unbalanced character errors using the last punctuation used
authorRiver Riddle <riddleriver@gmail.com>
Thu, 12 Jan 2023 22:20:00 +0000 (14:20 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Thu, 12 Jan 2023 22:58:05 +0000 (14:58 -0800)
commit537c6016c5855614d12c9ae35032b7bb0fd4f57b
tree21f351fc7eacc399ef945ecd578479f4c66a21b0
parent91063baa437f3ee344a59889ddb490386de02ad9
[mlir][AttrType] Emit unbalanced character errors using the last punctuation used

This gives a better diagnostic in general, because it indicates that the user didn't
close out the last open puncutation range. For example:

```
foo.op {
  some.op -> !blah.pointer<
}
```
We want the error to hint about the unclosed `<`, not the `}` (which isn't really in the context of the type).

Differential Revision: https://reviews.llvm.org/D141635
mlir/lib/AsmParser/DialectSymbolParser.cpp
mlir/test/Dialect/SPIRV/IR/types.mlir
mlir/test/IR/invalid.mlir