Example #1
0
	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.");
	}
Example #2
0
 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}.");
 }
Example #3
0
	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.");
	}