/** * Parse the given input * * @param Input $input * * @return mixed result */ public function parse(Input $input) { if ($input->peek(0) === $this->char) { $input->consume(1); return $input->matchHere($this->char); } return $input->errorHere("{$this->char} was not found.")->addParser($this); }
public function consume($bytes) { $this->log(Parser::getInlineParserStack() . " - consume({$bytes}, '{$this->get($bytes)}')"); $this->getParserData()['consumed'] += $bytes; parent::consume($bytes); }