Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Lexer.php

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\JsonLint

Code

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 . "^";
}
RSS feed
Powered by Drupal