eclipse-archived / ceylon.formatter

A formatter for the Ceylon programming language, written in Ceylon.
Apache License 2.0
14 stars 11 forks source link

Add support for new anonymous function syntax #147

Closed lucaswerkmeister closed 6 years ago

lucaswerkmeister commented 7 years ago

See ceylon/ceylon#7190.

lucaswerkmeister commented 6 years ago

Okay, this is freaky, apparently this works almost completely without any formatter changes?

    persons
        .filter( => element.age >= 18)
        .sort( => x.lastName <=> y.lastName)
        .map( => element.name->element.email)
        .each(print);

The only thing that’s not as it should be is the space in front of the =>.

lucaswerkmeister commented 6 years ago

Ah, of course, functions can have multiple parameter lists, so syntactically this is just a function expression with zero parameter lists :)