home

Theoretically Uncrustify distinguishes between 3 main types of parenthesis:

fparen (Function parenthesis)
fparen is used by 9 options related to funtions:
  • function prototypes: int f(int);
  • function implementations: int f(int n){ return n+n; }
  • function calls: x = f(4);
sparen (Statement parenthesis)
sparen is used by 10 options related to statements:
  • asm (…) <-- FIXME / MAKE TEST
  • catch (…) <-- FIXME / MAKE TEST
  • for (…;…;…)
  • if (…)
  • switch (…)
  • while (…)
paren (parenthesis)
paren is used by ~80 options for all other parenthesis. But see below...
FIXME / MAKE TEST for alignas() asm() catch()

In practice...

Unfortunately, in practice, this naming convention is not respected, mainly for 'fparen'.
Options below are about parenthesis used for functions but 'paren' is used where 'fparen' is expected.

donot_indent_func_def_close_paren, indent_paren_after_func_call, indent_paren_after_func_decl, indent_paren_after_func_def, nl_func_call_paren, nl_func_call_paren_empty, nl_func_def_paren, nl_func_def_paren_empty, nl_func_paren, nl_func_paren_empty, sp_func_call_paren, sp_func_call_paren_empty, sp_func_call_user_paren, sp_func_call_user_paren_paren, sp_func_class_paren, sp_func_class_paren_empty, sp_func_def_paren, sp_func_def_paren_empty, sp_func_proto_paren, sp_func_proto_paren_empty, sp_func_type_paren
...

The convention for sparan has very few exceptions:

indent_semicolon_for_paren, mod_full_paren_if_bool, sp_oc_catch_paren, sp_while_paren_open

And there is also:

cparen (Closing parenthesis)
cparen is only used by the option sp_cparen_oparen
oparen (Opening parenthesis)
oparen is only used by the option sp_cparen_oparen.
rparen (functoR parenthesis)
rparen is used by two options related to functors sp_func_call_user_inside_rparen and sp_inside_rparen for this type of code: operator()(int x) {…}
tparen (Type parenthesis)
tparen is used by two options sp_inside_tparen and sp_after_tparen_close for this type of code: void (*x)(...)

home