using System.Collections.Generic; using UnityExplorer.Unstrip; using UnityEngine; using System.Linq; namespace UnityExplorer.CSConsole.Lexer { public abstract class Matcher { public abstract Color HighlightColor { get; } public string HexColor => htmlColor ?? (htmlColor = ""); private string htmlColor; public virtual IEnumerable StartChars => Enumerable.Empty(); public virtual IEnumerable EndChars => Enumerable.Empty(); public abstract bool IsImplicitMatch(CSharpLexer lexer); public bool IsMatch(CSharpLexer lexer) { if (IsImplicitMatch(lexer)) { lexer.Commit(); return true; } lexer.Rollback(); return false; } } }