示例#1
0
文件: List.php 项目: ngyuki/PHPPEG
<?php

include_once dirname(__FILE__) . '/t/t.php';
$lime = new lime_test();
$list = PEG::listof(PEG::digit(), ',');
$context = PEG::context('1,2,3,4');
$lime->is($list->parse($context), array('1', '2', '3', '4'));
示例#2
0
文件: ListOf.php 项目: ngyuki/PHPPEG
<?php

include_once dirname(__FILE__) . '/t/t.php';
$t = new lime_test();
$parser = PEG::listof(PEG::char('abc'), PEG::token(','));
$context = PEG::context('a,b,c');
$t->is($parser->parse($context), array('a', 'b', 'c'));
$t->ok($context->eos());