Documentations › mmo.admin › php › helpers JsLexer MMO\admin\helpers · 1 symbol · generated 30 Nov 2026
A small javascript lexer: the strings of a script (template literals included), what call each is an argument of, and the code just before it. The comments and the regular expressions are skipped.
final class MMO\admin\helpers\JsLexer Namespace MMO\admin\helpersProperties6 protected array $calls = [] Type array protected string $code = '' Type string protected int $i = 0 Type int protected ?int $limit Type null | int protected string $src Type string protected array $strings = [] Type array Methods9 protected function code(bool $untilBrace): void protected function escape(): string returns string the character an escape sequence stands for (the lexer is on its \)
function lex(int $start, bool $untilBrace = false): array $start int where to start $untilBrace = false bool stop at the } closing the block (an expression {= … }, an object) returns array list<array<string, mixed>>, end: int} the strings, and the offset after the end
protected function push(string $c): void protected function regex(): void protected function regexAllowed(): bool protected function string(string $quote): void protected function template(): void function __construct(string $src, ?int $limit = null)