예제 #1
0
파일: NodeTest.php 프로젝트: mozzymoz/awl
 public function testCanNest()
 {
     $nodeBuilder = new Node();
     $nodeBuilder->add('mockfqn', true);
     $nodeBuilder->start()->add('submockfqn', true)->end();
     $rootNode = $nodeBuilder->retrieve();
     $addedNode = $rootNode->getChildAt(0)->getChildAt(0);
     $this->assertInstanceOf(\Awl\Compiler\Node::class, $addedNode);
     $this->assertEquals('submockfqn', $addedNode->getName());
     $this->assertTrue($addedNode->getContents());
 }
예제 #2
0
파일: Compiler.php 프로젝트: mozzymoz/awl
 /**
  * @param $awl
  *
  * @return Node
  */
 public function buildTree($awl)
 {
     $nodes = (new Parser())->parse((new Converter())->convert($awl, $this->getDefinitions()));
     return NodeBuilder::buildTreeFromAwl($nodes);
 }