Skip to content

Commit 406090e

Browse files
authored
Merge pull request #559 from b3b00/chore/remove-newtonsoft
remove newtonsoft dependency and replace with System.text.Json
2 parents 0a6adc2 + 477e49e commit 406090e

File tree

5 files changed

+9
-16
lines changed

5 files changed

+9
-16
lines changed

src/samples/ParserExample/ParserExample.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@
1515
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1616
</Content>
1717
</ItemGroup>
18-
19-
20-
21-
<ItemGroup>
22-
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
23-
<!--PackageReference Include="Wasi.Sdk" Version="0.1.2-preview.10061" /-->
24-
</ItemGroup>
18+
2519

2620
<ItemGroup>
2721
<ProjectReference Include="..\..\..\tests\ParserTests\ParserTests.csproj" />

src/sly/lexer/LexerPosition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Collections.Immutable;
44
using System.Diagnostics.CodeAnalysis;
5-
using Newtonsoft.Json;
5+
using System.Text.Json.Serialization;
66

77
namespace sly.lexer
88

src/sly/lexer/Token.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
using System.Diagnostics;
44
using System.Diagnostics.CodeAnalysis;
55
using System.Globalization;
6-
using Newtonsoft.Json;
7-
using Newtonsoft.Json.Converters;
6+
using System.Text.Json.Serialization;
87

98
namespace sly.lexer
109
{
@@ -178,7 +177,7 @@ public Token<T> Previous(int channelId)
178177

179178
public int PositionInTokenFlow { get; set; }
180179

181-
[JsonConverter(typeof(StringEnumConverter))]
180+
[JsonConverter(typeof(JsonStringEnumConverter))]
182181
public T TokenID { get; set; }
183182

184183
public string Label { get; set; }
@@ -206,7 +205,7 @@ public Token<T> Previous(int channelId)
206205

207206
public bool IsExplicit { get; set; }
208207

209-
[JsonConverter(typeof(StringEnumConverter))]
208+
[JsonConverter(typeof(JsonStringEnumConverter))]
210209
public CommentType CommentType { get; set; } = CommentType.No;
211210

212211
public bool IsEmpty { get; set; }

src/sly/parser/syntax/tree/SyntaxNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Linq;
44
using System.Reflection;
55
using System.Text;
6-
using Newtonsoft.Json;
6+
using System.Text.Json.Serialization;
77
using sly.parser.generator;
88

99
namespace sly.parser.syntax.tree

src/sly/sly.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
3636
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
3737
<PrivateAssets>all</PrivateAssets>
38-
</PackageReference>
39-
<PackageReference Include="Newtonsoft.Json" Version="13.0.2"/>
38+
</PackageReference>
4039
<PackageReference Include="PolySharp" Version="1.15.0" Condition=" $(TargetFramework.StartsWith('netstandard')) OR '$(TargetFramework)' == 'net6.0'">
4140
<PrivateAssets>all</PrivateAssets>
4241
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
4342
</PackageReference>
4443
<PackageReference Include="System.Collections.Immutable" Version="6.0.0"/>
45-
<PackageReference Include="System.ValueTuple" Version="4.6.0"/>
44+
<PackageReference Include="System.ValueTuple" Version="4.6.0"/>
45+
<PackageReference Include="System.Text.Json" Version="9.0.4"/>
4646
</ItemGroup>
4747
<ItemGroup>
4848
<EmbeddedResource Include="i18n\translations\fr.txt"/>

0 commit comments

Comments
 (0)