NumericLiteralSeparatorEmulator
extends TokenEmulator
Table of Contents
-
BIN
= '(?:0b[01]+(?:_[01]+)*)'
-
DEC
= '(?:[0-9]+(?:_[0-9]+)*)'
-
EXP
= '(?:e[+-]?' . self::DEC . ')'
-
FLOAT
= '(?:' . self::SIMPLE_FLOAT . self::EXP . '?|' . self::DEC . self::EXP . ')'
-
HEX
= '(?:0x[0-9a-f]+(?:_[0-9a-f]+)*)'
-
NUMBER
= '~' . self::FLOAT . '|' . self::BIN . '|' . self::HEX . '|' . self::DEC . '~iA'
-
SIMPLE_FLOAT
= '(?:' . self::DEC . '\.' . self::DEC . '?|\.' . self::DEC . ')'
-
emulate()
: array<string|int, mixed>
-
getPhpVersion()
: string
-
isEmulationNeeded()
: bool
-
reverseEmulate()
: array<string|int, mixed>
-
resolveIntegerOrFloatToken()
: int
BIN
public
mixed
BIN
= '(?:0b[01]+(?:_[01]+)*)'
DEC
public
mixed
DEC
= '(?:[0-9]+(?:_[0-9]+)*)'
EXP
public
mixed
EXP
= '(?:e[+-]?' . self::DEC . ')'
FLOAT
public
mixed
FLOAT
= '(?:' . self::SIMPLE_FLOAT . self::EXP . '?|' . self::DEC . self::EXP . ')'
HEX
public
mixed
HEX
= '(?:0x[0-9a-f]+(?:_[0-9a-f]+)*)'
NUMBER
public
mixed
NUMBER
= '~' . self::FLOAT . '|' . self::BIN . '|' . self::HEX . '|' . self::DEC . '~iA'
SIMPLE_FLOAT
public
mixed
SIMPLE_FLOAT
= '(?:' . self::DEC . '\.' . self::DEC . '?|\.' . self::DEC . ')'
emulate()
public
emulate(string $code, array<string|int, mixed> $tokens) : array<string|int, mixed>
Parameters
-
$code
: string
-
-
$tokens
: array<string|int, mixed>
-
Return values
array<string|int, mixed>
—
getPhpVersion()
public
getPhpVersion() : string
Return values
string
—
isEmulationNeeded()
public
isEmulationNeeded(string $code) : bool
Parameters
-
$code
: string
-
Return values
bool
—
reverseEmulate()
public
reverseEmulate(string $code, array<string|int, mixed> $tokens) : array<string|int, mixed>
Parameters
-
$code
: string
-
-
$tokens
: array<string|int, mixed>
-
Return values
array<string|int, mixed>
—
resolveIntegerOrFloatToken()
private
resolveIntegerOrFloatToken(string $str) : int
Parameters
-
$str
: string
-
Return values
int
—