Skip to content

Commit

Permalink
Address suggested code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-jesner-AP committed Oct 20, 2024
1 parent c237632 commit c2f7d2a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/GraphQLParser/Exceptions/GraphQLParserException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ namespace GraphQLParser.Exceptions;
/// </summary>
public class GraphQLParserException : Exception
{
private static readonly char[] NewlineSeparator = ['\n'];
#if NETSTANDARD2_0
private static readonly char[] _newlineSeparator = ['\n'];
#endif

/// <summary>
/// Error description.
Expand Down Expand Up @@ -51,7 +53,11 @@ private static string HighlightSourceAtLocation(ReadOnlySpan<char> source, Locat
int padLen = nextLineNum.Length;
string[] lines = source
.ToString()
.Split(NewlineSeparator, StringSplitOptions.None)
#if NETSTANDARD2_0
.Split(_newlineSeparator, StringSplitOptions.None)
#else
.Split('\n', StringSplitOptions.None)
#endif
.Select(e => ReplaceWithUnicodeRepresentation(e))
.ToArray();

Expand Down

0 comments on commit c2f7d2a

Please sign in to comment.