-
-
Notifications
You must be signed in to change notification settings - Fork 381
Calculator: Support hex numbers #3774
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
Calculator: Support hex numbers #3774
Conversation
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughThe regular expression used for validating calculator expressions was updated to support hexadecimal number literals in addition to the previously allowed tokens. No changes were made to logic or control flow, and no public or exported entity declarations were altered. Changes
Suggested labels
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
Plugins/Flow.Launcher.Plugin.Calculator/Main.cs (1)
23-23
: Consider supporting uppercase hex prefix and verify Mages engine compatibility.The hex pattern addition looks good, but there are two potential concerns:
- The pattern only supports lowercase
0x
prefix but not uppercase0X
. Users might expect both formats to work.- Need to verify that the underlying Mages engine actually supports hex literal interpretation.
Consider updating the pattern to support both cases:
-@"[ei]|[0-9]|0x[\da-fA-F]+|[\+\%\-\*\/\^\., ""]|[\(\)\|\!\[\]]" + +@"[ei]|[0-9]|0[xX][\da-fA-F]+|[\+\%\-\*\/\^\., ""]|[\(\)\|\!\[\]]" +Run the following script to verify Mages engine hex support:
#!/bin/bash # Description: Check if Mages engine supports hexadecimal literals # Expected: Find documentation or examples of hex support in Mages # Search for Mages documentation or source code mentioning hex support rg -i "hex|0x" --type cs -A 3 -B 3 # Look for any existing tests that might use hex numbers fd -e cs -x rg -l "0x" {} # Check NuGet package documentation if available echo "Please also search the web for Mages engine hex literal support"Additionally, please search the web for Mages engine hex literal support:
Does the Mages mathematical expression engine support hexadecimal number literals like 0x4F?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Plugins/Flow.Launcher.Plugin.Calculator/Main.cs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Report (PR)
- GitHub Check: gitStream.cm
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.
LGTM! Thanks for your contribution!
Allows hex numbers like
0x4F
to be used in the calculator plugin.