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

Breadcrumb

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

function Scanner::consumeExponentPart

Consumes the exponent part of a number

Return value

string|null

1 call to Scanner::consumeExponentPart()
Scanner::scanNumber in vendor/mck89/peast/lib/Peast/Syntax/Scanner.php
Number scanning method

File

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

Class

Scanner
Base class for scanners.

Namespace

Peast\Syntax

Code

protected function consumeExponentPart() {
    $buffer = "";
    $char = $this->charAt();
    if ($char !== null && strtolower($char) === "e") {
        $this->index++;
        $this->column++;
        $buffer .= $char;
        $char = $this->charAt();
        if ($char === "+" || $char === "-") {
            $this->index++;
            $this->column++;
            $buffer .= $char;
        }
        $tempBuffer = $this->consumeNumbers();
        if ($tempBuffer === null) {
            $this->error("Missing exponent");
        }
        $buffer .= $tempBuffer;
    }
    return $buffer;
}

API Navigation

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