From 8f54415ae0581dcce480ef871f713200b9857e52 Mon Sep 17 00:00:00 2001 From: Sinai <49360850+sinai-dev@users.noreply.github.com> Date: Sun, 24 Apr 2022 19:23:05 +1000 Subject: [PATCH] Remove small logic error with SymbolLexer --- src/CSConsole/LexerBuilder.cs | 4 ---- src/CSConsole/Lexers/SymbolLexer.cs | 8 +------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/CSConsole/LexerBuilder.cs b/src/CSConsole/LexerBuilder.cs index 2d8db1e..af50e98 100644 --- a/src/CSConsole/LexerBuilder.cs +++ b/src/CSConsole/LexerBuilder.cs @@ -17,8 +17,6 @@ namespace UnityExplorer.CSConsole public class LexerBuilder { - #region Core and initialization - public const char WHITESPACE = ' '; public readonly HashSet IndentOpenChars = new() { '{', '(' }; public readonly HashSet IndentCloseChars = new() { '}', ')' }; @@ -50,8 +48,6 @@ namespace UnityExplorer.CSConsole } } - #endregion - /// The last committed index for a match or no-match. Starts at -1 for a new parse. public int CommittedIndex { get; private set; } /// The index of the character we are currently parsing, at minimum it will be CommittedIndex + 1. diff --git a/src/CSConsole/Lexers/SymbolLexer.cs b/src/CSConsole/Lexers/SymbolLexer.cs index 6c6cf93..cd1b6b0 100644 --- a/src/CSConsole/Lexers/SymbolLexer.cs +++ b/src/CSConsole/Lexers/SymbolLexer.cs @@ -32,13 +32,7 @@ namespace UnityExplorer.CSConsole.Lexers if (IsSymbol(lexer.Current)) { - do - { - lexer.Commit(); - lexer.PeekNext(); - } - while (IsSymbol(lexer.Current)); - + lexer.Commit(); return true; }