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

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

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

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_groovy&pullRequest=2848) 
**Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 New 
issues](https://sonarcloud.io/project/issues?id=apache_groovy&pullRequest=2848&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_groovy&pullRequest=2848&issueStatuses=ACCEPTED)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_groovy&pullRequest=2848&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [100.0% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_groovy&pullRequest=2848&metric=new_coverage&view=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_groovy&pullRequest=2848&metric=new_duplicated_lines_density&view=list)
  
     
   <!

> 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