eclipse-archived / ceylon.formatter

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

Auto-generate FormattingOptions.ceylon #2

Closed lucaswerkmeister closed 10 years ago

lucaswerkmeister commented 10 years ago

FormattingOptions.ceylon contains a lot of duplicate code; nearly the whole file could be auto-generated from the following information per attribute:

e.g., for indentMode,

The indentation mode of the formatter.
IndentMode
indentMode
Spaces(4)

would be sufficient. From this, we would then generate

The tree-related classes of ceylon-spec are auto-generated using an ANTLR grammar (treegen); we could do something similar here.

lucaswerkmeister commented 10 years ago

I don't know if it makes a lot of sense to use ANTLR there, though...

lucaswerkmeister commented 10 years ago

For convenience, I'm putting the currently generated version of the file into the wiki here. I'll try and update it from time to time.