private string Dump(LeafRule.ExpandRule leafRule) { if (leafRule == null) { return(null); } return(string.Format("NonTerminal('{0} = {1}')", leafRule.Expand, leafRule.Short)); }
public void TestExpandRule() { var rule = new LeafRule.ExpandRule("short7", "expand"); Assert.AreEqual(rule.Match("short7ending").Short, "short7"); Assert.AreEqual(rule.Match("short7ending").Expand, "expand"); Assert.AreEqual(rule.Match("short7").Short, "short7"); Assert.AreEqual(rule.Match("short7short7").Short, "short7"); Assert.IsFalse(rule.Match("wr").Success); }