public Rule Abbreviation() { Var<AbbreviationNode> node = new Var<AbbreviationNode>(); return NodeSequence( NonindentSpace(), '*', Label(), push(node.setAndGet(new AbbreviationNode(popAsNode()))), Sp(), ':', Sp(), AbbreviationText(node), abbreviations.add(node.get()) ); }
public Rule ReferenceNoEOL() { Var<ReferenceNode> ref = new Var<ReferenceNode>(); return NodeSequence( NonindentSpace(), Label(), push(ref.setAndGet(new ReferenceNode(popAsNode()))), ':', Spn1(), RefSrc(ref), Sp(), Optional(RefTitle(ref)), Sp(), // make range not include the EOL Test(Newline()), references.add(ref.get()) ); }
public Rule Table() { Var<TableNode> node = new Var<TableNode>(); return NodeSequence( push(node.setAndGet(new TableNode())), Optional( NodeSequence( TableRow(), push(1, new TableHeaderNode()) && addAsChild(), ZeroOrMore(TableRow(), addAsChild()) ), addAsChild() // add the TableHeaderNode to the TableNode ), TableDivider(node), Optional( NodeSequence( TableRow(), push(1, new TableBodyNode()) && addAsChild(), ZeroOrMore(TableRow(), addAsChild()) ), addAsChild() // add the TableHeaderNode to the TableNode ), // only accept as table if we have at least one header or at least one body Optional(TableCaption(), addAsChild()), !node.get().getChildren().isEmpty() ); }
), tight.get() ? push(tightFirstItem.setAndGet(itemNodeCreator.create(parseListBlock(block)))) : fixFirstItem((SuperNode) peek(1)) && push(itemNodeCreator.create(parseListBlock(block.appended('\n')))),
), tight.get() ? push(tightFirstItem.setAndGet(itemNodeCreator.create(parseListBlock(block), taskType.get(), taskListMarker.getString()))) && taskListMarker.clearContents() : fixFirstItem((SuperNode) peek(1)) && push(itemNodeCreator.create(parseListBlock(block.appended('\n')), taskType.get(), taskListMarker.getString())) && taskListMarker.clearContents(),