using System.Collections.Generic; using System.Linq; namespace DOM.DSL.Tokens { public class TBlockToken : TToken { public string Name { get; } public TToken Condition { get; } public IEnumerable Body { get; } public TBlockToken(string name, TToken condition, IEnumerable body) { Name = name; Condition = condition?.Clone(); Body = body.Select(b => b.Clone()).ToArray(); } public TBlockToken(IEnumerable body) { Name = string.Empty; Condition = null; Body = body.Select(b => b.Clone()).ToArray(); } public override TToken Clone() { return new TBlockToken(this.Name, this.Condition?.Clone(), this.Body?.Select(b => b.Clone()).ToArray()); } public override TToken CloneLocal() { return Clone(); } } }