@@ -711,7 +711,7 @@ mod desc {
711711 pub ( crate ) const parse_list: & str = "a space-separated list of strings" ;
712712 pub ( crate ) const parse_list_with_polarity: & str =
713713 "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`" ;
715715 pub ( crate ) const parse_comma_list: & str = "a comma-separated list of strings" ;
716716 pub ( crate ) const parse_opt_comma_list: & str = parse_comma_list;
717717 pub ( crate ) const parse_number: & str = "a number" ;
@@ -1351,9 +1351,22 @@ pub mod parse {
13511351 let mut v: Vec < & str > = v. split ( "," ) . collect ( ) ;
13521352 v. sort_unstable ( ) ;
13531353 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 {
13551361 "Enable" => AutoDiff :: Enable ,
13561362 "PrintTA" => AutoDiff :: PrintTA ,
1363+ "PrintTAFn" => {
1364+ if let Some ( fun) = arg {
1365+ AutoDiff :: PrintTAFn ( fun. to_string ( ) )
1366+ } else {
1367+ return false ;
1368+ }
1369+ }
13571370 "PrintAA" => AutoDiff :: PrintAA ,
13581371 "PrintPerf" => AutoDiff :: PrintPerf ,
13591372 "PrintSteps" => AutoDiff :: PrintSteps ,
0 commit comments