Functions
get_lexer
1
StateMachineLexer
▼
Get a lexer instance by name or alias.
All lexers are hand-written state machi…
get_lexer
1
StateMachineLexer
▼
def get_lexer(name: str) -> StateMachineLexer
Get a lexer instance by name or alias.
All lexers are hand-written state machines with O(n) guaranteed performance and zero ReDoS vulnerability.
Uses functools.cache for thread-safe memoization. Lexers are loaded lazily on first access.
Parameters
| Name | Type | Description |
|---|---|---|
name |
str |
Language name or alias (e.g., 'python', 'py', 'js'). |
Returns
StateMachineLexer
list_languages
0
list[str]
▼
List all supported language names. O(1).
list_languages
0
list[str]
▼
def list_languages() -> list[str]
Returns
list[str]
supports_language
1
bool
▼
Check if a language is supported.
supports_language
1
bool
▼
def supports_language(name: str) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
name |
str |
Language name or alias. |
Returns
bool