private static IEnumerable<Node> ParseChances(Node parentNode, string text) { string[] chances = chanceRx.Split(text); if(chances.Length < 2) return ParseTries(parentNode, text); ChanceNode chanceNode = new ChanceNode(parentNode, new Atts("Type", "Even")); foreach(string cur in chances) { CaseNode caseNode = new CaseNode(chanceNode, null); chanceNode.AddChild(caseNode); caseNode.AddChildren(ParseSingle(caseNode, cur)); } return Enumerations.One<Node>(chanceNode); }
public ChanceContext(NodeContext parent, ChanceNode node) : base(parent, node) { }