mirror of https://github.com/vitalif/lime
Return false from eat() on error and true on success
parent
8a53d5672c
commit
a5afc90b9b
|
@ -343,6 +343,7 @@ class parse_engine {
|
|||
if ($this->has_step_for($type)) {
|
||||
$this->eat($type, $semantic);
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
// If that didn't work, give up:
|
||||
throw new parse_error('Parse Error: ' . $this->descr($type, $semantic) . ' not expected, expected one of ' . implode(', ', $expected));
|
||||
|
@ -351,6 +352,7 @@ class parse_engine {
|
|||
default:
|
||||
throw new parse_bug("Bad parse table instruction " . htmlspecialchars($opcode));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private function descr($type, $semantic) {
|
||||
|
|
Loading…
Reference in New Issue