Skip to content

Commit

Permalink
Fix another parsing issue when serialised object keys/values are unqu…
Browse files Browse the repository at this point in the history
…oted and contain numbers

Fixes #41 (again)
  • Loading branch information
LogicAndTrick committed Jan 21, 2025
1 parent 3ec496e commit 89a1573
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Sledge.Formats.Tests/Valve/TestSerialisedObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ A B
"G" "H"
$I { }
"$J" { }
1 2
3 4
}
""";

Expand All @@ -250,5 +252,7 @@ A B
Assert.AreEqual(0, output[0].Children[0].Children.Count);
Assert.AreEqual("$J", output[0].Children[1].Name);
Assert.AreEqual(0, output[0].Children[1].Children.Count);
Assert.AreEqual("2", output[0].Get<string>("1"));
Assert.AreEqual("4", output[0].Get<string>("3"));
}
}
4 changes: 2 additions & 2 deletions Sledge.Formats/Sledge.Formats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<RepositoryUrl>https://github.com/LogicAndTrick/sledge-formats</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>half-life quake valve liblist vdf</PackageTags>
<PackageReleaseNotes>Fix parsing issues when serialised object keys/values are unquoted and contain special characters</PackageReleaseNotes>
<PackageReleaseNotes>Fix another parsing issue when serialised object keys/values are unquoted and contain numbers</PackageReleaseNotes>
<PackageLicenseFile></PackageLicenseFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Version>1.3.1</Version>
<Version>1.3.2</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
1 change: 0 additions & 1 deletion Sledge.Formats/Valve/SerialisedObjectFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ static SerialisedObjectFormatter()
Tokeniser = new Tokeniser(
new SingleLineCommentTokenReader(),
new StringTokenReader(),
new UnsignedIntegerTokenReader(),
new SymbolTokenReader(Symbols),
new NameTokenReader(IsValidNameCharacter, IsValidNameCharacter)
);
Expand Down

0 comments on commit 89a1573

Please sign in to comment.