Generate inverse 'if' expression from Expression AST#102
Open
Brajk19 wants to merge 7 commits intosofascore:2.xfrom
Open
Generate inverse 'if' expression from Expression AST#102Brajk19 wants to merge 7 commits intosofascore:2.xfrom
Brajk19 wants to merge 7 commits intosofascore:2.xfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 1.x #102 +/- ##
============================================
+ Coverage 96.97% 97.08% +0.10%
- Complexity 491 496 +5
============================================
Files 62 62
Lines 1454 1474 +20
============================================
+ Hits 1410 1431 +21
+ Misses 44 43 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Brajk19
commented
Apr 14, 2025
| ], | ||
| ], | ||
| 'if' => "obj.owner !== null && (obj.owner.firstName === 'John')", | ||
| 'if' => 'obj.owner !== null && ((obj.owner.firstName === "John"))', |
Member
Author
There was a problem hiding this comment.
when converting some types of nodes to string, they are wrapped in parentheses so we end up with double parentheses.
not sure if we should handle this or just leave it be.
940fe49 to
9d58401
Compare
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.
Currently, we are using
str_replacefor generating inversePurgeOn::ifexpressions. This can lead to invalid expressions if e.g. method name containsobj('obj.getobj()').To avoid this, expression syntax tree is traversed so we can correctly detect where
objis called.