function Lexer::showPosition
Return value
string
2 calls to Lexer::showPosition()
- Lexer::lex in vendor/
seld/ jsonlint/ src/ Seld/ JsonLint/ Lexer.php - Lexer::next in vendor/
seld/ jsonlint/ src/ Seld/ JsonLint/ Lexer.php
File
-
vendor/
seld/ jsonlint/ src/ Seld/ JsonLint/ Lexer.php, line 141
Class
- Lexer
- Lexer class
Namespace
Seld\JsonLintCode
public function showPosition() {
if ($this->yylineno === 0 && $this->offset === 1 && $this->match !== '{') {
return $this->match . '...' . "\n^";
}
$pre = str_replace("\n", '', $this->getPastInput());
$c = str_repeat('-', max(0, \strlen($pre) - 1));
// new Array(pre.length + 1).join("-");
return $pre . str_replace("\n", '', $this->getUpcomingInput()) . "\n" . $c . "^";
}