Module mapping

Module mapping 

Source
Expand description

AST Mapping Tables for ReluxScript

This module provides comprehensive mappings between:

  • ReluxScript unified AST types
  • Babel (ESTree) AST types
  • SWC (swc_ecma_ast) types

These mappings are used by code generators to emit correct platform-specific code.

Structs§

FieldMapping
Field mapping for a specific node type
HelperMapping
Helper function mapping
NodeMapping
Mapping for a single AST node type
PatternMapping
Pattern for matching AST node types
TsHelperMapping
Helper function mappings for generated code

Statics§

NODE_MAPPINGS
All node type mappings

Functions§

gen_ts_helper_babel
Generate Babel code for a TypeScript helper
gen_ts_helper_swc
Generate SWC code for a TypeScript helper
get_field_mapping
Get field mapping
get_helper_for_field
Get helper for a field access pattern
get_node_mapping
Get node mapping by ReluxScript name
get_node_mapping_by_visitor
Get node mapping by visitor method name
get_pattern_check
Get pattern check for a node type
get_ts_helper
Get a TypeScript helper mapping by name