MMOframework
Why AI Playground Libraries Developers Agency
FR EN
Build a project live
Index

JsLexer

MMO\admin\helpers · 1 symbol · generated 30 Nov 2026

class

JsLexer

I18nAudit.php:654

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\helpers

Properties6

calls

protected array $calls = []
Type
array

code

protected string $code = ''
Type
string

i

protected int $i = 0
Type
int

limit

protected ?int $limit
Type
null | int

src

protected string $src
Type
string

strings

protected array $strings = []
Type
array

Methods9

escape()

I18nAudit.php:762
protected function escape(): string
returnsstringthe character an escape sequence stands for (the lexer is on its \)

lex($start, $untilBrace)

I18nAudit.php:672
function lex(int $start, bool $untilBrace = false): array
$startintwhere to start
$untilBrace = falseboolstop at the } closing the block (an expression {= … }, an object)
returnsarraylist<array<string, mixed>>, end: int} the strings, and the offset after the end