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

Paul King commented on GROOVY-8079:
-----------------------------------

The ability to leave off the leading zero was added for Groovy 4 as part of 
GROOVY-8678:
[https://github.com/apache/groovy-website/blob/asf-site/site/src/site/releasenotes/groovy-4.0.adoc#support-for-decimal-fraction-literals-without-a-leading-zero]

> Literal numeric constants cannot start with or end with a dot
> -------------------------------------------------------------
>
>                 Key: GROOVY-8079
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8079
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.8
>         Environment: Windows, but probably generic
>            Reporter: Tomas Rokicki
>            Priority: Minor
>
> Groovy prefers the . (dereference) operator over the decimal interpretation, 
> but does not permit use of decimals that are conventional:
> groovy:000> .3
> groovysh_parse: 2: unexpected token: . @ line 2, column 1.
>    .3
>    ^
> groovy:000> (.3)
> groovysh_parse: 2: unexpected token: . @ line 2, column 2.
>    (.3)
>     ^
> groovy:000> (3.)
> groovysh_parse: 2: unexpected token: ) @ line 2, column 4.
>    (3.)
>       ^
> groovy:000> -.3
> groovysh_parse: 2: unexpected token: . @ line 2, column 2.
>    -.3
>     ^



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

Reply via email to