Skip to main content

Crate sim_codec_javascript

Crate sim_codec_javascript 

Source
Expand description

Bounded, lossless ECMAScript 2026 Script and Module frontend.

The public model is deliberately neutral syntax data. It has no compiler IR, runtime, TypeScript, Shape, or kernel dependency. Parser extensions can wrap Node and attach their own Origin without changing JavaScript syntax.

The frozen downstream extension seam is exactly Token, SyntaxTree, Node, Origin, and JavascriptBuilder. It carries syntax and lowering data only; TypeScript policy remains a one-way downstream concern.

Structs§

Diagnostic
Deterministic located frontend failure.
JavascriptBuilder
Public construction seam for JavaScript and syntax extensions.
JavascriptCodec
Runtime codec object for codec/javascript.
JavascriptCodecLib
Host-registered library installing codec/javascript.
Limits
Resource limits shared by lexing and parsing.
Node
A concrete node covering a contiguous token range.
Origin
Source identity attachable by JavaScript or downstream syntax extensions.
Span
Half-open UTF-8 byte range in the original source.
SyntaxTree
Complete lossless syntax tree.
Token
A lossless lexical token. Text is recovered using Token::span.

Enums§

Asi
Evidence for an explicit or automatic semicolon boundary.
DiagnosticCode
Stable diagnostic category.
Goal
Script or Module syntactic goal.
LexicalGoal
Parser-selected lexical goal governing slash and template recognition.
NodeKind
Neutral concrete-tree node category, stable for downstream extensions.
TokenKind
Kind of lossless token.

Constants§

CORPUS_MANIFEST_SHA256
SHA-256 of the checked source corpus manifest.
ECMA262_AUTHORITY
Immutable specification authority used by this frontend.
ECMA262_EDITION
Frozen ECMA-262 edition.
ECMA262_FROZEN_ON
Date on which the edition identity and grammar inventory were frozen.
JAVASCRIPT_CODEC_ID
Stable local id used before a host assigns codec/javascript an id.
TEST262_REVISION
Frozen Test262 evidence corpus revision. Test262 is an oracle, not a dependency.

Functions§

decode_javascript
Decode Script source using the shared codec budget.
decode_javascript_located
Decode into a root-located expression.
decode_javascript_tree
Decode into a recursively located expression tree.
encode_javascript
Canonically encode lowered forms or the established tagged fallback.
lower_javascript
Lower a complete tree to stable javascript/* forms.
parse_module
Parses a Module with default bounds.
parse_module_with_limits
Parses a Module with explicit bounds.
parse_script
Parses a Script with default bounds.
parse_script_with_limits
Parses a Script with explicit bounds.
tokenize
Tokenizes with default limits, selecting slash goals from preceding tokens.
tokenize_with_limits
Tokenizes with explicit resource limits.