Adjust test_old to use new Lexer injection method

This commit is contained in:
nikic 2012-04-29 23:04:06 +02:00
parent f66a672dd0
commit c3cf3f29bd

View File

@ -31,7 +31,7 @@ if ('Symfony' === $TEST_TYPE) {
require_once dirname(__FILE__) . '/../lib/PHPParser/Autoloader.php'; require_once dirname(__FILE__) . '/../lib/PHPParser/Autoloader.php';
PHPParser_Autoloader::register(); PHPParser_Autoloader::register();
$parser = new PHPParser_Parser; $parser = new PHPParser_Parser(new PHPParser_Lexer_Emulative);
$prettyPrinter = new PHPParser_PrettyPrinter_Zend; $prettyPrinter = new PHPParser_PrettyPrinter_Zend;
$nodeDumper = new PHPParser_NodeDumper; $nodeDumper = new PHPParser_NodeDumper;
@ -87,7 +87,7 @@ foreach (new RecursiveIteratorIterator(
try { try {
$startTime = microtime(true); $startTime = microtime(true);
$stmts = $parser->parse(new PHPParser_Lexer_Emulative($code)); $stmts = $parser->parse($code);
$parseTime += microtime(true) - $startTime; $parseTime += microtime(true) - $startTime;
$startTime = microtime(true); $startTime = microtime(true);
@ -96,7 +96,7 @@ foreach (new RecursiveIteratorIterator(
try { try {
$startTime = microtime(true); $startTime = microtime(true);
$ppStmts = $parser->parse(new PHPParser_Lexer_Emulative($code)); $ppStmts = $parser->parse($code);
$reparseTime += microtime(true) - $startTime; $reparseTime += microtime(true) - $startTime;
$startTime = microtime(true); $startTime = microtime(true);