@@ -698,8 +698,8 @@ mod test {
698
698
let input = ops:: Input :: new ( type_row ! [ NAT , NAT ] ) ;
699
699
let output = ops:: Output :: new ( type_row ! [ NAT ] ) ;
700
700
701
- let input = hugr. add_op_with_parent ( hugr. root ( ) , input) ?;
702
- let output = hugr. add_op_with_parent ( hugr. root ( ) , output) ?;
701
+ let input = hugr. add_node_with_parent ( hugr. root ( ) , input) ?;
702
+ let output = hugr. add_node_with_parent ( hugr. root ( ) , output) ?;
703
703
704
704
assert_matches ! ( hugr. get_io( hugr. root( ) ) , Some ( _) ) ;
705
705
@@ -715,25 +715,25 @@ mod test {
715
715
let mult_c_sig = FunctionType :: new ( type_row ! [ NAT , NAT ] , type_row ! [ NAT ] )
716
716
. with_extension_delta ( & ExtensionSet :: singleton ( & C ) ) ;
717
717
718
- let add_a = hugr. add_op_with_parent (
718
+ let add_a = hugr. add_node_with_parent (
719
719
hugr. root ( ) ,
720
720
ops:: DFG {
721
721
signature : add_a_sig,
722
722
} ,
723
723
) ?;
724
- let add_b = hugr. add_op_with_parent (
724
+ let add_b = hugr. add_node_with_parent (
725
725
hugr. root ( ) ,
726
726
ops:: DFG {
727
727
signature : add_b_sig,
728
728
} ,
729
729
) ?;
730
- let add_ab = hugr. add_op_with_parent (
730
+ let add_ab = hugr. add_node_with_parent (
731
731
hugr. root ( ) ,
732
732
ops:: DFG {
733
733
signature : add_ab_sig,
734
734
} ,
735
735
) ?;
736
- let mult_c = hugr. add_op_with_parent (
736
+ let mult_c = hugr. add_node_with_parent (
737
737
hugr. root ( ) ,
738
738
ops:: DFG {
739
739
signature : mult_c_sig,
@@ -877,7 +877,7 @@ mod test {
877
877
let [ input, output] = hugr. get_io ( hugr. root ( ) ) . unwrap ( ) ;
878
878
let add_r_sig = FunctionType :: new ( type_row ! [ NAT ] , type_row ! [ NAT ] ) . with_extension_delta ( & rs) ;
879
879
880
- let add_r = hugr. add_op_with_parent (
880
+ let add_r = hugr. add_node_with_parent (
881
881
hugr. root ( ) ,
882
882
ops:: DFG {
883
883
signature : add_r_sig,
@@ -888,11 +888,11 @@ mod test {
888
888
let src_sig = FunctionType :: new ( type_row ! [ ] , type_row ! [ NAT ] )
889
889
. with_extension_delta ( & ExtensionSet :: new ( ) ) ;
890
890
891
- let src = hugr. add_op_with_parent ( hugr. root ( ) , ops:: DFG { signature : src_sig } ) ?;
891
+ let src = hugr. add_node_with_parent ( hugr. root ( ) , ops:: DFG { signature : src_sig } ) ?;
892
892
893
893
let mult_sig = FunctionType :: new ( type_row ! [ NAT , NAT ] , type_row ! [ NAT ] ) ;
894
894
// Mult has open extension requirements, which we should solve to be "R"
895
- let mult = hugr. add_op_with_parent (
895
+ let mult = hugr. add_node_with_parent (
896
896
hugr. root ( ) ,
897
897
ops:: DFG {
898
898
signature : mult_sig,
@@ -956,14 +956,14 @@ mod test {
956
956
) -> Result < [ Node ; 3 ] , Box < dyn Error > > {
957
957
let op: OpType = op. into ( ) ;
958
958
959
- let node = hugr. add_op_with_parent ( parent, op) ?;
960
- let input = hugr. add_op_with_parent (
959
+ let node = hugr. add_node_with_parent ( parent, op) ?;
960
+ let input = hugr. add_node_with_parent (
961
961
node,
962
962
ops:: Input {
963
963
types : op_sig. input ,
964
964
} ,
965
965
) ?;
966
- let output = hugr. add_op_with_parent (
966
+ let output = hugr. add_node_with_parent (
967
967
node,
968
968
ops:: Output {
969
969
types : op_sig. output ,
@@ -988,15 +988,15 @@ mod test {
988
988
Into :: < OpType > :: into ( op) . signature ( ) ,
989
989
) ?;
990
990
991
- let lift1 = hugr. add_op_with_parent (
991
+ let lift1 = hugr. add_node_with_parent (
992
992
case,
993
993
ops:: LeafOp :: Lift {
994
994
type_row : type_row ! [ NAT ] ,
995
995
new_extension : first_ext,
996
996
} ,
997
997
) ?;
998
998
999
- let lift2 = hugr. add_op_with_parent (
999
+ let lift2 = hugr. add_node_with_parent (
1000
1000
case,
1001
1001
ops:: LeafOp :: Lift {
1002
1002
type_row : type_row ! [ NAT ] ,
@@ -1066,13 +1066,13 @@ mod test {
1066
1066
} ) ) ;
1067
1067
1068
1068
let root = hugr. root ( ) ;
1069
- let input = hugr. add_op_with_parent (
1069
+ let input = hugr. add_node_with_parent (
1070
1070
root,
1071
1071
ops:: Input {
1072
1072
types : type_row ! [ NAT ] ,
1073
1073
} ,
1074
1074
) ?;
1075
- let output = hugr. add_op_with_parent (
1075
+ let output = hugr. add_node_with_parent (
1076
1076
root,
1077
1077
ops:: Output {
1078
1078
types : type_row ! [ NAT ] ,
@@ -1097,7 +1097,7 @@ mod test {
1097
1097
. unwrap ( ) ;
1098
1098
1099
1099
let lift = hugr
1100
- . add_op_with_parent (
1100
+ . add_node_with_parent (
1101
1101
node,
1102
1102
ops:: LeafOp :: Lift {
1103
1103
type_row : type_row ! [ NAT ] ,
@@ -1149,7 +1149,7 @@ mod test {
1149
1149
1150
1150
let [ bb, bb_in, bb_out] = create_with_io ( hugr, bb_parent, dfb, dfb_sig) ?;
1151
1151
1152
- let dfg = hugr. add_op_with_parent ( bb, op) ?;
1152
+ let dfg = hugr. add_node_with_parent ( bb, op) ?;
1153
1153
1154
1154
hugr. connect ( bb_in, 0 , dfg, 0 ) ?;
1155
1155
hugr. connect ( dfg, 0 , bb_out, 0 ) ?;
@@ -1181,16 +1181,16 @@ mod test {
1181
1181
extension_delta : entry_extensions,
1182
1182
} ;
1183
1183
1184
- let exit = hugr. add_op_with_parent (
1184
+ let exit = hugr. add_node_with_parent (
1185
1185
root,
1186
1186
ops:: BasicBlock :: Exit {
1187
1187
cfg_outputs : exit_types. into ( ) ,
1188
1188
} ,
1189
1189
) ?;
1190
1190
1191
- let entry = hugr. add_op_before ( exit, dfb) ?;
1192
- let entry_in = hugr. add_op_with_parent ( entry, ops:: Input { types : inputs } ) ?;
1193
- let entry_out = hugr. add_op_with_parent (
1191
+ let entry = hugr. add_node_before ( exit, dfb) ?;
1192
+ let entry_in = hugr. add_node_with_parent ( entry, ops:: Input { types : inputs } ) ?;
1193
+ let entry_out = hugr. add_node_with_parent (
1194
1194
entry,
1195
1195
ops:: Output {
1196
1196
types : vec ! [ entry_tuple_sum] . into ( ) ,
@@ -1245,7 +1245,7 @@ mod test {
1245
1245
type_row ! [ NAT ] ,
1246
1246
) ?;
1247
1247
1248
- let mkpred = hugr. add_op_with_parent (
1248
+ let mkpred = hugr. add_node_with_parent (
1249
1249
entry,
1250
1250
make_opaque (
1251
1251
A ,
@@ -1341,7 +1341,7 @@ mod test {
1341
1341
type_row ! [ NAT ] ,
1342
1342
) ?;
1343
1343
1344
- let entry_mid = hugr. add_op_with_parent (
1344
+ let entry_mid = hugr. add_node_with_parent (
1345
1345
entry,
1346
1346
make_opaque ( UNKNOWN_EXTENSION , FunctionType :: new ( vec ! [ NAT ] , twoway ( NAT ) ) ) ,
1347
1347
) ?;
@@ -1427,7 +1427,7 @@ mod test {
1427
1427
type_row ! [ NAT ] ,
1428
1428
) ?;
1429
1429
1430
- let entry_dfg = hugr. add_op_with_parent (
1430
+ let entry_dfg = hugr. add_node_with_parent (
1431
1431
entry,
1432
1432
make_opaque (
1433
1433
UNKNOWN_EXTENSION ,
@@ -1508,7 +1508,7 @@ mod test {
1508
1508
type_row ! [ NAT ] ,
1509
1509
) ?;
1510
1510
1511
- let entry_mid = hugr. add_op_with_parent (
1511
+ let entry_mid = hugr. add_node_with_parent (
1512
1512
entry,
1513
1513
make_opaque ( UNKNOWN_EXTENSION , FunctionType :: new ( vec ! [ NAT ] , oneway ( NAT ) ) ) ,
1514
1514
) ?;
0 commit comments