This and similar issues have come up before. It would be worthwhile searching the mail archives. At least one related change we backed out of last time. I'd be interested to see how it impacts the examples in previous discussions:
https://issues.apache.org/jira/browse/GROOVY-7428 http://markmail.org/thread/6qrcvnmxuqys45vh On Thu, Feb 22, 2018 at 6:29 PM, Daniel Sun <realblue...@hotmail.com> wrote: > Hi all, > > Groovy parses negative numbers as unary expression. For example, > `-1` > is parsed as `-``1`, older parser parses negative numbers twice, so does > the > Parrot parser for the identical output... > > I suggest to parse negative numbers as REAL numbers instead of unary > expression[1]. It will break the edge case, for example: `-1(a, b, c)` is > parsed as `-(1.call(a, b, c))`, after refining, `-1(a, b, c)` is parsed as > `-1.call(a, b, c)`. > > Any thoughts? If no PMC votes -1 on this GEP in 72 hours, I will > work on it. > > Cheers, > Daniel.Sun > > [1] > https://github.com/danielsun1106/groovy-parser/blob/master/src/main/antlr/ > GroovyParser.g4#L796 > > > > -- > Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html >