Skip to content

Conversation

@andreasnicolaou
Copy link
Owner

@andreasnicolaou andreasnicolaou commented Oct 7, 2025

feat: add support for 'xor' operator and enhance constant function

  • Added 'xor' operator to the lexer and parser with appropriate precedence.
  • Enhanced the constant function to support PHP-style class constants and improved error handling.
  • Updated tests for the constant function to cover various scenarios including class constants and global properties.
  • Introduced enum function to handle TypeScript-style enums and added comprehensive tests for validation.
  • Refactored ArrayNode and BinaryNode to improve evaluation logic and added support for new operators.
  • Updated documentation to reflect new features and changes in functionality.
  • bump @rollup/plugin-node-resolve from 16.0.1 to 16.0.2
  • bump @types/node from 24.6.1 to 24.7.0
  • bump @typescript-eslint/eslint-plugin and @typescript-eslint/parser from 8.45.0 to 8.46.0
  • bump eslint from 9.36.0 to 9.37.0
  • bump rollup from 4.52.3 to 4.52.4

- Added 'xor' operator to the lexer and parser with appropriate precedence.
- Enhanced the constant function to support PHP-style class constants and improved error handling.
- Updated tests for the constant function to cover various scenarios including class constants and global properties.
- Introduced enum function to handle TypeScript-style enums and added comprehensive tests for validation.
- Refactored ArrayNode and BinaryNode to improve evaluation logic and added support for new operators.
- Updated documentation to reflect new features and changes in functionality.
- bump @rollup/plugin-node-resolve from 16.0.1 to 16.0.2
- bump @types/node from 24.6.1 to 24.7.0
- bump @typescript-eslint/eslint-plugin and @typescript-eslint/parser from 8.45.0 to 8.46.0
- bump eslint from 9.36.0 to 9.37.0
- bump rollup from 4.52.3 to 4.52.4
Copilot AI review requested due to automatic review settings October 7, 2025 19:04
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​typescript-eslint/​parser@​8.45.0 ⏵ 8.46.01001007197100
Updated@​typescript-eslint/​eslint-plugin@​8.45.0 ⏵ 8.46.099 +110080 +197100
Updated@​types/​node@​24.6.1 ⏵ 24.7.0100 +110081 +196100
Updated@​rollup/​plugin-node-resolve@​16.0.1 ⏵ 16.0.29910010091 +7100
Updatedeslint@​9.36.0 ⏵ 9.37.097 +110010096 +2100
Updatedrollup@​4.52.3 ⏵ 4.52.497 +110010099100

View full report

@codecov
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a8d05cd) to head (64fe8b1).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #84   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         1022      1072   +50     
  Branches       273       271    -2     
=========================================
+ Hits          1022      1072   +50     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive XOR operator support and enhances enum functions, along with code quality improvements. The implementation includes both word-based and symbolic XOR operators with proper precedence handling, while introducing new constant() and enum() functions for better PHP-style and TypeScript-style enum support.

  • Added XOR operator support with proper lexing, parsing, and evaluation
  • Introduced constant() and enum() functions for accessing global constants and enum values
  • Refactored object creation patterns to use Object.create(null) for better prototype safety
  • Enhanced array node logic with improved hash detection and evaluation methods

Reviewed Changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/parser.ts Added XOR operator with precedence 12 to binary operators
src/lexer.ts Added 'xor' keyword to WORD_OPERATORS array
src/node/binary-node.ts Implemented XOR evaluation logic and optimized logical operators
src/node/binary-node.test.ts Added comprehensive test cases for XOR operator
src/expression-language.ts Added constant() and enum() functions with full validation
src/expression-language.test.ts Added extensive test coverage for enum function
src/expression-function.ts Enhanced function resolution and added constant/enum support
src/expression-function.test.ts Added tests for new function capabilities
src/node/*.ts Replaced empty object literals with Object.create(null)
src/node/array-node.ts Refactored array/object detection logic with new helper methods
README.md Updated documentation to reflect XOR support and new functions
package.json Updated development dependencies to latest versions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@andreasnicolaou andreasnicolaou marked this pull request as draft October 7, 2025 19:17
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.

2 participants