You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parser, emitter, source analysis, project collectors, and converter orchestration currently import underscore-prefixed language constants from gml_transpiler_parts/constants.py. This keeps the lexical/language-metadata boundary statically unenforceable, and many exported dictionaries are mutable at runtime.
This is the smallest coherent first slice of #817: language metadata is a leaf dependency for identifiers and tokens, and it can be made explicit without changing tokenization, preprocessing, parser behavior, or generated output.
Scope
Keep the supported repository-internal surface in src/conversion/gml_transpiler_parts/constants.py; do not add a wrapper that merely reimports private names and do not move the roughly 1,800-line registry table.
Publish non-underscore names for every constant currently imported across modules: precedence/operator metadata, identifier/literal/built-in sets, replacement tables, built-in variable metadata, virtual-key metadata, and every runtime-function category set.
Add one static literal __all__ containing exactly the 64 supported public names.
Annotate public values with Final and abstract collection types.
Back all mapping exports with types.MappingProxyType; make RIGHT_ASSOCIATIVE a frozenset. Existing tuple/scalar/frozenset values and frozen model instances remain immutable.
Migrate imports/usages in api.py, emitter.py, enum_helpers.py, expression_parser.py, gml_function_dispatch.py, identifiers.py, source_map.py, statement_parser.py, statements.py, tokens.py, utils.py, objects.py, and script_generator.py.
Remove reportPrivateUsage=false only where this slice makes it unnecessary: all of gml_function_dispatch.py's directive and that field from identifiers.py, retaining its unused-symbol controls.
Acceptance criteria
constants.__all__ is a statically known exact 64-name, non-private surface.
No package or production module except the frozen top-level facade imports a private constant.
All mapping exports reject assignment/deletion, all set exports are frozen, and built-in registry values remain frozen BuiltinVariableMetadata.
Parent: #817
Problem
The parser, emitter, source analysis, project collectors, and converter orchestration currently import underscore-prefixed language constants from
gml_transpiler_parts/constants.py. This keeps the lexical/language-metadata boundary statically unenforceable, and many exported dictionaries are mutable at runtime.This is the smallest coherent first slice of #817: language metadata is a leaf dependency for identifiers and tokens, and it can be made explicit without changing tokenization, preprocessing, parser behavior, or generated output.
Scope
src/conversion/gml_transpiler_parts/constants.py; do not add a wrapper that merely reimports private names and do not move the roughly 1,800-line registry table.__all__containing exactly the 64 supported public names.Finaland abstract collection types.types.MappingProxyType; makeRIGHT_ASSOCIATIVEafrozenset. Existing tuple/scalar/frozenset values and frozen model instances remain immutable._BUILTIN_VARIABLE_REGISTRY = BUILTIN_VARIABLE_REGISTRYas an unexported compatibility alias for the frozen top-level facade edge assigned to Slim the GML transpiler facade and enforce zero private phase imports #820.api.py,emitter.py,enum_helpers.py,expression_parser.py,gml_function_dispatch.py,identifiers.py,source_map.py,statement_parser.py,statements.py,tokens.py,utils.py,objects.py, andscript_generator.py.reportPrivateUsage=falseonly where this slice makes it unnecessary: all ofgml_function_dispatch.py's directive and that field fromidentifiers.py, retaining its unused-symbol controls.Acceptance criteria
constants.__all__is a statically known exact 64-name, non-private surface.BuiltinVariableMetadata._BUILTIN_VARIABLE_REGISTRY, still assigned to Slim the GML transpiler facade and enforce zero private phase imports #820.Required verification
./venv/bin/pyright --warnings, the repository Ruff command, and the full unittest suite.4.7.2.stable.official.ed1daf0bfgates and pinned GameMaker LTS 2026 SNAP/Adding conversion gate.Dependencies and order
gml_function_dispatch.pyimport area.