public void shouldReturnTagsWithTexts() { loadInParser("assignment.jade"); block = (BlockNode) root; LinkedList<Node> nodes = block.getNodes(); Assert.AreEqual(2, nodes.Count); AssigmentNode assignment = (AssigmentNode)block.getNodes().ElementAt(0); Assert.AreEqual("hello", assignment.getName()); Assert.AreEqual("\"world\"", assignment.getValue()); TagNode tag = (TagNode) block.getNodes().ElementAt(1); Assert.IsNotNull(tag); }
private Node blockExpansion() { if (peek() is Colon) { Token token = expect(typeof (Colon)) ; Colon colon = (Colon) token; BlockNode blockNode = new BlockNode(); blockNode.setLineNumber(colon.getLineNumber()); blockNode.setFileName(filename); blockNode.getNodes().AddLast(parseExpr()); return blockNode; } return block(); }