-
Notifications
You must be signed in to change notification settings - Fork 416
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
Migrate to PEG parser. Introduce boolean operators and constants. #2182
Conversation
src/CommunityToolkit.Maui.UnitTests/Converters/MathExpressionConverterTests.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui.UnitTests/Converters/MathExpressionConverterTests.cs
Outdated
Show resolved
Hide resolved
@dotnet-policy-service agree company="Esri" |
Hi @brminnick since your review, I have:
The fork is ready for another round of review |
src/CommunityToolkit.Maui/Converters/MathExpressionConverter/MathExpression.shared.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui/Converters/MathExpressionConverter/MathExpression.shared.cs
Outdated
Show resolved
Hide resolved
@stephenquan here's the build log:
|
Thanks @pictos, I have reviewed the CS8063 possible null reference return issues and have resolved it by making nullability updates to both the MathExpression.shared.cs and MathExpressionConverter.shared.cs. The nullability updates also required additional Asserts added to the MathExpressionConverterTests.cs. With these changes, the build checks are now passing. |
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.
I think that we're getting really close to merge this!
src/CommunityToolkit.Maui/Converters/MathExpressionConverter/MathExpression.shared.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui/Converters/MathExpressionConverter/MathExpression.shared.cs
Outdated
Show resolved
Hide resolved
…stead of raising exceptions.
@pictos @bijington I have pushed updates to the fork address both the C# property name pattern and logging invalid math expressions with TraceWarning. Because we're no longer raising invalid math expressions I had to change the relevant unit test from an exception test to a null check. The fork is ready for review again. |
...munityToolkit.Maui/Converters/MathExpressionConverter/MultiMathExpressionConverter.shared.cs
Outdated
Show resolved
Hide resolved
…ssionConverter and corresponding unit tests.
@pictos @brminnick as requested, I have removed the Null Forgiving Operator from the MultiMathExpressionConverter. I have corrected the null checks in the MultiMathExpressionConverter and that resulted in a necessary minor update to the unit tests. This fork is ready for review again. |
Hi all, we are using snapshot copies of these classes in our projects. I am eager to help out and remove any blockers on this PR. |
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
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.
Copilot reviewed 5 out of 6 changed files in this pull request and generated no suggestions.
Files not reviewed (1)
- samples/CommunityToolkit.Maui.Sample/Pages/Converters/MultiMathExpressionConverterPage.xaml: Language not supported
Comments skipped due to low confidence (3)
src/CommunityToolkit.Maui.UnitTests/Converters/MathExpressionConverterTests.cs:66
- [nitpick] The variable name 'variables' should be renamed to 'values' for consistency with the method parameter name in MultiMathExpressionConverter.shared.cs.
public void MathExpressionConverter_WithMultipleVariable_ReturnsCorrectResult(string expression, object[] variables, double expectedResult)
src/CommunityToolkit.Maui/Converters/MathExpressionConverter/MathExpressionConverter.shared.cs:20
- [nitpick] The variable name 'value' is less descriptive in the context of mathematical expressions. Consider renaming it to 'inputValue' for clarity.
public override object? ConvertFrom(object? value, string parameter, CultureInfo? culture = null)
src/CommunityToolkit.Maui/Converters/MathExpressionConverter/MathExpressionConverter.shared.cs:20
- The removal of the '[return: NotNullIfNotNull(nameof(values))]' attribute might lead to unclear error messages when null values are encountered. Consider adding a clear error message for null values.
public override object? ConvertFrom(object? value, string parameter, CultureInfo? culture = null)
Hi @stephenquan! Could you update this PR to resolve the merge conflicts? We've finally merged the massive .NET 9 PR today and it introduced a few merge conflicts across our open PRs. |
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.
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Files not reviewed (1)
- samples/CommunityToolkit.Maui.Sample/Pages/Converters/MultiMathExpressionConverterPage.xaml: Language not supported
src/CommunityToolkit.Maui.UnitTests/Converters/MathExpressionConverterTests.cs
Show resolved
Hide resolved
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.
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Files not reviewed (1)
- samples/CommunityToolkit.Maui.Sample/Pages/Converters/MultiMathExpressionConverterPage.xaml: Language not supported
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.
Thanks @stephenquan! Approved ✅
Description of Change
double
withobject
+
,-
,*
,/
and^
as well as math functionsand
,or
,?
,:
,>=
,>
,<=
,<
,==
,!=
as well astrue
andfalse
constantsdouble
withobject
General comments:
Linked Issues
#2181
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information