Skip to content
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] Fix parsing of xml step extension #42722

Open
wants to merge 3 commits into
base: xml_step_extension
Choose a base branch
from

Conversation

poorna2152
Copy link
Contributor

@poorna2152 poorna2152 commented May 9, 2024

Purpose

Update parsing of xml step extension to match the spec.
https://ballerina.io/spec/lang/master/#xml-step-extend

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

@poorna2152 poorna2152 force-pushed the xml_step_parsing branch 2 times, most recently from e23049d to 0d2e2ce Compare May 9, 2024 11:38
@poorna2152 poorna2152 added the Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. label May 9, 2024
@poorna2152 poorna2152 force-pushed the xml_step_parsing branch 2 times, most recently from 74c9c83 to 68ae036 Compare May 10, 2024 00:53
Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 78.90295% with 50 lines in your changes missing coverage. Please review.

Please upload report for BASE (xml_step_extension@0c727ce). Learn more about missing BASE report.

Current head cc8f3ec differs from pull request most recent head 18206e3

Please upload reports for the commit 18206e3 to get more accurate results.

Files Patch % Lines
...o/ballerina/compiler/syntax/tree/TreeModifier.java 0.00% 16 Missing ⚠️
.../compiler/internal/parser/tree/STTreeModifier.java 0.00% 9 Missing ⚠️
...ternal/parser/tree/STXMLStepIndexedExtendNode.java 58.82% 7 Missing ⚠️
...nal/parser/tree/STXMLStepMethodCallExtendNode.java 58.82% 7 Missing ⚠️
...a/compiler/internal/parser/tree/STNodeVisitor.java 0.00% 4 Missing ⚠️
...mpiler/internal/parser/tree/STNodeTransformer.java 0.00% 2 Missing ⚠️
...allerina/compiler/syntax/tree/NodeTransformer.java 0.00% 2 Missing ⚠️
...r/internal/parser/BallerinaParserErrorHandler.java 94.73% 1 Missing ⚠️
...compiler/syntax/tree/XMLStepIndexedExtendNode.java 96.55% 1 Missing ⚠️
...piler/syntax/tree/XMLStepMethodCallExtendNode.java 96.55% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##             xml_step_extension   #42722   +/-   ##
=====================================================
  Coverage                      ?   77.16%           
  Complexity                    ?    51257           
=====================================================
  Files                         ?     2928           
  Lines                         ?   204223           
  Branches                      ?    26628           
=====================================================
  Hits                          ?   157583           
  Misses                        ?    38126           
  Partials                      ?     8514           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label May 26, 2024
@poorna2152 poorna2152 removed the Stale label May 27, 2024
@lochana-chathura lochana-chathura added the Area/Parser Everything related to the ballerina lexer and the parser #Compiler label Jun 5, 2024
while (!isEndOfXMLStepExtend(nextToken.kind)) {
if (nextToken.kind == SyntaxKind.DOT_TOKEN) {
STNode dotToken = parseDotToken();
STNode funcCallExpression = parseFuncCall(parseIdentifier(ParserRuleContext.IDENTIFIER));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function-call-expr vs method-call-expr: they have slightly different grammar.
e.g.

  • function call allows qualified identifier. Method call does not allow it.
  • method-name allows special-method-name := map | join | start. Function reference does not allow it

So I think we better parse . method-name ( arg-list ) items separately.
i.e.

parseMethodCallExprRhs() {
   parseDotToken()
   parseMethodName()
   parseParenthesizedArgList()
}

@@ -0,0 +1,132 @@
/*
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are the years manually updated? You need to add an entry to syntax_node_metadata.json. It will automatically pick the year from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Parser Everything related to the ballerina lexer and the parser #Compiler Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants