Skip to content

Commit

Permalink
Update valid characters for alternative name
Browse files Browse the repository at this point in the history
Fix #51.
  • Loading branch information
k94ll13nn3 committed May 12, 2018
1 parent 1903308 commit ad7e129
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Strinken/Core/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Strinken.Core
/// </summary>
internal static class Extensions
{
private static readonly List<char> ValidAlternativeNameCharacter = new List<char> { '*', '$', '?', '!', '&', '.', '#', '%' };
private static readonly List<char> ValidAlternativeNameCharacter = new List<char>("!%&*+./<=>@^|~?$#".ToCharArray());

/// <summary>
/// Tests if a <see cref="char"/> is an invalid token name character i.e. not a-z, A-Z, 0-9, - or _.
Expand All @@ -18,7 +18,7 @@ internal static class Extensions
public static bool IsInvalidTokenNameCharacter(this char c) => !char.IsLetter(c) && c != '-' && c != '_';

/// <summary>
/// Tests if a <see cref="char"/> is an invalid alternative name character i.e. not *, $, ?, !, &amp; or ..
/// Tests if a <see cref="char"/> is an invalid alternative name character i.e. not in "!%&amp;*+./&lt;=&gt;@^|~?$#".
/// </summary>
/// <param name="c">The <see cref="char"/> to test.</param>
/// <returns>A value indicating whether the <see cref="char"/> is an invalid alternative name character</returns>
Expand Down
2 changes: 1 addition & 1 deletion src/Strinken/Core/ParsingMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal enum ParsingMethod
Name,

/// <summary>
/// Parse string as a name (letter + '-' + '_') or as a symbol (*, $, ?, !, &amp; or .).
/// Parse string as a name (letter + '-' + '_') or as a symbol (!%&amp;*+./&lt;=&gt;@^|~?$#).
/// </summary>
NameOrSymbol,

Expand Down
2 changes: 1 addition & 1 deletion test/Strinken.Tests/EngineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public void Run_ValidCharacterInString_DoesNotThrow(string input)
[InlineData("{ipsum:filt*er}", '*', 11)]
[InlineData("{ipsum:fi!}", '!', 9)]
[InlineData("{ipsum:?f}", 'f', 8)]
[InlineData("{ipsum:!!^}", '^', 9)]
[InlineData("{ipsum:!!-}", '-', 9)]
public void Run_InvalidCharacterInFilterName_ReturnsFalse(string input, char illegalChar, int position)
{
EngineResult result = StrinkenEngine.Run(input);
Expand Down

0 comments on commit ad7e129

Please sign in to comment.