Project refactor, namespace cleanup, splitting UI/functionality.

This commit is contained in:
Sinai
2021-03-18 17:17:29 +11:00
parent 1c0011bef9
commit 25e48f2f37
99 changed files with 3387 additions and 3096 deletions

View File

@ -0,0 +1,32 @@
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using UnityExplorer.Core.Unity;
namespace UnityExplorer.UI.CSConsole.Lexer
{
public abstract class Matcher
{
public abstract Color HighlightColor { get; }
public string HexColor => htmlColor ?? (htmlColor = "<color=#" + HighlightColor.ToHex() + ">");
private string htmlColor;
public virtual IEnumerable<char> StartChars => Enumerable.Empty<char>();
public virtual IEnumerable<char> EndChars => Enumerable.Empty<char>();
public abstract bool IsImplicitMatch(CSLexerHighlighter lexer);
public bool IsMatch(CSLexerHighlighter lexer)
{
if (IsImplicitMatch(lexer))
{
lexer.Commit();
return true;
}
lexer.Rollback();
return false;
}
}
}