@@ -937,10 +937,13 @@ mlir.Parser = class {
937
937
if ( op . name . endsWith ( '.call' ) || op . name . endsWith ( '.generic_call' ) ) {
938
938
this . parseSymbolName ( 'callee' , op . attributes ) ;
939
939
}
940
- if ( op . name === 'arith.cmpi' ) {
940
+ if ( op . name === 'arith.cmpi' || op . name . endsWith ( '.contract' ) ) {
941
941
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 } ) ;
944
947
}
945
948
}
946
949
if ( op . name . endsWith ( '.func' ) ) {
@@ -1038,7 +1041,7 @@ mlir.Parser = class {
1038
1041
// dictionary-attribute?
1039
1042
// condition: start with `{`, end with `}`
1040
1043
if ( this . _match ( '{' ) ) {
1041
- if ( op . attributes . length === 0 ) {
1044
+ if ( op . attributes . length === 0 || ( op . attributes . length === 1 && op . attributes [ 0 ] . name === 'predicate' ) ) {
1042
1045
this . parseAttributeDict ( op . attributes ) ;
1043
1046
} else {
1044
1047
const region = { } ;
@@ -1248,6 +1251,9 @@ mlir.Parser = class {
1248
1251
const value = this . _parseValue ( ) ;
1249
1252
input . type = value . type ;
1250
1253
input . value = value . value ;
1254
+ if ( open && this . _eat ( ':' ) ) {
1255
+ input . type = this . _parseType ( ) ;
1256
+ }
1251
1257
}
1252
1258
inputs . push ( input ) ;
1253
1259
if ( ! this . _eat ( ',' ) ) {
@@ -1267,6 +1273,7 @@ mlir.Parser = class {
1267
1273
this . _token . value === 'i64' ||
1268
1274
this . _token . value === 'si64' ||
1269
1275
this . _token . value === 'f32' ||
1276
+ this . _token . value === 'f64' ||
1270
1277
this . _token . value === 'index' ) {
1271
1278
return this . _read ( 'id' ) ;
1272
1279
}
0 commit comments