Re: About the groovy code style

2018-07-04 Thread MG

Two questions:

1. Jochen says "Danil  is doing special things with DSL", but "Daniil
   Ovchinnikov" replied regarding IntelliJ Groovy parsing. So is Danil
   == Daniil ?
2. I neither like nor use these syntax varieties - but wouldn't
   changing any of that behavior potentially break Groovy DSLs from
   here to Baghdad (not only "Danil"'s) ?-)

Cheers,
mg


On 04.07.2018 20:40, Paul King wrote:


Comment inline.

On Tue, Jul 3, 2018 at 10:31 PM Jochen Theodorou > wrote:




Am 03.07.2018 um 04:44 schrieb Daniel.Sun:
> Hi all,
>
>       The following code is supported in the older parser, but I
propose to
> stop supporting the ugly code style in the new Parrot parser.
Any thoughts?
>
> 1) import statement (
https://issues.apache.org/jira/browse/GROOVY-8642 )
> ```
> import java.
> lang.
> Object
> ```
>
> 2) prefix operator (
https://issues.apache.org/jira/browse/GROOVY-8650 )
> ```
> def c = --
> 1

I do not need these.. but since I know Danil is doing special things
with DSL, maybe we should first ask him if he needs that and why


Jochen, even though you say you "do not need these", the real question 
is what set of rules are you replacing the existing conceptual rule with?


Existing rule: if the set of tokens parsed when an end of line is 
reached doesn't make a complete expression/statement, continue reading 
tokens as if the EOL wasn't there.


There are exceptions, e.g. we currently don't allow single quote and 
single double quoted strings to span multiple lines but the list is short.


What are your new rules and new list of exceptions?

We shouldn't be tied down by our existing set of rules but we want to 
keep them simple for our users so they all don't need to be grammar 
experts to use the language.


Cheers, Paul.

bye Jochen





Re: About the groovy code style

2018-07-04 Thread Paul King
Comment inline.

On Tue, Jul 3, 2018 at 10:31 PM Jochen Theodorou  wrote:

>
>
> Am 03.07.2018 um 04:44 schrieb Daniel.Sun:
> > Hi all,
> >
> >   The following code is supported in the older parser, but I propose
> to
> > stop supporting the ugly code style in the new Parrot parser. Any
> thoughts?
> >
> > 1) import statement ( https://issues.apache.org/jira/browse/GROOVY-8642
> )
> > ```
> > import java.
> > lang.
> > Object
> > ```
> >
> > 2) prefix operator ( https://issues.apache.org/jira/browse/GROOVY-8650 )
> > ```
> > def c = --
> > 1
>
> I do not need these.. but since I know Danil is doing special things
> with DSL, maybe we should first ask him if he needs that and why
>

Jochen, even though you say you "do not need these", the real question is
what set of rules are you replacing the existing conceptual rule with?

Existing rule: if the set of tokens parsed when an end of line is reached
doesn't make a complete expression/statement, continue reading tokens as if
the EOL wasn't there.

There are exceptions, e.g. we currently don't allow single quote and single
double quoted strings to span multiple lines but the list is short.

What are your new rules and new list of exceptions?

We shouldn't be tied down by our existing set of rules but we want to keep
them simple for our users so they all don't need to be grammar experts to
use the language.

Cheers, Paul.


> bye Jochen
>


Re: About the groovy code style

2018-07-04 Thread Daniel.Sun
Hi Daniil,

OK. I see.
I am not going to support the ugly code style... but I want to know what
others think about :-)

Cheers,
Daniel.Sun



-
Daniel Sun 
Apache Groovy committer 
Blog: http://blog.sunlan.me 
Twitter: @daniel_sun 

--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html


Re: About the groovy code style

2018-07-04 Thread Daniil Ovchinnikov
Each introduced change make tooling more complicated. While some constructs 
become invalid in newer compiler, IntelliJ still has to support all Groovy 
versions.

So in IntelliJ we will continue to parse as in old version, but I’ll have to 
add error highlighting and tweak formatter for 3.0, unless you decide to 
support such corner cases in 3.0. 
—

Daniil Ovchinnikov
JetBrains


> On 4 Jul 2018, at 14:27, Daniel.Sun  wrote:
> 
> Yep. Daniil.
> 
> 
> 
> -
> Daniel Sun 
> Apache Groovy committer 
> Blog: http://blog.sunlan.me 
> Twitter: @daniel_sun 
> 
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html



Re: About the groovy code style

2018-07-04 Thread Daniel.Sun
Yep. Daniil.



-
Daniel Sun 
Apache Groovy committer 
Blog: http://blog.sunlan.me 
Twitter: @daniel_sun 

--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html


Re: About the groovy code style

2018-07-04 Thread Daniil Ovchinnikov
You mean me?

—

Daniil Ovchinnikov
JetBrains


> On 4 Jul 2018, at 05:39, Daniel.Sun  wrote:
> 
> ping Danil  :-)
> 
> 
> 
> -
> Daniel Sun 
> Apache Groovy committer 
> Blog: http://blog.sunlan.me 
> Twitter: @daniel_sun 
> 
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html