home  

sp_before_case_colon

Properties

  Category: Spacing options
      Type: multiple (ignore add remove force)
   Default: remove

Description

Add or remove space before case ':'.

Default: remove
switch(a){
  case +1:
    ...
  default:
    ...
}

Examples

raw CPP code sp_before_case_colon=ignore sp_before_case_colon=add sp_before_case_colon=remove sp_before_case_colon=force
switch(a){ case +1:a++;break; case -1 :a--;break; default : a=0; }; switch(a){ case +1: a++; break; case -1 : a--; break; default : a=0; }; switch(a){ case +1 : a++; break; case -1 : a--; break; default : a=0; }; switch(a){ case +1: a++; break; case -1: a--; break; default: a=0; }; switch(a){ case +1 : a++; break; case -1 : a--; break; default : a=0; };
 

Info

  Take care: the default is 'remove'.
  Notes:
  - Why a space is added AFTER the colon ? How to disable this space ?
  - There is no option 'sp_after_case_colon'. Why?
  Edited by JEAYNE

Not the best code for this option? See how to improve the .uds file used to generate these examples.