@lanexio/parser-pure
This page documents @lanexio/parser-pure, the pure TypeScript fallback backend package. This is a private package (not published to npm independently) that serves as the universal pure-TS bridge for grammar packages.
- Version: Internal
- Module name:
parser-pure - Package:
@lanexio/parser-pure(private) - Import path:
@lanexio/parser-pure - Layer: 4 (Bridge)
- Runtime: Universal
- Module format: ESM
- Stability: Internal (private package, not for direct public use)
- Primary use case: Pure TypeScript bridge adapter over grammar parsing functions.
Layer contract
Section titled “Layer contract”When to use this module
Section titled “When to use this module”- You need a pure TypeScript parser bridge that does not require WASM.
- You are building on top of Lanexio Parser and need a unified
PureParserinterface. - You are evaluating the internal architecture.
Module boundary
Section titled “Module boundary”| Boundary | Description |
|---|---|
| Inputs | Uint8Array (source bytes) |
| Outputs | LexTree |
| Side effects | None |
| Determinism | Yes |
| External dependencies | @lanexio/parser-core, @lanexio/parser-grammar-html, @lanexio/parser-grammar-markdown |
| Never-throw guarantee | Yes (delegates to grammar parse functions) |
| Security surface | None (delegates to grammar parsers) |
Installation
Section titled “Installation”This is a private package. It is not published to npm independently. It is used internally by the @lanexio/parser and @lanexio/parser-wasm packages.
If you need pure TypeScript parsing, use the grammar packages directly or @lanexio/parser.
Exports
Section titled “Exports”| Export | Type | Description |
|---|---|---|
createPureParser | () => PureParser | Create a pure TypeScript parser facade backed by the toy grammar. |
createHtmlPureParser | () => PureParser | Create a pure TypeScript parser facade backed by the HTML grammar. |
createMarkdownPureParser | () => PureParser | Create a pure TypeScript parser facade backed by the Markdown grammar (GFM enabled). |
parseHtml | (bytes: Uint8Array) => LexTree | Parse HTML bytes. Delegates to @lanexio/parser-grammar-html. |
parseMarkdown | (bytes: Uint8Array) => LexTree | Parse Markdown bytes (GFM enabled). Delegates to @lanexio/parser-grammar-markdown. |
toyParse | (bytes: Uint8Array) => LexTree | Toy grammar parse. Re-exported from parser-core. |
LexNode | class | Re-exported from parser-core. |
LexToyKind | const object | Re-exported from parser-core. |
LexTree | class | Re-exported from parser-core. |
Options
Section titled “Options”No options. Each parser function accepts only Uint8Array.
Exported types
Section titled “Exported types”| Type | Purpose | Notes |
|---|---|---|
PureParser | Parser shape exposed by the pure TS fallback backend | { readonly runtime: "pure-ts"; readonly parse: (bytes: Uint8Array) => LexTree } |
LexRange | Byte range | Re-exported from parser-core |
LexToyKindType | Toy kind type | Re-exported from parser-core |
Accessibility
Section titled “Accessibility”Accessibility requirements
Section titled “Accessibility requirements”- No direct accessibility surface. This is an internal bridge package.
Accessibility checklist
Section titled “Accessibility checklist”| Concern | Status |
|---|---|
| Generated output semantics | Not applicable (internal bridge) |
| ARIA attributes in serialized output | Not applicable |
| Semantic element round-trip | Not applicable |
Security
Section titled “Security”Security considerations
Section titled “Security considerations”- All parse functions delegate to grammar-specific parsers which carry the never-throw guarantee.
| Threat | Mitigation | Status |
|---|---|---|
| Malformed input byte sequence | Delegates to grammar parsers (panic-free) | Implemented |
Companion packages
Section titled “Companion packages”| Package | Relationship | Layer | Notes |
|---|---|---|---|
@lanexio/parser-core | Requires | 1 | Core tree and protocol |
@lanexio/parser-grammar-html | Requires | 2 | HTML grammar delegation |
@lanexio/parser-grammar-markdown | Requires | 2 | Markdown grammar delegation |
@lanexio/parser | Consumes | 6 | Entry point uses pure as fallback |
@lanexio/parser-wasm | Consumes | 4 | WASM falls back to pure |
Changelog
Section titled “Changelog”| Version | Date | Status | Notable changes |
|---|---|---|---|
1.0.0 | 2026-05-29 | Current | Initial stable release. Private package. |
Migration notes
Section titled “Migration notes”- This package is internal and private. Do not depend on it directly in production code.
Related Content
Section titled “Related Content” Flat AST How the 16-byte node layout works.
Bimodal AST Flat and hierarchical AST modes.
Stability Guarantees Never-throw, panic-free, and 3-token recovery.