Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the compiler pipeline to use async generator-based processing instead of Node.js streams, improves error handling and source mapping in the AST generation, and updates the documentation to reflect these architectural changes. The changes make the codebase more modular, easier to debug, and better suited for incremental and asynchronous processing.
Compiler Pipeline Refactor:
Refactored
Preprocessor,Tokenizer, andBabelASTclasses to use async generator-based processing instead of Node.js streams, removing dependencies onTransformandpipeline. This enables incremental, push-like data flow and simplifies the architecture. (lib/preprocessing/preprocessor.js,lib/babel-ast/babel-ast.js,lib/compiler.js) [1] [2] [3] [4] [5] [6] [7] [8]Updated the test suite to use the new async generator-based pipeline, ensuring all tests run through the refactored system. (
lib/babel-ast/babel-ast.test.js)AST Generation and Error Handling Improvements:
Added detailed source location (
loc) metadata to all generated Babel AST nodes, improving debugging and supporting better source mapping. (lib/babel-ast/babel-ast.js) (F53df441L110R110, [1] [2] [3] [4] [5] [6] [7]Enhanced error messages in AST generation to include line and column information, and replaced stream-based error handling with direct exceptions for clarity. (
lib/babel-ast/babel-ast.js,lib/babel-ast/babel-ast.test.js) [1] [2] [3] [4]Documentation Updates:
README.mdto describe the new async generator-based architecture and clarify the incremental, modular design of the compiler pipeline. (README.md) [1] [2]These changes collectively modernize the codebase, improve maintainability, and lay the groundwork for future enhancements such as better debugging, optimization passes, and support for additional backends.