Closed AzraelSec closed 1 month ago
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
It's been a pleasure to contribute! 😄
Hello, Warden Team 👋🏻
I'd like to contribute to this project by opening a PR to make the shield DSL handle negative integers. I didn't comment on the related issue before picking it up since I briefly chatted with @Pitasi about this. Please forgive me if this was not the expected workflow to follow.
The current PR defines the abstraction to handle the negative sign as a prefix expression (with the highest priority between the operators) instead of changing the lexer to manually recognize negative integers. This way, you can write more complex expressions (e.g.
--1
,-(-1)
,-var
[when/if constants/variables will be available]) without additional costs.Also, I used a small REPL tool to manually test the feature (as an additional step to write unit tests), and I decided to include it as part of the current PR. I'm happy to drop it if you don't think this might be useful.
I'm happy to discuss the proposed changes. Let me know if anything does not match what you expect. Thanks!
Closes #328
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation
Refactor