@@ -711,7 +711,7 @@ mod desc {
711
711
pub ( crate ) const parse_list: & str = "a space-separated list of strings" ;
712
712
pub ( crate ) const parse_list_with_polarity: & str =
713
713
"a comma-separated list of strings, with elements beginning with + or -" ;
714
- pub ( crate ) const parse_autodiff: & str = "a comma separated list of settings: `Enable`, `PrintSteps`, `PrintTA`, `PrintAA`, `PrintPerf`, `PrintModBefore`, `PrintModAfter`, `PrintModFinal`, `PrintPasses`, `NoPostopt`, `LooseTypes`, `Inline`" ;
714
+ pub ( crate ) const parse_autodiff: & str = "a comma separated list of settings: `Enable`, `PrintSteps`, `PrintTA`, `PrintTAFn`, ` PrintAA`, `PrintPerf`, `PrintModBefore`, `PrintModAfter`, `PrintModFinal`, `PrintPasses`, `NoPostopt`, `LooseTypes`, `Inline`" ;
715
715
pub ( crate ) const parse_comma_list: & str = "a comma-separated list of strings" ;
716
716
pub ( crate ) const parse_opt_comma_list: & str = parse_comma_list;
717
717
pub ( crate ) const parse_number: & str = "a number" ;
@@ -1351,9 +1351,22 @@ pub mod parse {
1351
1351
let mut v: Vec < & str > = v. split ( "," ) . collect ( ) ;
1352
1352
v. sort_unstable ( ) ;
1353
1353
for & val in v. iter ( ) {
1354
- let variant = match val {
1354
+ // Split each entry on '=' if it has an argument
1355
+ let ( key, arg) = match val. split_once ( '=' ) {
1356
+ Some ( ( k, a) ) => ( k, Some ( a) ) ,
1357
+ None => ( val, None ) ,
1358
+ } ;
1359
+
1360
+ let variant = match key {
1355
1361
"Enable" => AutoDiff :: Enable ,
1356
1362
"PrintTA" => AutoDiff :: PrintTA ,
1363
+ "PrintTAFn" => {
1364
+ if let Some ( fun) = arg {
1365
+ AutoDiff :: PrintTAFn ( fun. to_string ( ) )
1366
+ } else {
1367
+ return false ;
1368
+ }
1369
+ }
1357
1370
"PrintAA" => AutoDiff :: PrintAA ,
1358
1371
"PrintPerf" => AutoDiff :: PrintPerf ,
1359
1372
"PrintSteps" => AutoDiff :: PrintSteps ,
0 commit comments