Skip to content

Commit

Permalink
Readonly struct
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros committed Dec 23, 2021
1 parent 44583f8 commit 857636d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Parlot/IsExternalInit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace System.Runtime.CompilerServices;

// c.f. https://stackoverflow.com/questions/64749385/predefined-type-system-runtime-compilerservices-isexternalinit-is-not-defined
internal static class IsExternalInit { }
1 change: 0 additions & 1 deletion src/Parlot/Parlot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.4" Condition="'$(TargetFramework)' == 'netstandard2.0' " />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
<PackageReference Include="System.Memory" Version="4.5.4" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' ">
Expand Down
2 changes: 1 addition & 1 deletion src/Parlot/Scanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Scanner
public readonly string Buffer;
public readonly Cursor Cursor;

private record struct WhiteSpaceMarker(int Offset, bool IsNotWhiteSpace, bool IsNotWhiteSpaceOrNewLine);
private readonly record struct WhiteSpaceMarker(int Offset, bool IsNotWhiteSpace, bool IsNotWhiteSpaceOrNewLine);

// Caches the latest whitespace check. Remember that the current position is not a whitespace.
private WhiteSpaceMarker _whiteSpaceMarker = new (-1, false, false);
Expand Down

0 comments on commit 857636d

Please sign in to comment.