Re: Groovy 4 parser bug?

2022-09-09 Thread o...@ocs.cz
P.S. Just in case someone else has the same problem — as I am playing with that, preliminarily it looks like the solution for a big codebase might be an ASTT which would list the positions of all the real safe indices; this ASTT would be run under Groovy 3 and its output would be then used with

Re: Groovy 4 parser bug?

2022-09-09 Thread o...@ocs.cz
Daniel, > On 9. 9. 2022, at 1:30, Daniel Sun wrote: > Add a space between ? and [ > p ? [0] : [1] Well thanks, but that really helps with new code only. On the other hand, with the existing codebase it is a royal PITA. Can't do that automatically, for I am afraid no regexp could reliably disti

Re: Groovy 4 parser bug?

2022-09-08 Thread Daniel Sun
Add a space between ? and [ p ? [0] : [1] Cheers, Daniel Sun On 2022/09/08 13:39:21 Christopher Smith wrote: > The parser seems to be interpreting what you mean as a ternary as a > null-safe array index. > > On Thu, Sep 8, 2022, 08:37 o...@ocs.cz wrote: > > > Hi there, > > > > I've just decid

Re: [EXT] Groovy 4 parser bug?

2022-09-08 Thread o...@ocs.cz
ttps://issues.apache.org/jira/projects/GROOVY/issues > <https://issues.apache.org/jira/projects/GROOVY/issues> > > From: Christopher Smith > Sent: Thursday, September 8, 2022 8:39 AM > To: dev@groovy.apache.org > Subject: [EXT] Re: Groovy 4 parser bug? > > External

RE: [EXT] Re: Groovy 4 parser bug?

2022-09-08 Thread Milles, Eric (TR Technology) via dev
/projects/GROOVY/issues From: Christopher Smith Sent: Thursday, September 8, 2022 8:39 AM To: dev@groovy.apache.org Subject: [EXT] Re: Groovy 4 parser bug? External Email: Use caution with links and attachments. The parser seems to be interpreting what you mean as a ternary as a null-safe array index

Re: Groovy 4 parser bug?

2022-09-08 Thread Christopher Smith
The parser seems to be interpreting what you mean as a ternary as a null-safe array index. On Thu, Sep 8, 2022, 08:37 o...@ocs.cz wrote: > Hi there, > > I've just decided it's time to upgrade from Groovy 3 to Groovy 4... and > immediately bumped into a problem, which looks like a parser bug in a

Groovy 4 parser bug?

2022-09-08 Thread o...@ocs.cz
Hi there, I've just decided it's time to upgrade from Groovy 3 to Groovy 4... and immediately bumped into a problem, which looks like a parser bug in an extremely trivial scenario, which seems weird. Do I perhaps miss something? I've checked https://groovy-lang.org/releasenotes/groovy-4.0.html