public override void doRow(Parse row) { hasExecuted = false; try { reset(); base.doRow(row); if (!hasExecuted) { execute(); } } catch (Exception e) { exception(row.leaf(), e); } }
public override void doRows(Parse rows) { try { bind(rows.parts); results = query(); match(list(rows.more), list(results), 0); Parse last = rows.last(); last.more = buildRows(surplus.ToArray()); mark(last.more, "surplus"); mark(missing, "missing"); } catch (Exception e) { exception(rows.leaf(), e); } }
public override void doRows(Parse rows) { try { bind(rows.parts); results = query(); match(list(rows.more), list(results), 0); Parse last = rows.last(); last.more = buildRows(surplus.ToArray()); mark(last.more, "surplus"); mark(missing, "missing"); } catch (Exception e) { exception (rows.leaf(), e); } }
public void testIndexing() { Parse p = new Parse("leader<table><tr><td>one</td><td>two</td><td>three</td></tr><tr><td>four</td></tr></table>trailer"); Assert.AreEqual("one", p.at(0,0,0).body); Assert.AreEqual("two", p.at(0,0,1).body); Assert.AreEqual("three", p.at(0,0,2).body); Assert.AreEqual("three", p.at(0,0,3).body); Assert.AreEqual("three", p.at(0,0,4).body); Assert.AreEqual("four", p.at(0,1,0).body); Assert.AreEqual("four", p.at(0,1,1).body); Assert.AreEqual("four", p.at(0,2,0).body); Assert.AreEqual(1, p.size()); Assert.AreEqual(2, p.parts.size()); Assert.AreEqual(3, p.parts.parts.size()); Assert.AreEqual("one", p.leaf().body); Assert.AreEqual("four", p.parts.last().leaf().body); }
public void testIndexing() { Parse p = new Parse("leader<table><tr><td>one</td><td>two</td><td>three</td></tr><tr><td>four</td></tr></table>trailer"); Assert.AreEqual("one", p.at(0, 0, 0).body); Assert.AreEqual("two", p.at(0, 0, 1).body); Assert.AreEqual("three", p.at(0, 0, 2).body); Assert.AreEqual("three", p.at(0, 0, 3).body); Assert.AreEqual("three", p.at(0, 0, 4).body); Assert.AreEqual("four", p.at(0, 1, 0).body); Assert.AreEqual("four", p.at(0, 1, 1).body); Assert.AreEqual("four", p.at(0, 2, 0).body); Assert.AreEqual(1, p.size()); Assert.AreEqual(2, p.parts.size()); Assert.AreEqual(3, p.parts.parts.size()); Assert.AreEqual("one", p.leaf().body); Assert.AreEqual("four", p.parts.last().leaf().body); }
public virtual Parse leaf() { return(parts == null ? this : parts.leaf()); }