Skip to content

Commit 075354d

Browse files
committed
use enum parser from new version pidgin
1 parent 4e08cf6 commit 075354d

File tree

7 files changed

+9
-15
lines changed

7 files changed

+9
-15
lines changed

src/SimpleStateMachine.StructuralSearch.Sandbox/SimpleStateMachine.StructuralSearch.Sandbox.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Pidgin" Version="3.0.0" />
12+
<PackageReference Include="Pidgin" Version="3.0.1" />
1313
<PackageReference Include="YamlDotNet" Version="11.2.1" />
1414
</ItemGroup>
1515

src/SimpleStateMachine.StructuralSearch/Extensions/StringParserExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static Parser<char, T> Trim<T>(this Parser<char, T> parser)
7575
public static Parser<char, TEnum> AsEnum<TEnum>(this Parser<char, string> parser, bool ignoreCase)
7676
where TEnum: struct, Enum
7777
{
78-
return parser.Select(value => Enum.Parse<TEnum>(value, ignoreCase));
78+
return parser.Select(value => System.Enum.Parse<TEnum>(value, ignoreCase));
7979
}
8080
}
8181
}

src/SimpleStateMachine.StructuralSearch/Parsers/Parsers.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,6 @@ public static Parser<char, IEnumerable<T>> BetweenOneOfChars<T>(Func<char, Parse
105105
);
106106
}
107107

108-
public static Parser<char, TEnum> Enum<TEnum>(bool ignoreCase = false)
109-
where TEnum : struct, Enum
110-
{
111-
return new EnumParser<TEnum>(ignoreCase);
112-
}
113-
114108
public static Parser<char, TEnum> EnumExcept<TEnum>(bool ignoreCase = false, params TEnum[] excluded)
115109
where TEnum : struct, Enum
116110
{

src/SimpleStateMachine.StructuralSearch/Rules/Parameters/PlaceholderPropertyParser.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,31 @@ public static class PlaceholderPropertyParser
1111
public static readonly Parser<char, Func<PlaceholderParameter, IRuleParameter>> File =
1212
Parsers.EnumValue(PlaceholderProperty.File, true)
1313
.Then(CommonParser.Dote)
14-
.Then(Parsers.Enum<Rules.FileProperty>(true))
14+
.Then(Parser.CIEnum<Rules.FileProperty>())
1515
.Select(property => new Func<PlaceholderParameter, IRuleParameter>(placeholder =>
1616
new PlaceholderFileParameter(placeholder, property)))
1717
.Try();
1818

1919
public static readonly Parser<char, Func<PlaceholderParameter, IRuleParameter>> Column =
2020
Parsers.EnumValue(PlaceholderProperty.Column, true)
2121
.Then(CommonParser.Dote)
22-
.Then(Parsers.Enum<Rules.ColumnProperty>(true))
22+
.Then(Parser.CIEnum<Rules.ColumnProperty>())
2323
.Select(property => new Func<PlaceholderParameter, IRuleParameter>(placeholder =>
2424
new PlaceholderColumnParameter(placeholder, property)))
2525
.Try();
2626

2727
public static readonly Parser<char, Func<PlaceholderParameter, IRuleParameter>> Line =
2828
Parsers.EnumValue(PlaceholderProperty.Line, true)
2929
.Then(CommonParser.Dote)
30-
.Then(Parsers.Enum<Rules.LineProperty>(true))
30+
.Then(Parser.CIEnum<Rules.LineProperty>())
3131
.Select(property => new Func<PlaceholderParameter, IRuleParameter>(placeholder =>
3232
new PlaceholderLineParameter(placeholder, property)))
3333
.Try();
3434

3535
public static readonly Parser<char, Func<PlaceholderParameter, IRuleParameter>> Offset =
3636
Parsers.EnumValue(PlaceholderProperty.Offset, true)
3737
.Then(CommonParser.Dote)
38-
.Then(Parsers.Enum<Rules.OffsetProperty>(true))
38+
.Then(Parser.CIEnum<Rules.OffsetProperty>())
3939
.Select(property => new Func<PlaceholderParameter, IRuleParameter>(placeholder =>
4040
new PlaceholderOffsetParameter(placeholder, property)))
4141
.Try();

src/SimpleStateMachine.StructuralSearch/SimpleStateMachine.StructuralSearch.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Pidgin" Version="3.0.0" />
10+
<PackageReference Include="Pidgin" Version="3.1.0" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/SimpleStateMachine.StructuralSearch/StructuralSearch/ReplaceRuleParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static class ReplaceRuleParser
99
internal static readonly Parser<char, IRuleParameter> ChangeParameter =
1010
Parser.Map((parameter, changeType) => new ChangeParameter(parameter, changeType),
1111
ParametersParser.Parameter.Before(CommonParser.Dote),
12-
Parsers.Enum<ChangeType>(true))
12+
Parser.CIEnum<ChangeType>())
1313
.As<char, ChangeParameter, IRuleParameter>()
1414
.Try()
1515
.TrimStart();

src/SimpleStateMachine.StructuralSearch/StructuralSearch/SubFindRuleParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static class SubRuleParser
1818
.Try();
1919

2020
public static readonly Parser<char, PlaceholderType> PlaceholderType =
21-
Parsers.Enum<PlaceholderType>(true);
21+
Parser.CIEnum<PlaceholderType>();
2222

2323
public static readonly Parser<char, IRule> IsSubRule =
2424
Parser.Map((type, param) => new IsRule(type, param),

0 commit comments

Comments
 (0)