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\SyntaxCode
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;
}