@@ -937,10 +937,13 @@ mlir.Parser = class {
937937 if ( op . name . endsWith ( '.call' ) || op . name . endsWith ( '.generic_call' ) ) {
938938 this . parseSymbolName ( 'callee' , op . attributes ) ;
939939 }
940- if ( op . name === 'arith.cmpi' ) {
940+ if ( op . name === 'arith.cmpi' || op . name . endsWith ( '.contract' ) ) {
941941 if ( this . _match ( 'id' ) ) {
942- op . attributes . push ( { name : 'predicate' , value : this . _read ( ) } ) ;
943- this . _read ( ',' ) ;
942+ const list = [ ] ;
943+ do {
944+ list . push ( this . _read ( ) ) ;
945+ } while ( this . _eat ( ',' ) && this . _match ( 'id' ) ) ;
946+ op . attributes . push ( { name : 'predicate' , value : list } ) ;
944947 }
945948 }
946949 if ( op . name . endsWith ( '.func' ) ) {
@@ -1038,7 +1041,7 @@ mlir.Parser = class {
10381041 // dictionary-attribute?
10391042 // condition: start with `{`, end with `}`
10401043 if ( this . _match ( '{' ) ) {
1041- if ( op . attributes . length === 0 ) {
1044+ if ( op . attributes . length === 0 || ( op . attributes . length === 1 && op . attributes [ 0 ] . name === 'predicate' ) ) {
10421045 this . parseAttributeDict ( op . attributes ) ;
10431046 } else {
10441047 const region = { } ;
@@ -1248,6 +1251,9 @@ mlir.Parser = class {
12481251 const value = this . _parseValue ( ) ;
12491252 input . type = value . type ;
12501253 input . value = value . value ;
1254+ if ( open && this . _eat ( ':' ) ) {
1255+ input . type = this . _parseType ( ) ;
1256+ }
12511257 }
12521258 inputs . push ( input ) ;
12531259 if ( ! this . _eat ( ',' ) ) {
@@ -1267,6 +1273,7 @@ mlir.Parser = class {
12671273 this . _token . value === 'i64' ||
12681274 this . _token . value === 'si64' ||
12691275 this . _token . value === 'f32' ||
1276+ this . _token . value === 'f64' ||
12701277 this . _token . value === 'index' ) {
12711278 return this . _read ( 'id' ) ;
12721279 }
0 commit comments