<?php include_once dirname(__FILE__) . '/../../t.php'; $t = new lime_test(); $p = HatenaSyntax_Locator::it()->bracket; $c = PEG::context('[http://google.com:title=hoge]'); $t->ok($p->parse($c));
/** * 文字列をパースしてHatenaSyntax_Nodeインスタンスからなる構文木を返す。 * * @param string * @return HatenaSyntax_Node */ static function parse($str) { return HatenaSyntax_Locator::it()->parser->parse(self::context($str)); }
<?php include_once dirname(__FILE__) . '/../../t.php'; $t = new lime_test(); $p = HatenaSyntax_Locator::it()->lineElement; $c = PEG::context('a'); $t->is($p->parse($c), 'a');