Skip to content

Conversation

DanBurton
Copy link

Addresses #120

quintenkasteel added a commit that referenced this pull request Sep 7, 2025
Implements PR #122 by adding Generic and NFData instances to all 36 AST
data types in Language.JavaScript.Parser.AST module.

- Add DeriveGeneric and DeriveAnyClass language extensions
- Import Control.DeepSeq (NFData) and GHC.Generics (Generic)
- Update all deriving clauses to include Generic and NFData
- Enables performance benchmarking and space leak prevention
quintenkasteel added a commit that referenced this pull request Sep 7, 2025
Extends PR #122 implementation to parser support modules:

- Token.hs: Add Generic/NFData to CommentAnnotation and Token types
- SrcLocation.hs: Add Generic/NFData to TokenPosn type
- ParseError.hs: Add Generic/NFData to ParseError type

All modules now include required language extensions and imports
for complete Generic and NFData support across the parser.
quintenkasteel added a commit that referenced this pull request Sep 7, 2025
Updates build configuration for PR #122 Generic/NFData implementation:

- Add deepseq >= 1.3 dependency to library build-depends
- Add deepseq >= 1.3 dependency to test suite build-depends
- Add Test.Language.Javascript.Generic to Other-modules

Required for NFData instances across all AST types.
quintenkasteel added a commit that referenced this pull request Sep 7, 2025
Completes PR #122 implementation with extensive test coverage:

- Add Test.Language.Javascript.Generic module with 13 test cases
- Test NFData deep evaluation on expressions, statements, programs
- Test Generic round-trip operations and instance correctness
- Test performance benefits and space leak prevention
- Include complex JavaScript test cases (classes, arrow functions, nested objects)
- Integrate new test module into main test suite

All 146 tests pass (133 existing + 13 new Generic/NFData tests).
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.

1 participant