@@ -18,9 +18,18 @@ public static class ParametersParser
1818 // PlaceholderParameter
1919 // .As<char, PlaceholderParameter, IRuleParameter>();
2020
21+
22+ public static readonly Parser < char , Func < IRuleParameter , IRuleParameter > > ChangeParameter =
23+ CommonParser . Dote . Then ( Parser . CIEnum < ChangeType > ( ) )
24+ . Optional ( )
25+ . Select ( changeType => new Func < IRuleParameter , IRuleParameter > ( placeholder =>
26+ changeType . HasValue ? new ChangeParameter ( placeholder , changeType . Value ) : placeholder ) )
27+ . Try ( ) ;
28+
2129 public static readonly Parser < char , IRuleParameter > PlaceholderOrPropertyRuleParameter =
2230 PlaceholderParameter . Then ( PlaceholderPropertyParser . PlaceholderPropertyParameter ,
2331 ( placeholder , func ) => func ( placeholder ) )
32+ . Then ( ChangeParameter , ( parameter , func ) => func ( parameter ) )
2433 . Try ( ) ;
2534
2635 public static readonly Parser < char , IRuleParameter > StringParameter =
@@ -48,11 +57,5 @@ public static class ParametersParser
4857 public static readonly Parser < char , IEnumerable < IRuleParameter > > Parameters =
4958 Parameter . SeparatedAtLeastOnce ( CommonParser . Comma ) ;
5059
51- public static readonly Parser < char , Func < IRuleParameter , IRuleParameter > > ChangeTypeParameter =
52- CommonParser . Dote . Then ( Parser . CIEnum < ChangeType > ( ) )
53- . Optional ( )
54- . Select ( changeType => new Func < IRuleParameter , IRuleParameter > ( placeholder =>
55- changeType . HasValue ? new ChangeParameter ( placeholder , changeType . Value ) : placeholder ) )
56- . Try ( ) ;
5760 }
5861}
0 commit comments