deprecating use traditional formatter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

deprecating use traditional formatter

ducasse
Hi

In the new implementation of the code formattter I will remove useTraditionalPrecedence.
This settings put additional parentheses around binary selector but I find it cumbersome

While it may make sense for

it turns
foo
        ^ 1 + 2 * 3

into

foo
        ^ (1 + 2) * 3

foo
        ^ 1 * 3 + 2

foo
        ^ (1 | 2) % 3

foo

        ^ 1 % 2 | 3

So let me know what you think but I will be hard to convince :)

Stef

Reply | Threaded
Open this post in threaded view
|

Re: deprecating use traditional formatter

Marcus Denker-4


> On 13 Nov 2019, at 09:04, ducasse <[hidden email]> wrote:
>
> Hi
>
> In the new implementation of the code formattter I will remove useTraditionalPrecedence.
> This settings put additional parentheses around binary selector but I find it cumbersome
>
> While it may make sense for
>
> it turns
> foo
> ^ 1 + 2 * 3
>
> into
>
> foo
>        ^ (1 + 2) * 3
>
> foo
>        ^ 1 * 3 + 2
>
> foo
> ^ (1 | 2) % 3
>
> foo
>
>        ^ 1 % 2 | 3
>
> So let me know what you think but I will be hard to convince :)
>
I vote to remove it.

The RB AST encodes parenthesis information, so that means that we can have
a pretty printer keeping the parenthesis if they have been added by the original author.

Adding new ones makes no sense to me.

So I vote to remove.

        Marcus


Reply | Threaded
Open this post in threaded view
|

Re: deprecating use traditional formatter

ducasse
I will do it :)

On 13 Nov 2019, at 10:05, Marcus Denker <[hidden email]> wrote:



On 13 Nov 2019, at 09:04, ducasse <[hidden email]> wrote:

Hi 

In the new implementation of the code formattter I will remove useTraditionalPrecedence.
This settings put additional parentheses around binary selector but I find it cumbersome

While it may make sense for 

it turns 
foo 
^ 1 + 2 * 3

into 

foo
      ^ (1 + 2) * 3

foo 
      ^ 1 * 3 + 2 

foo
^ (1 | 2) % 3

foo

      ^ 1 % 2 | 3 

So let me know what you think but I will be hard to convince :)

I vote to remove it.

The RB AST encodes parenthesis information, so that means that we can have
a pretty printer keeping the parenthesis if they have been added by the original author.

Adding new ones makes no sense to me.

So I vote to remove.

Marcus

Reply | Threaded
Open this post in threaded view
|

Re: deprecating use traditional formatter

ducasse
So I did it in 

https://github.com/Ducasse/enlumineur

I will work on the removal of the previous formatter and the introduction of the new one. 

Stef

On 13 Nov 2019, at 10:06, ducasse <[hidden email]> wrote:

I will do it :)

On 13 Nov 2019, at 10:05, Marcus Denker <[hidden email]> wrote:



On 13 Nov 2019, at 09:04, ducasse <[hidden email]> wrote:

Hi 

In the new implementation of the code formattter I will remove useTraditionalPrecedence.
This settings put additional parentheses around binary selector but I find it cumbersome

While it may make sense for 

it turns 
foo 
^ 1 + 2 * 3

into 

foo
      ^ (1 + 2) * 3

foo 
      ^ 1 * 3 + 2 

foo
^ (1 | 2) % 3

foo

      ^ 1 % 2 | 3 

So let me know what you think but I will be hard to convince :)

I vote to remove it.

The RB AST encodes parenthesis information, so that means that we can have
a pretty printer keeping the parenthesis if they have been added by the original author.

Adding new ones makes no sense to me.

So I vote to remove.

Marcus