eclipse-archived / ceylon.formatter

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

formatter breaks function named argument #61

Closed gavinking closed 10 years ago

gavinking commented 10 years ago

Given

fun { function arg(String a) => a; };

The formatter produces:

fun { 
    arg function (String a) => a };
lucaswerkmeister commented 10 years ago

Oops, I get an “unexpected token” here. Maybe I forgot about the function arg(String a) syntax (and support only function(String))?

lucaswerkmeister commented 10 years ago

Oh, I thought this was about the line breaks, but the formatter actually breaks the code, removing the ; after a. So the “unexpected token” error is expected.

(I should probably add some error recovery to the IDE plugin.)

lucaswerkmeister commented 10 years ago

Well, once I understood what this issue was about, it was actually fairly easy :/ sorry for the delay!