- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2
Feature/xor-operator-enum-functions-enhanced #84
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
base: main
Are you sure you want to change the base?
Feature/xor-operator-enum-functions-enhanced #84
Conversation
- 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
| Review the following changes in direct dependencies. Learn more about Socket for GitHub. 
 | 
| Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
 | 
There was a problem hiding this 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()andenum()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()andenum()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.
feat: add support for 'xor' operator and enhance constant function