Skip to content

Conversation

DanBurton
Copy link

See #124

λ> parseModule "export * from 'lib.mjs';" "src"
Right (JSAstModule [JSModuleExportDeclaration (JSAnnot (TokenPn 0 1 1) []) (JSExportAllFrom (JSBinOpTimes (JSAnnot (TokenPn 7 1 8) [WhiteSpace (TokenPn 6 1 7) " "])) (JSFromClause (JSAnnot (TokenPn 9 1 10) [WhiteSpace (TokenPn 8 1 9) " "]) (JSAnnot (TokenPn 14 1 15) [WhiteSpace (TokenPn 13 1 14) " "]) "'lib.mjs'") (JSSemi (JSAnnot (TokenPn 23 1 24) [])))] (JSAnnot (TokenPn 0 0 0) []))

Verified

This commit was signed with the committer’s verified signature.
DanBurton Dan Burton
quintenkasteel added a commit that referenced this pull request Sep 7, 2025
Implements PR #125 by adding core parser support for ES6 export star syntax.

- Add JSExportAllFrom constructor to JSExportDeclaration in AST.hs
- Add 'Mul FromClause AutoSemi' parser rule to Grammar7.y
- Update ShowStripped instance for JSExportAllFrom
- Enables parsing of 'export * from "module"' statements

This is the foundation for complete export star functionality.
quintenkasteel added a commit that referenced this pull request Sep 7, 2025
Extends PR #125 implementation with complete output generation:

- Pretty/Printer.hs: Add RenderJS instance for JSExportAllFrom
- Pretty/JSON.hs: Add JSON serialization pattern match for export *
- Process/Minify.hs: Add MinifyJS instance for efficient export * minification

Export * statements now render correctly as 'export*from"module"' when minified
and preserve proper formatting in pretty-printed output.
quintenkasteel added a commit that referenced this pull request Sep 7, 2025
Extends existing test modules for PR #125 export * syntax support:

- ModuleParser.hs: Add parser tests for export * with various module types
- Minify.hs: Add minification tests verifying whitespace removal
- RoundTrip.hs: Add round-trip tests for parse/pretty-print consistency

Tests cover basic syntax, relative paths, scoped packages, and different
quote styles to ensure robust export * handling.
quintenkasteel added a commit that referenced this pull request Sep 7, 2025
Completes PR #125 implementation with extensive edge case testing:

- Add Test.Language.Javascript.ExportStar module with 21 comprehensive tests
- Cover basic parsing, module specifier variations, whitespace handling
- Test comment preservation, Unicode module names, error conditions
- Include multiple export scenarios and complex path handling
- Update testsuite.hs to integrate new test module
- Update language-javascript.cabal with new test module registration

All 168 tests pass, providing robust validation of export * from syntax.
Test coverage exceeds 85% requirement with comprehensive edge case handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant