An attribute without a type builder followed by a colon in an assembly format is potentially ambiguous because the parser will read ahead to parse the colon-type and pass this as the type argument to the attribute's constructor.
However, the previous verifier that checks for this ambiguity erroneously produces an error in the case of
let assemblyFormat = "( `(` $attr `)` )? `:`";
This patch fixes the bug by implementing a checker that correctly handles all edge cases, including very strange assembly formats like:
let assemblyFormat = "( `(` $attr ) : (`>`)? attr-dict (`>` $a^) : (`<`)? `:`";
Shouldn't we be checking optional elements as well?
Feels like we should diagnose this.