Merge branch 'master' into ns

master
Richard van Velzen 2011-12-31 11:32:27 +01:00
commit 1b7c30f7b8
2 changed files with 14 additions and 1 deletions

View File

@ -1348,6 +1348,9 @@ if ($_SERVER['argv']) {
}
array_shift($_SERVER['argv']); // Strip out the program name.
$timer = microtime(true);
foreach ($_SERVER['argv'] as $path) {
$code .= parse_lime_grammar($path);
}
@ -1370,4 +1373,8 @@ if ($_SERVER['argv']) {
*/
{$code}
CODE;
echo PHP_EOL
. '// Time: ' . (microtime(true) - $timer) . ' seconds' . PHP_EOL
. '// Memory: ' . memory_get_peak_usage() . ' bytes' . PHP_EOL;
}

View File

@ -42,7 +42,7 @@ class parse_unexpected_token extends parse_error {
class parse_premature_eof extends parse_error {
public function __construct(array $expect) {
parent::__construct('Premature EOF, expected {' . implode(', ', $expect) . '}');
parent::__construct('Premature EOF');
}
}
@ -267,6 +267,12 @@ class parse_engine {
private function get_steps() {
$out = array();
foreach($this->current_row() as $type => $row) {
foreach($this->rule as $rule) {
if ($rule['symbol'] == $type) {
continue 2;
}
}
list($opcode) = explode(' ', $row, 2);
if ($opcode != 'e') {
$out[] = $type;