Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 8f54415

Browse files
committed
Remove small logic error with SymbolLexer
1 parent aef4e11 commit 8f54415

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

src/CSConsole/LexerBuilder.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ public struct MatchInfo
1717

1818
public class LexerBuilder
1919
{
20-
#region Core and initialization
21-
2220
public const char WHITESPACE = ' ';
2321
public readonly HashSet<char> IndentOpenChars = new() { '{', '(' };
2422
public readonly HashSet<char> IndentCloseChars = new() { '}', ')' };
@@ -50,8 +48,6 @@ public LexerBuilder()
5048
}
5149
}
5250

53-
#endregion
54-
5551
/// <summary>The last committed index for a match or no-match. Starts at -1 for a new parse.</summary>
5652
public int CommittedIndex { get; private set; }
5753
/// <summary>The index of the character we are currently parsing, at minimum it will be CommittedIndex + 1.</summary>

src/CSConsole/Lexers/SymbolLexer.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,7 @@ public override bool TryMatchCurrent(LexerBuilder lexer)
3232

3333
if (IsSymbol(lexer.Current))
3434
{
35-
do
36-
{
37-
lexer.Commit();
38-
lexer.PeekNext();
39-
}
40-
while (IsSymbol(lexer.Current));
41-
35+
lexer.Commit();
4236
return true;
4337
}
4438

0 commit comments

Comments
 (0)