2021-05-10 15:58:49 +10:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2021-06-05 19:36:09 +10:00
|
|
|
|
using UnityEngine;
|
2021-05-10 15:58:49 +10:00
|
|
|
|
|
2021-05-12 20:48:56 +10:00
|
|
|
|
namespace UnityExplorer.UI.CSConsole.Lexers
|
2021-05-10 15:58:49 +10:00
|
|
|
|
{
|
|
|
|
|
public abstract class Lexer
|
|
|
|
|
{
|
|
|
|
|
public virtual IEnumerable<char> Delimiters => Enumerable.Empty<char>();
|
|
|
|
|
|
|
|
|
|
protected abstract Color HighlightColor { get; }
|
|
|
|
|
|
|
|
|
|
public string ColorTag => colorTag ?? (colorTag = "<color=#" + HighlightColor.ToHex() + ">");
|
|
|
|
|
private string colorTag;
|
|
|
|
|
|
|
|
|
|
public abstract bool TryMatchCurrent(LexerBuilder lexer);
|
|
|
|
|
}
|
|
|
|
|
}
|