public function throwParseError($msg = 'parse error')
{
list($line, ) = $this->getSourcePosition($this->count);
$loc = empty($this->sourceName) ? "line: {$line}" : "{$this->sourceName} on line {$line}";
if ($this->peek("(.*?)(\n|\$)", $m, $this->count)) {
throw new ParserException("{$msg}: failed at `{$m['1']}` {$loc}");
}
throw new ParserException("{$msg}: {$loc}");
}