Automattic\WooCommerce\Vendor\GraphQL\Language

Lexer::readCommentprivateWC 1.0

Reads a comment token from the source file.

[\u0009\u0020-\uFFFF]*

Method of the class: Lexer{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->readComment( $line, $col, $prev ): Token;
$line(int) (required)
.
$col(int) (required)
.
$prev(Token) (required)
.

Lexer::readComment() code WC 10.9.1

private function readComment(int $line, int $col, Token $prev): Token
{
    $start = $this->position;
    $value = '';
    $bytes = 1;

    do {
        [$char, $code, $bytes] = $this->moveStringCursor(1, $bytes)->readChar();
        $value .= $char;
    } while (
        $code !== null
        // SourceCharacter but not LineTerminator
        && ($code > 0x001F || $code === 0x0009)
    );

    return new Token(
        Token::COMMENT,
        $start,
        $this->position,
        $line,
        $col,
        $prev,
        $value
    );
}