public function getLisphpLine() { if ($this->offset <= 0) { return 1; } return substr_count($this->code, "\n", 0, $this->offset) + 1; }
function Lisphp_printParsingError(Lisphp_ParsingException $e) { echo $e->getMessage(), "\n"; $lines = explode("\n", $e->code); echo $lines[$e->getLisphpLine() - 1], "\n"; echo str_repeat(' ', $e->getLisphpColumn() - 1), "^\n"; }