Add Comprehensive Operator Support and Improve Expression Parsing#42
Merged
Add Comprehensive Operator Support and Improve Expression Parsing#42
Conversation
…s for QUERY_STRING evaluation
- Added debug logging for query string retrieval and expression evaluation. - Improved error handling for lexing interpolated expressions. - Updated tests to cover various scenarios including missing closing brackets, standalone barewords, and mixed subfield types. - Enhanced the Processor documentation with examples for better clarity. - Implemented tests for nested subfields and compatibility with ESI choose/when constructs. - Refactored the variable parsing logic to handle special characters and edge cases more robustly.
…ic and cleaning up tests
…ation and enhance tests for ESI choose/when compatibility
…ken lexing for comparison operations
…ests for negation scenarios
…operators, and update tests for new functionality
…/error logging with variables directly in the `format!` string
kailan
requested changes
Oct 27, 2025
Member
kailan
left a comment
There was a problem hiding this comment.
This looks fantastic, thank you so much for your work here!
I made a few minor suggestions, most of which are just clippy lints. Apart from that it looks good to go 👍
Co-authored-by: Kailan Blanks <kblanks@fastly.com>
Co-authored-by: Kailan Blanks <kblanks@fastly.com>
Co-authored-by: Kailan Blanks <kblanks@fastly.com>
Co-authored-by: Kailan Blanks <kblanks@fastly.com>
Co-authored-by: Kailan Blanks <kblanks@fastly.com>
Co-authored-by: Kailan Blanks <kblanks@fastly.com>
Co-authored-by: Kailan Blanks <kblanks@fastly.com>
Co-authored-by: Kailan Blanks <kblanks@fastly.com>
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
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.
Changes Made
🔧 New Operators Added
==(equals),!=(not equals)<(less than),<=(less than or equal),>(greater than),>=(greater than or equal)&&(logical AND),||(logical OR)!(negation)🏷️ XML Attribute Parsing
<esi:include src="..." alt="..." />tags🎯 Expression Features
$(QUERY_STRING{param}))(expression)syntax for grouping and precedence🏗️ Architecture Changes
Token::Operation(Operator)for all operators📚 Documentation
✅ Testing
Examples
ESI Include Tags
Standard HTML Tags with Attributes
New Equality Operations
Bareword Variable Subscripts
Complex Expressions with Negation
Breaking Changes
None - all changes are additive and maintain backward compatibility.
Performance Impact
Minimal - changes are primarily to parsing logic with no impact on runtime evaluation performance.
Ready for review 🚀