예제 #1
0
        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);
        }
예제 #2
0
파일: JadeParser.cs 프로젝트: rnrn/Jade4Net
 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();
 }