-
Notifications
You must be signed in to change notification settings - Fork 751
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
[Step Extension] Add semantic support xml step extension #43106
Merged
gimantha
merged 19 commits into
ballerina-platform:xml_step_extension
from
poorna2152:xml_step_extend_method_invocation
Oct 3, 2024
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8c5617d
Add step extension indexed access support
poorna2152 bb27df8
Add step extension filter access support
poorna2152 2319b7a
Add xml indexed and filter based step extension tests
poorna2152 93909a0
Add xml indexed and filter extend combined tests
poorna2152 84754d4
Update failing tests
poorna2152 b67b217
Add negative tests
poorna2152 95e3a44
Add step extend intial method invocation support
poorna2152 6da0cfe
Add separate AST node for extended xml step expression
poorna2152 8cb4461
Remove unused fileds in xml navigation access class
poorna2152 326d4e9
Add more combined tests
poorna2152 90d45dd
Update the blangnodebuilder parser class use
poorna2152 84977f0
Refactor code and add toString functions
poorna2152 f4abb6f
Handle setting of position of the new nodes
poorna2152 fa9dc93
Extract if to switch cases and add functions
poorna2152 1fb49c5
Update use of position in desugar
poorna2152 5e9ee97
Add more finder tests
poorna2152 2caeea3
Split the test function
poorna2152 317e292
Update closure desugar
poorna2152 089ff59
Use ASTBuilderUtil for index expr creation
poorna2152 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ | |
import org.wso2.ballerinalang.compiler.tree.expressions.BLangErrorConstructorExpr; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangErrorVarRef; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangExtendedXMLNavigationAccess; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangFieldBasedAccess; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangGroupExpr; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangIgnoreExpr; | ||
|
@@ -104,6 +105,9 @@ | |
import org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLCommentLiteral; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLElementAccess; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLElementLiteral; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLFilterStepExtend; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLIndexedStepExtend; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLMethodCallStepExtend; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLNavigationAccess; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLProcInsLiteral; | ||
import org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLQName; | ||
|
@@ -1092,11 +1096,33 @@ public void visit(BLangXMLElementAccess xmlElementAccess) { | |
@Override | ||
public void visit(BLangXMLNavigationAccess xmlNavigation) { | ||
xmlNavigation.expr = rewriteExpr(xmlNavigation.expr); | ||
xmlNavigation.childIndex = rewriteExpr(xmlNavigation.childIndex); | ||
result = xmlNavigation; | ||
} | ||
|
||
@Override | ||
public void visit(BLangExtendedXMLNavigationAccess extendedXMLNavigationAccess) { | ||
extendedXMLNavigationAccess.stepExpr = rewriteExpr(extendedXMLNavigationAccess.stepExpr); | ||
rewriteExprs(extendedXMLNavigationAccess.extensions); | ||
result = extendedXMLNavigationAccess; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to check codecov warnings everywhere. |
||
|
||
@Override | ||
public void visit(BLangXMLIndexedStepExtend xmlIndexedStepExtend) { | ||
xmlIndexedStepExtend.indexExpr = rewriteExpr(xmlIndexedStepExtend.indexExpr); | ||
result = xmlIndexedStepExtend; | ||
} | ||
|
||
@Override | ||
public void visit(BLangXMLMethodCallStepExtend xmlMethodCallStepExtend) { | ||
xmlMethodCallStepExtend.invocation = rewriteExpr(xmlMethodCallStepExtend.invocation); | ||
result = xmlMethodCallStepExtend; | ||
} | ||
|
||
@Override | ||
public void visit(BLangXMLFilterStepExtend xmlFilterStepExtend) { | ||
result = xmlFilterStepExtend; | ||
} | ||
|
||
@Override | ||
public void visit(BLangIndexBasedAccess.BLangJSONAccessExpr jsonAccessExpr) { | ||
jsonAccessExpr.indexExpr = rewriteExpr(jsonAccessExpr.indexExpr); | ||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Can we check if we can fix the codecov warnings?