[ 
https://issues.apache.org/jira/browse/GROOVY-12322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18109685#comment-18109685
 ] 

ASF GitHub Bot commented on GROOVY-12322:
-----------------------------------------

sonarqubecloud[bot] commented on PR #2848:
URL: https://github.com/apache/groovy/pull/2848#issuecomment-5469278248

   ## [![Quality Gate 
Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png
 'Quality Gate 
Failed')](https://sonarcloud.io/dashboard?id=apache_groovy&pullRequest=2848) 
**Quality Gate failed**  
   Failed conditions  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png
 '') [B Maintainability Rating on New 
Code](https://sonarcloud.io/dashboard?id=apache_groovy&pullRequest=2848) 
(required ≥ A)  
     
   <!

> Inline the nls parser rule
> --------------------------
>
>                 Key: GROOVY-12322
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12322
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Priority: Major
>
> h3. Motivation
> {{GroovyParser.g4}} used a shared helper for optional newlines:
> {noformat}
> nls : NL* ;
> sep : (NL | SEMI)+ ;
> {noformat}
> Because {{sep}} can start with {{NL}}, {{FOLLOW(nls)}} contains {{NL}}. The 
> star inside {{nls}} is therefore not LL(1) at the rule level: generated 
> {{nls()}} always uses adaptivePredict, even at call sites where a simple 
> {{while (LA(1)==NL)}} would be correct. The rule also allocates a 
> {{NlsContext}} for every invocation, including the empty match.
> {{classOrInterfaceModifiersOpt}} already inlined {{NL*}} for this reason, 
> with a comment not to put {{nls}} back.
> Same class of prediction-cost reduction as GROOVY-12173, applied to newline 
> handling.
> h3. Changes
> * Delete the {{nls}} rule and write {{NL*}} at every former call site, so 
> each site has its own star decision.
> * Teach {{GroovydocManager}} to read {{NL}} terminals as direct children 
> (comments are lexed as {{NL}}). {{sep}} still wraps mixed {{NL}} / {{SEMI}} 
> sequences.
> h3. Compatibility
> * Language and AST for correct programs are unchanged.
> * Parse-tree shape changes: no {{NlsContext}}; empty matches produce no 
> child. {{NlsContext}} is generated parser API, not a stability covenant.
> * No public API additions.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to