dpeek/haxeprinter — pull request #7 by Simn (2014-03-14 15:28:46+00:00)
Title: use nested config instead of flat one

This changes the config to a nested structure, so the default JSON looks like this:

```
{
"newline": {
"before_brace": false,
"before_extends": false,
"before_implements": false,
"condense_multiple": true,
"empty_at_end_of_file": true
},
"space": {
"after": {
"type_hint_colon": false
},
"around": {
"additive_operators": true,
"arrow": true,
"assignment_operators": true,
"equality_operators": true,
"logical_operators": true,
"multiplicative_operators": true,
"relational_operators": true,
"unary_operators": false
},
"before": {
"catch_keyword": true,
"catch_left_brace": true,
"catch_parenthesis": true,
"else_keyword": true,
"else_left_brace": true,
"for_left_brace": true,
"for_parenthesis": true,
"if_left_brace": true,
"if_parenthesis": true,
"method_call_parenthesis": false,
"method_declaration_parenthesis": false,
"method_left_brace": true,
"switch_left_brace": true,
"switch_parenthesis": true,
"try_left_brace": true,
"type_hint_colon": false,
"while_keyword": true,
"while_left_brace": true,
"while_parenthesis": true
},
"between": {
"call_arguments": true,
"enum_arguments": true,
"function_arguments": true,
"type_constraints": true,
"type_parameters": true,
"var_declarations": true
},
"within": {
"catch_parenthesis": false,
"for_parenthesis": false,
"if_parenthesis": false,
"method_call_parenthesis": false,
"method_declaration_parenthesis": false,
"switch_parenthesis": false,
"ternary_after_colon": false,
"ternary_after_question": false,
"ternary_before_colon": false,
"ternary_before_question": false,
"while_parenthesis": false
},
"condense_multiple": true
}
}
```

I've updated the demo accordingly to use `

` for subsections. It's fairly ugly, but can be made to look nicer than the flat config by someone with the appropriate CSS skills.