private function error($message = "Unexpected '%s'") { list(, $line, $col) = self::$tokenizer->getOffset($this->n); $token = isset(self::$tokenizer->tokens[$this->n]) ? str_replace("\n", '<new line>', Nette\String::truncate(self::$tokenizer->tokens[$this->n], 40)) : 'end'; throw new NeonException(str_replace('%s', $token, $message) . " on line $line, column $col."); }
private function error($message = "Unexpected '%s'") { list(, $line, $col) = self::$tokenizer->getOffset($this->n); $token = str_replace("\n", '\\n', Nette\String::truncate(self::$tokenizer->tokens[$this->n], 40)); throw new NeonException(str_replace('%s', $token, $message) . "' on line " . ($line - 1) . ", column {$col}."); }
private function error() { list(, $line, $col) = self::$tokenizer->getOffset($this->n); throw new NeonException("Unexpected '" . str_replace("\n", '\n', substr(self::$tokenizer->tokens[$this->n], 0, 10)) . "' on line " . ($line - 1) . ", column $col."); }