-
Notifications
You must be signed in to change notification settings - Fork 44
532 support negative numbers #872
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?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,7 @@ public string EvaluateExpression(IMacroContext context) | |
|
|
||
| int Parse(Location location, string macrosValue) | ||
| { | ||
| if (Regex.IsMatch(macrosValue, $"^(0|[1-9][0-9]*)$")) | ||
| if (Regex.IsMatch(macrosValue, $"^(0|-*[1-9][0-9]*)$")) | ||
|
||
| return int.Parse(macrosValue); | ||
|
|
||
| if (Regex.IsMatch(macrosValue, "^0b[01]+$")) | ||
|
|
||
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.
Please add tests for <= >= too. so we can test that these cases coverted too.
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.
Also can you check that
-10 < 0x10for example.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.
Okay, i added