A small token value type used by the Superuser effects script parser. Stores the token kind, its source text and its start offset and length, with helpers for the end offset and for matching a keyword or operator string.
namespace SboxSuperuser.Core.Effects;
/// <summary>One piece of script text: what it is, its exact text and where it sits in the source.</summary>
internal readonly record struct EffectToken( EffectTokenKind Kind, string Text, int Start, int Length )
{
internal int End => Start + Length;
internal bool Is( string text ) => Kind is EffectTokenKind.Operator or EffectTokenKind.Keyword && Text == text;
}