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

Breadcrumb

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

function Scanner::scanJSXIdentifier

Identifier scanning method in jsx mode

Return value

Token|null

File

vendor/mck89/peast/lib/Peast/Syntax/JSX/Scanner.php, line 104

Class

Scanner
JSX scanner trait

Namespace

Peast\Syntax\JSX

Code

public function scanJSXIdentifier() {
    $buffer = "";
    $char = $this->charAt();
    if ($char !== null && $this->isIdentifierChar($char)) {
        do {
            $buffer .= $char;
            $this->index++;
            $this->column++;
            $char = $this->charAt();
        } while ($char !== null && ($this->isIdentifierChar($char, false) || $char === "-"));
    }
    return $buffer === "" ? null : new Token(Token::TYPE_JSX_IDENTIFIER, $buffer);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal