21 lines
476 B
C#
21 lines
476 B
C#
namespace Qrakhen.Qamp.Core.Tokenization;
|
|
|
|
public class Tokens : IDebug<string>
|
|
{
|
|
private readonly List<Token> _tokens = new();
|
|
|
|
public Token[] GetTokens() => _tokens.ToArray();
|
|
|
|
public void Feed(Token token) => _tokens.Add(token);
|
|
|
|
public string Debug(DebugLevel level = DebugLevel.None)
|
|
{
|
|
string str = Debugger.GetContextString(this);
|
|
foreach (var token in _tokens)
|
|
{
|
|
str += $"\n {token}";
|
|
}
|
|
return str;
|
|
}
|
|
}
|