-
Notifications
You must be signed in to change notification settings - Fork 47
Release/0.8.0.0 #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
quintenkasteel
wants to merge
121
commits into
new-ast
Choose a base branch
from
release/0.8.0.0
base: new-ast
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Release/0.8.0.0 #139
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
… nullish coalescing - Add BigIntToken, OptionalChainingToken, NullishCoalescingToken to Token.hs - Add lexer rules for BigInt literals (decimal, hex, octal formats) - Add lexer rules for optional chaining (?.) and nullish coalescing (??) operators - Extend AST with JSBigIntLiteral, JSOptionalMemberDot, JSOptionalMemberSquare, JSOptionalCallExpression - Add JSBinOpNullishCoalescing to binary operators - Update grammar with proper precedence for new operators - Support obj?.prop, obj?.[key], obj?.method() syntax - Support 123n, 0x123n, 0o777n BigInt literal formats
- Update pretty printer with BigInt literal rendering (123n format) - Add optional chaining operator rendering (?. and ?.[]) - Add nullish coalescing operator rendering (??) - Update minifier to handle new AST constructors - Maintain proper spacing and precedence in output formatting
- Create Language.JavaScript.Pretty.JSON module with full AST-to-JSON conversion - Support all existing AST constructors including literals, expressions, statements - Add JSON serialization for new ES2020+ features (BigInt, optional chaining, nullish coalescing) - Provide structured JSON output for tooling and analysis - Update cabal file to expose new JSON module
- Add BigInt literal tests for decimal, hex, and octal formats (123n, 0x123n, 0o777n) - Add optional chaining tests for property access (obj?.prop) and method calls - Add optional chaining tests for bracket notation (obj?.[key]) - Add nullish coalescing tests with proper operator precedence - Add lexer tests for all new tokens (BigIntToken, OptionalChainingToken, NullishCoalescingToken) - Fix stringEscape function bug in lexer test helper that was corrupting identifiers - Ensure all 132 tests pass with new language features - Validate correct parsing semantics for modern JavaScript syntax
- Add CLAUDE.md with comprehensive Haskell coding standards - Define function size limits, import conventions, and testing requirements - Add todo-extend.md with ES2020+ feature implementation roadmap - Include .claude/ directory with project configuration - Establish 85%+ test coverage target and development best practices - Document parser-specific patterns and JavaScript language support requirements
Add JSConciseBody type to support ECMAScript-compliant arrow function parsing that distinguishes between expression bodies and function blocks. - Add JSConciseBody with JSConciseFunctionBody and JSConciseExpressionBody - Update JSArrowExpression to use JSConciseBody instead of JSStatement - Add ConciseBody grammar rules supporting both blocks and expressions - Implement ShowStripped instance for test compatibility Fixes arrow function parsing to match ECMAScript specification where arrow functions can have either block statements or direct expressions.
Extend pretty printing and minification to handle new JSConciseBody type for ECMAScript-compliant arrow function output formatting. - Add RenderJS instance for JSConciseBody in pretty printer - Add MinifyJS instance with optimization for single expression blocks - Ensure consistent output formatting for both expression and block bodies Maintains backward compatibility while supporting the new arrow function body representation required by ECMAScript specification.
…sions Implement comprehensive JSON serialization support for the new arrow function representation using JSConciseBody type. - Add renderConciseBodyToJSON for JSConciseBody serialization - Add renderArrowExpressionToJSON for complete arrow function support - Ensure proper JSON structure for both expression and block bodies Enables full JSON export/import capabilities for ECMAScript-compliant arrow function AST representation.
Update arrow function test expectations to match the new JSConciseBody representation that properly distinguishes between expression and block bodies. - Update test expectations to use JSConciseFunctionBody for block statements - Update test expectations to use JSConciseExpressionBody for expressions - Maintain comprehensive test coverage for all arrow function variants Tests now validate ECMAScript-compliant arrow function parsing behavior with proper body type differentiation.
Add JSObjectSpread constructor to JSObjectProperty type and implement grammar rules to parse spread expressions in object literals. - Add JSObjectSpread constructor with annotation and expression fields - Update ShowStripped instance for JSObjectProperty to handle spreads - Add SpreadExpression support to PropertyAssignment grammar rule - Add spreadExpressionToProperty helper function for AST conversion Enables parsing of object spread syntax like {...obj} according to ECMAScript specification for object literal spread expressions. Resolves: Object spread syntax parsing for PR #118
Extend pretty printing and minification to handle JSObjectSpread nodes for complete object spread syntax processing pipeline. - Add RenderJS instance for JSObjectSpread in pretty printer - Add MinifyJS instance for JSObjectSpread in minifier - Ensure correct ... syntax output in both formatted and minified code Completes object spread syntax support with proper output formatting and minification while preserving spread operator semantics.
Add extensive test cases for object spread expressions to validate parsing, pretty printing, and minification of all spread syntax patterns. Expression parser tests: - Basic spread: {...obj} - Mixed with properties: {a: 1, ...obj}, {...obj, b: 2} - Multiple spreads: {...obj1, ...obj2} - Function call spreads: {...getObject()} - Complex combinations with methods and identifiers Minifier tests: - Whitespace removal for object spread syntax - Proper formatting preservation in minified output Validates complete ECMAScript compliance for object spread expressions including edge cases and complex object literal combinations.
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
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.
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.
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).
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.
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.
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.
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.
Add ES2016 exponentiation operator (**) support: - Add JSBinOpExponentiation constructor to JSBinOp data type in AST - Add ExponentiationToken to token definitions - Include proper ShowStripped and deAnnot instances Addresses GitHub issue #71 ES6/ES7 features implementation.
Add lexer and grammar support for ES2016 exponentiation operator: - Add "**" token rule in lexer with proper precedence - Add ExponentiationExpression grammar production with right-associativity - Position exponentiation between UnaryExpression and MultiplicativeExpression - Follows ES2016 specification for operator precedence and associativity Part of GitHub issue #71 ES6/ES7 features implementation.
Add complete output support for exponentiation operator: - Add "**" rendering in Pretty.Printer for JSBinOpExponentiation - Add arithmetic operator handling in JSON serialization - Add minification support with empty annotation - Ensures consistent output across all rendering modes Part of GitHub issue #71 ES6/ES7 features implementation.
Add test coverage for ES2016 exponentiation operator: - ExpressionParser: basic parsing, right-associativity, operator precedence - Minify: minification behavior verification - RoundTrip: round-trip parsing with comment preservation - Verify correct precedence: 2*3**4 parses as 2*(3**4) - Verify right-associativity: 2**3**2 parses as 2**(3**2) Completes GitHub issue #71 ES6/ES7 features implementation.
Update build configuration and add comprehensive ASI edge case testing: - Update cabal file for new dependencies or build requirements - Add ASIEdgeCases test module for robust comment and whitespace handling - Update test suite configuration to include new test modules - Ensures robust parsing behavior across edge cases Part of GitHub issue #71 ES6/ES7 features implementation.
…arameters Add complete trailing comma support as specified in ECMAScript 2017: Grammar changes: - Add trailing comma support to Arguments production for function calls - Add trailing comma support to NamedFunctionExpression parameters - Add trailing comma support to LambdaExpression parameters - Add trailing comma support to GeneratorExpression parameters - Add trailing comma support to NamedGeneratorExpression parameters This enables valid ES2017 syntax like: - f(x,) - function calls with trailing comma - function(a,){} - function parameters with trailing comma - function*(a,){} - generator parameters with trailing comma Resolves GitHub issue #123.
Add thorough test coverage for trailing comma support in: Function calls: - Basic single/multiple arguments with trailing comma: f(x,), f(a,b,) - Method calls: Math.max(10, 20,) - Complex expressions: obj.method(a + b, c * d,) - Chained function calls: f(x,)(y,) - Console logging: console.log('hello',) Function parameters: - Anonymous functions: function(a,){}, function(a,b,){} - Named functions: function foo(x,){} - Generator functions: function*(a,){}, function* gen(x,y,){} All tests verify correct parsing without trailing comma affecting semantics. Validates fix for GitHub issue #123.
- Implement strongly typed validation errors with position information - Add support for context-aware validation (loops, functions, classes, modules) - Include validation for all JavaScript constructs including ES2017+ features - Support strict mode detection and validation - Add Elm-style error formatting with source code context - Comprehensive validation for literals, expressions, statements, and modules - Proper validation of class elements, methods, and inheritance - Support for destructuring patterns and template literals - Module import/export validation with proper scoping
- Add strongly typed error message tests - Include validation tests for all JavaScript constructs - Test context-aware validation (functions, loops, classes, modules) - Add edge cases and boundary condition tests - Test strict mode validation and error handling - Include tests for ES2017+ features (BigInt, optional chaining, etc.) - Comprehensive coverage for literals, expressions, and statements - Add module validation and import/export tests - Test error formatting and position extraction
- Add Language.JavaScript.Parser.Validator to exposed modules - Add Test.Language.Javascript.Validator to test modules - Add text dependency for validator string handling - Update build configuration to include new validator components
…escapes - Add support for numeric separators (_) in decimal, hex, binary, and octal literals - Add ES2021 numeric separator support to BigInt literals - Enhanced string escape sequences with forward slash and octal support - Update decimal literal patterns to support complex separator combinations - Remove overly restrictive error patterns to follow JavaScript lexical analysis rules
- Update generated lexer code with ES2021 numeric separator support - Include enhanced string escape sequence handling - Generated from Alex lexer specification using 'cabal exec alex'
- Update numeric separator tests to expect single tokens instead of separate tokens - Fix malformed pattern tests to follow JavaScript lexical analysis rules - Ensure consistent behavior between hex, binary, and octal literal edge cases - Document current ES2021-compliant parser behavior in test descriptions
- Change test expectations from separate tokens to single ES2021-compliant tokens - Update test descriptions to reflect new ES2021 compliant behavior - Fix pattern matching in numeric separator tests to handle single token results
- Update string literals test file - Update failures.txt with current test results - Maintain test file consistency across lexer improvements
- Document ES2021 numeric separators feature - Highlight ByteString to String breaking change - Detail internal modernization and code quality improvements - Document test suite enhancements and reorganization - Note cleanup of deprecated files and build improvements
- Add multiple output formats (JSON, XML, S-Expression serialization) - Document enhanced error system with 10 new error types - Include bug fixes for template literals, Unicode, and lexer issues - Detail test suite expansion with 1000+ new tests - Add specific numbers for test coverage improvements - Document position tracking and string escape module enhancements
- Main CI workflow with multi-OS, multi-GHC matrix testing - Release workflow with automated builds and Hackage publishing - Security workflow with vulnerability scanning and static analysis - Code quality workflow with formatting, linting, and complexity checks - Nightly workflow with fuzzing, performance, and compatibility testing - Dependabot configuration for automated dependency updates - PR and issue templates for bug reports, features, and performance issues Features: - Test coverage analysis with 85% threshold enforcement - Documentation generation and GitHub Pages deployment - Performance benchmarking with regression detection - Memory leak detection and profiling - Multi-platform compatibility testing (Ubuntu, macOS, Windows) - CLAUDE.md compliance checking - Automatic code formatting and refactoring - Security scanning and license compliance - Real-world JavaScript file testing - Comprehensive reporting and artifact collection
Security Scan ResultsSecurity Scan Summary
Generated at: Sun Sep 7 14:27:58 UTC 2025 |
Security Scan ResultsSecurity Scan Summary
Generated at: Sun Sep 7 18:48:15 UTC 2025 |
- Add core tree shaking module with usage analysis - Implement elimination logic for unused code - Support for safe constructor elimination (Array, Object, Map, Set, WeakMap, WeakSet, etc.) - Handle side effect preservation and dynamic property access - Support for module import/export tree shaking - Configurable optimization levels (Conservative, Balanced, Aggressive) - Comprehensive AST analysis and transformation
- Add advanced tree shaking edge cases test suite - Add comprehensive elimination tests (variables, functions, classes) - Add side effect preservation tests - Add module import/export tree shaking tests - Add framework pattern tests (React, Vue, Angular) - Add library pattern tests (Lodash, RxJS, Redux) - Add enterprise scale testing scenarios - Add integration tests for complex dependency chains - Achieve comprehensive coverage of real-world JavaScript patterns
- Update cabal configuration to include tree shaking modules - Enhance AST types for better optimization analysis - Improve parser error handling and location tracking - Update pretty printer for optimized code output - Extend minification process with tree shaking integration - Add Makefile targets for tree shaking development
- Update main test suite to include tree shaking tests - Enhance performance benchmarks with tree shaking metrics - Fix test anti-patterns and improve assertion quality - Add comprehensive compatibility testing - Improve lexer test coverage for advanced features - Remove mock functions and reflexive test patterns
- Add TODO.md with project roadmap and tree shaking milestones - Add constructor safety analysis documentation - Add Unicode test cases for comprehensive JavaScript parsing - Document tree shaking implementation decisions and trade-offs
- Add quick-test workflow for rapid development feedback - Add validation-test workflow for comprehensive testing - Update CI/CD pipelines to include tree shaking validation - Remove outdated workflow configurations - Optimize build and test processes for tree shaking development
…r 0.8.0.0 release - Add comprehensive export default parsing support in Grammar7.y - Extend AST with JSExportDefault node and proper rendering - Fix tree shaking analysis to handle default exports correctly - Update ChangeLog.md release date to 2025-09-26 - Fix cabal file paths for test fixtures (k.js, unicode.txt) - Resolve major test regression with 20 test failures fixed - All tree shaking functionality now working correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
No description provided.