Error messages can be more concise

master
Richard van Velzen 2011-12-31 11:28:48 +01:00
parent 793d2a4d85
commit ef16fd5d09
1 changed files with 7 additions and 1 deletions

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;