summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/documentation/htdocs/options_Spaces.html
blob: a142b00f71b4027e9262c2427378c51853540a0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
<html>
<head>
   <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
   <title>Uncrustify: where do the Spaces options work</title>
</head>
<body lang="en-US">
<h1><a href="https://github.com/uncrustify/uncrustify">Uncrustify</a>:
Where do the options work?</h1>

<p>
</p>
<h2>Spaces</h2>
You want to "add/ force/ ignore/ remove" a
<ul>
  <li><a href="options_Space_Assign.html">space for assign</a></li>
  <li><a href="options_Space_Byref.html">space for byref</a></li>
  <li><a href="options_Space_Case.html">space for case</a></li>
  <li><a href="options_Space_Cast.html">space for cast</a></li>
  <li><a href="options_Space_Class.html">space for class</a></li>
  <li><a href="options_Space_Comma.html">space for comma</a></li>
  <li><a href="options_Space_D.html">space for D</a></li>
  <li><a href="options_Space_Enum.html">space for enum</a></li>
  <li><a href="options_Space_For.html">space for for loop</a></li>
  <li><a href="options_Space_New.html">space for new/ delete</a></li>
  <li><a href="options_Space_Operator.html">space for operator</a></li>
  <li><a href="options_Space_Paren.html">space for parenthesis</a></li>
  <li><a href="options_Preprocessor.html">space for preprocessor</a></li>
  <li><a href="options_Space_Template.html">space for template</a></li>
  <li><a href="options_Java.html">options_Java</a></li>
  <li><a href="options_Objectiv-C.html">options_Objectiv-C</a></li>
  <li><a href="options_C_sharp.html">options_C#</a></li>
  <li><a href="options_CLI_NET.html">options_CLI .NET</a></li>
  <li><a href="options_ASM.html">options_ASM</a></li>
</ul>
at some places.
<p>
</p>
Some more options...
<p>
</p>
<p> 
</p>
<table border="1", width="100%">
<tr>
<td>
<pre>
// Comments
<a title="sp_cmt_cpp_start"><strong><font color="red">  █</font></strong></a>
int a;            /* emb cmt */ int b;            // trailing cmt
<a title="sp_before_tr_emb_cmt"><strong><font color="red">      █</a><a title="sp_num_before_tr_emb_cmt">..........█                    █..........█</font></strong></a>

    union {
        uint maxChars;
        uint maxBytes;
    } mLength;
    union { int m_size; int m_any; };
    <a title="sp_inside_braces_struct"><strong><font color="red">       █                      █</font></strong></a>
    return { -1, -1, -1 };
    <a title="sp_inside_braces"><strong><font color="red">        █          █</font></strong></a>

class Parser :: ParserPrivate { };
<a title="sp_before_dc"><strong><font color="red">            █</a><a title="sp_after_dc">  █</a><a title="sp_inside_braces_empty">               █</font></strong></a>
template &lt;typename T&gt; class to { };
<a title="sp_inside_braces_empty"><strong><font color="red">                                █</font></strong></a>
my $all = { };
<a title="sp_inside_braces_empty"><strong><font color="red">           █</font></strong></a>
enum FocusEffect { };
<a title="sp_inside_braces_empty"><strong><font color="red">                  █</font></strong></a>
struct error { };
<a title="sp_inside_braces_empty"><strong><font color="red">              █</font></strong></a>
};

#define LOG_FMT (sev, args ...) \
<a title="sp_defined_paren"><strong><font color="red">               █</a><a title="sp_before_ellipsis">          █</font></strong></a>
   do { if (log_sev_on(sev)) { log_fmt(sev, ## args); } } while (0)
   <a title="sp_pp_concat"><strong><font color="red">                                        █  </a><a title="sp_pp_concat">█</font></strong></a>
#endif
#define FS_NOCOW_FL 0x00800000
<a title="sp_macro"><strong><font color="red">                   █</font></strong></a>
#define STRHACK(x) HACKSTR(x)
<a title="sp_macro_func"><strong><font color="red">             █</font></strong></a>
#define wakeUpCaller(cond) \
<a title="sp_before_nl_cont"><strong><font color="red">                          █</font></strong></a>
    if (cond) { \
    <a title="sp_before_nl_cont"><strong><font color="red">           █</font></strong></a>
        cond->release(); \
        <a title="sp_before_nl_cont"><strong><font color="red">                █</font></strong></a>
     }
typedef struct { int val; int sel; } DiceInfo;
<a title="sp_brace_typedef"><strong><font color="red">                                    █</font></strong></a>
void * bar()
<a title="sp_before_ptr_star_func"><strong><font color="red">    █ </a><a title="sp_after_ptr_star_func">█</font></strong></a>
{
    int a = 5;
    <a title="sp_assign"><strong><font color="red">     █ █</font></strong></a>
    <a title="sp_before_assign"><strong><font color="red">     █ </a><a title="sp_after_assign">█</font></strong></a>
    int * const i;
    <a title="sp_after_ptr_star_qualifier"><strong><font color="red">     █</font></strong></a>
    c = a + b;
    <a title="sp_arith, sp_arith_additive"><strong><font color="red">     █ █</font></strong></a>
    a = ~ b;
    <a title="sp_inv"><strong><font color="red">     █</font></strong></a>
    x = - 5;
    <a title="sp_sign"><strong><font color="red">     █</font></strong></a>
    y = + 7;
    <a title="sp_sign"><strong><font color="red">     █</font></strong></a>
    (-- a);
    <a title="sp_incdec"><strong><font color="red">   █</font></strong></a>
    i ++;
    <a title="sp_incdec"><strong><font color="red"> █</font></strong></a>
    b = ( a == d ) ? 55 : 88;
    <a title="sp_cond_question"><strong><font color="red">              █ █</a><a title="sp_cond_colon">  █ █</font></strong></a>
    <a title="sp_cond_question_before"><strong><font color="red">              █</a><a title="sp_cond_question_after"> █</a><a title="sp_cond_colon_before">  █</a><a title="sp_cond_colon_after"> █</font></strong></a>
    b = ( a == d ) ? : 88;
    <a title="sp_cond_ternary_short"><strong><font color="red">                █</font></strong></a>
    if( ( a || b ) && c ) x = 1;
    <a title="sp_bool"><strong><font color="red">       █  █   █  █</font></strong></a>
    <a title="sp_inside_paren"><strong><font color="red">     █      █      █</font></strong></a>
    <a title="sp_paren_paren"><strong><font color="red">   █</font></strong></a>
    c = a > b;
    <a title="sp_compare"><strong><font color="red">     █ █</font></strong></a>
    int * i;
    <a title="sp_before_ptr_star"><strong><font color="red">   █ </a><a title="sp_after_ptr_star">█</font></strong></a>
    <a title="sp_before_unnamed_ptr_star"><strong><font color="red">   █</font></strong></a>
    int * * j;
    <a title="sp_between_ptr_star"><strong><font color="red">     █</font></strong></a>
    throw (x);
    <a title="sp_throw_paren"><strong><font color="red">     █</font></strong></a>
    try {
    <a title="sp_try_brace"><strong><font color="red">   █</font></strong></a>
    } catch (const Exception &e) { }
    <a title="sp_brace_catch"><strong><font color="red"> █</a><a title="sp_catch_paren">     █</font></strong></a>
    } catch (...) { }
    <a title="sp_brace_catch"><strong><font color="red"> █</a><a title="sp_catch_paren">     █</font></strong></a>
    } catch { }
    <a title="sp_brace_catch"><strong><font color="red"> █</a><a title="sp_catch_brace">     █</font></strong></a>
    auto x1 = decltype(x) {0};
    <a title="sp_after_decltype"><strong><font color="red">                     █</font></strong></a>
    Foo() noexcept () {}
    <a title="sp_after_noexcept"><strong><font color="red">              █</font></strong></a>
    void operator ++ ( );
    <a title="sp_after_operator"><strong><font color="red">             █</font></strong></a><a title="sp_after_operator_sym"><strong><font color="red">  █</font></strong></a><a title="sp_after_operator_sym_empty"><strong><font color="red"> █</font></strong></a>
    int a0[][] = { { 1 } };
    <a title="sp_after_type_brace_init_lst_open"><strong><font color="red">              █ █</font></strong></a><a title="sp_before_type_brace_init_lst_close"><strong><font color="red"> █ █</font></strong></a>
    char m_array [256];
    <a title="sp_before_vardef_square"><strong><font color="red">            █</font></strong></a>
    return { {crypt(_Nums, inSeed)} };
    <a title="sp_brace_brace"><strong><font color="red">        █                      █</font></strong></a>
    do {
    <a title="sp_do_brace_open"><strong><font color="red">  █</font></strong></a>
        xxx = _error;
    } while(0)
    <a title="sp_brace_close_while"><strong><font color="red"> █</font></strong></a>
    bool CompareGenomeByFeatureResults::clickOnLink(std::string const& inLink) {
        auto const [sequence, type, firstPosition, lastPosition] = parseLink(inLink);
    <a title="sp_cpp_before_struct_binding"><strong><font color="red">              █</font></strong></a>
    decltype (x)  y;
    <a title="sp_decltype_paren"><strong><font color="red">        █</font></strong></a>
    using x_t = decltype (x);
    <a title="sp_decltype_paren"><strong><font color="red">                    █</font></strong></a>
    foo( ABC );
    <a title="sp_func_call_user_inside_fparen"><strong><font color="red">    █   █</font></strong></a>
    foo( ( ABC ) )
    <a title="sp_func_call_user_paren_paren"><strong><font color="red">    █       █</font></strong></a>
    typedef void timer_cb (struct timer_node *n);
    <a title="sp_func_type_paren"><strong><font color="red">                     █</font></strong></a>
    if (n) ;
    <a title="sp_special_semi"><strong><font color="red">      █</font></strong></a>
    a( , 1);
    <a title="sp_paren_comma"><strong><font color="red">  █</font></strong></a>
    foo() noexcept;
    <a title="sp_paren_noexcept"><strong><font color="red">     █</font></strong></a>
    return {x};
    <a title="sp_return_brace"><strong><font color="red">      █</font></strong></a>
    void funcName() const;
    <a title="sp_paren_qualifier"><strong><font color="red">               █</font></strong></a>
    void ncName() override;
    <a title="sp_paren_qualifier"><strong><font color="red">             █</font></strong></a>
    template < int ... X > int bar2()
    <a title="sp_type_ellipsis"><strong><font color="red">              █</font></strong></a>
    {
            auto s = sizeof ... (  X  );
        <a title="sp_sizeof_ellipsis"><strong><font color="red">                   █</font></strong></a><a title="sp_sizeof_ellipsis_paren"><strong><font color="red">   █</font></strong></a>
            chomp(  X  ) ...;
        <a title="sp_paren_ellipsis"><strong><font color="red">                    █</font></strong></a>
            return X  +  ...;
    }
    do amime3(); while (false);
    <a title="sp_while_paren_open"><strong><font color="red">                  █</font></strong></a>
    auto b0 = unknown_kw { 2 };
    <a title="sp_word_brace_init_lst"><strong><font color="red">                    █</font></strong></a>
    if (data)   go = new ClassA();
    <a title="sp_skip_vbrace_tokens"><strong><font color="red">          █</font></strong></a>
    else        go = new ClassB();
    <a title="sp_skip_vbrace_tokens"><strong><font color="red">          █</font></strong></a>

    auto f0(int a, int b) -> int;
    <a title="sp_trailing_return"><strong><font color="red">                     █  █</font></strong></a>
</pre>
</td>
</tr>
</table>
<p></p>
<table border="1", width="100%">
<tr>
<td>

<pre>
int main(int argc , char *argv [])
<a title="sp_before_comma"><strong><font color="red">                 █</a><a title="sp_after_comma"> █</a><a title="sp_before_squares">          █</font></strong></a>
{
	int a [2];
	<a title="sp_before_square"><strong><font color="red">     █</font></strong></a>
	a[ n ] = 3;
	<a title="sp_inside_square"><strong><font color="red">  █ █</font></strong></a>
	const char *names [] =
	<a title="sp_before_squares"><strong><font color="red">                 █</font></strong></a>
	{
		"{ False , True }",
		<a title="sp_before_comma"><strong><font color="red">        █</a><a title="sp_after_comma"> █</font></strong></a>
		"{ Ignore, Add, Remove, Force }",

	return (-1);
	<a title="sp_return_paren"><strong><font color="red">      █</font></strong></a>


    int a ( );
    <a title="sp_func_proto_paren"><strong><font color="red">     █</a><a title="sp_inside_fparens"> █</font></strong></a>
    int a (int b) {};
    <a title="sp_func_def_paren"><strong><font color="red">     █</a><a title="sp_fparen_brace">       █</font></strong></a>
    int foo () {};
    <a title="sp_func_def_paren_empty"><strong><font color="red">       █</font></strong></a>
void ( int a ) ( int b );
<a title="sp_inside_tparen"><strong><font color="red">      █     █</a><a title="sp_after_tparen_close"> █</a><a title="sp_inside_fparen"> █     █</font></strong></a>
static void sockaddr_unmapped(
    struct sockaddr *sa __attribute__ ((unused)),
    <a title="sp_attribute_paren"><strong><font color="red">                                 █</font></strong></a>
    socklen_t *len __attribute__ ((unused)))
    <a title="sp_attribute_paren"><strong><font color="red">                            █</font></strong></a>

void (^ weak_recurseTreeNodes)(int a);
<a title="sp_after_ptr_block_caret"><strong><font color="red">       █</font></strong></a>
template< >
struct Bar< false > : Foo { };
<a title="sp_angle_colon"><strong><font color="red">                   █</font></strong></a>
</pre>
</td>
</tr>
</table>
<p>
</p>
<table border="1", width="100%">
<tr>
<td>

<pre>
template &lt; typename T &gt; inline static bool remove(T column)
<a title="sp_template_angle"><strong><font color="red">        █<a title="sp_inside_angle"> █<a title="sp_inside_angle">          █</font></strong></a>
<a title="sp_before_angle"><strong><font color="red">        █</a><a title="sp_after_angle">              █</font></strong></a>
</pre>

<pre>
int & a(int & b);
<a title="sp_before_byref_func"><strong><font color="red">   █</a><a title="sp_after_byref_func"> █</a><a title="sp_before_byref">     █</a><a title="sp_after_byref"> █</font></strong></a>
int c(int &)
<a title="sp_type_func"><strong><font color="red">   █</a><a title="sp_before_unnamed_byref">     █</font></strong></a>
{
	d = aa (& y,& d) ;
	<a title="sp_func_call_paren"><strong><font color="red">      █ </a><a title="sp_addr"> █   █</a><a title="sp_before_semi">  █</font></strong></a>
        e = ee ();
        <a title="sp_func_call_paren_empty"><strong><font color="red">      █</font></strong></a>
	if ( a == 5 ) ...
	<a title="sp_before_sparen"><strong><font color="red">  █</font></strong></a>
        <a title="sp_inside_sparen"><strong><font color="red">    █      █</font></strong></a>
        <a title="sp_inside_sparen_open"><strong><font color="red">    █</a><a title="sp_inside_sparen_close">      █</font></strong></a>
            ...
        if (b) ;
        <a title="sp_special_semi"><strong><font color="red">      █</font></strong></a>
	if ( a == 6 ) b = 66;        
        <a title="sp_after_sparen"><strong><font color="red">             █</font></strong></a>
	if ( a == 7 ) { b = 77; }        
        <a title="sp_sparen_brace"><strong><font color="red">             █</font></strong></a>
        if (! a) {
        <a title="sp_not"><strong><font color="red">     █</font></strong></a>
            b = 4;
        } else {
        <a title="sp_brace_else"><strong><font color="red"> █</a><a title="sp_else_brace">    █</font></strong></a>
            b = 5;
        }
        for(a = 1 ; a < b ; a++) {
        <a title="sp_before_semi_for"><strong><font color="red">         █</a><a title="sp_before_semi_for_empty">       █</font></strong></a>
           ...
	for( ; ; ) {
        <a title="sp_before_semi_for_empty"><strong><font color="red">    █ █</a><a title="sp_after_semi_for_empty"> █</font></strong></a>
           ...
	switch (whatIsToDo) ...
	<a title="sp_before_sparen"><strong><font color="red">      █</font></strong></a>
	while (start < end) ...
	<a title="sp_before_sparen"><strong><font color="red">     █</font></strong></a>

</pre>
</td>
</tr>
</table>
<p>
</p>
<table border="1", width="100%">
<tr>
<td>

<pre>
namespace Server {
<a title="sp_word_brace_ns"><strong><font color="red">                █</font></strong></a>
class Cache : public QObject
<a title="sp_before_class_colon"><strong><font color="red">           █</a><a title="sp_after_class_colon"> █</font></strong></a>
Cache::StorageDebugger ()
<a title="sp_func_class_paren"><strong><font color="red">                      █</font></strong></a>
    : mFile(0)
<a title="sp_before_constr_colon"><strong><font color="red">   █</a><a title="sp_after_constr_colon"> █</font></strong></a>
{
        new service;
        <a title="sp_after_new"><strong><font color="red">   █</font></strong></a>
        delete service;
        <a title="sp_after_new"><strong><font color="red">      █</font></strong></a>
        delete[] buffer;
        <a title="sp_after_new"><strong><font color="red">        █</font></strong></a>
        if (this == & other) return * this;
        <a title="sp_addr"><strong><font color="red">             █</a><a title="sp_deref">               █</font></strong></a>
        switch (a) {
        case 1 :
        <a title="sp_before_case_colon"><strong><font color="red">      █</font></strong></a>
                b= 1;
                break;
        case 2 : {
                b = 2;
                break;
        }
        default :
                break;
        }
        bool operator () (Entity::Id lhs, Entity::Id rhs) const
        ...<a title="sp_after_operator"><strong><font color="red">          █</a><a title="sp_after_operator_sym">  █</font></strong></a>

        a = ( int ) 5.6;
        <a title="sp_inside_paren_cast"><strong><font color="red">     █   █</a><a title="sp_after_cast"> █</font></strong></a>
        cpp = int (7);
        <a title="sp_cpp_cast_paren"><strong><font color="red">         █</font></strong></a>
        len = sizeof (int);
        <a title="sp_sizeof_paren"><strong><font color="red">            █</font></strong></a>
        SomeStruct a = SomeStruct {1, 2, 3};
        <a title="sp_word_brace_init_lst"><strong><font color="red">                         █</font></strong></a>
	someFuncCall(SomeStruct {4, 5, 6});
	<a title="sp_word_brace_init_lst"><strong><font color="red">                       █</font></strong></a>
        log . foo . bar = 5;
        <a title="sp_member"><strong><font color="red">   █ █   █ █</font></strong></a>
	other -> foo -> bar = 123;
	<a title="sp_member"><strong><font color="red">     █  █   █  █</font></strong></a>
}
/// doxygen sequence
<a title="sp_cmt_cpp_doxygen"><strong><font color="red">   █</font></strong></a>
///< doxygen sequence
<a title="sp_cmt_cpp_doxygen"><strong><font color="red">    █</font></strong></a>
//! doxygen sequence
<a title="sp_cmt_cpp_doxygen"><strong><font color="red">   █</font></strong></a>
//!< doxygen sequence
<a title="sp_cmt_cpp_doxygen"><strong><font color="red">    █</font></strong></a>
#if A
#else /* Comment A */
<a title="sp_endif_cmt"><strong><font color="red">     █</font></strong></a>
#endif /* Comment B */
<a title="sp_endif_cmt"><strong><font color="red">      █</font></strong></a>
</pre>
</td>
</tr>
</table>
<table border="1", width="100%">
<tr>
<td>

<pre>
void Initialize( BYTE nDelay = 100 );
<a title="sp_assign_default"><strong><font color="red">                            █ █</font></strong></a>
void f1()
{
      auto a = [<a title="sp_inside_square"><font color="red">█</font></a>=<a title="sp_inside_square"><font color="red">█</font></a>]<a title="sp_cpp_lambda_square_paren"><font color="red">█</font></a>(<a title="sp_cpp_lambda_argument_list"><font color="red">█</font></a>int *a, Something & b<a title="sp_cpp_lambda_argument_list"><font color="red">█</font></a>);

      parallel_for(0, 100, [<a title="sp_inside_square"><font color="red">█</font></a>&<a title="sp_inside_square"><font color="red">█</font></a>]<a title="sp_cpp_lambda_square_paren"><font color="red">█</font></a>(<a title="sp_cpp_lambda_argument_list"><font color="red">█</font></a>const int i<a title="sp_cpp_lambda_argument_list"><font color="red">█</font></a>)<a title="sp_cpp_lambda_paren_brace"><font color="red">█</font></a>{
          const std::vector<int> values = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };

      list[idx] (param);
      <a title="sp_square_fparen"><font color="red">         █</font></a>

double foo()
{
	return( foo(n) );
	<a title="sp_balance_nested_parens"><strong><font color="red">       █      █</font></strong></a>


Vector2&lt;double&gt; ()
<a title="sp_angle_paren"><strong><font color="red">               █</font></strong></a>

{
        List&lt;byte&gt; bob = new List&lt;byte&gt; ();
        <a title="sp_angle_word"><strong><font color="red">          █</font></strong></a>
        QVector&lt;QPair&lt;Condition, QString&gt; &gt; mWhenThen;
        <a title="sp_permit_cpp11_shift"><strong><font color="red">                                 █</font></strong></a>

template&lt;int i, int ... Indexes, typename IdxHolder, typename ... Elements&gt;
<a title="sp_before_ellipsis"><strong><font color="red">                   █                                         █</font></strong></a>
struct index_holder_impl&lt;i, index_holder&lt;Indexes ...&gt;, IdxHolder, Elements ...&gt;
<a title="sp_before_ellipsis"><strong><font color="red">                                                █                         █</font></strong></a>
{
	typedef typename index_holder_impl&lt;i + 1, index_holder&lt;Indexes ... i&gt;,	Elements ...&gt;::type type;
	<a title="sp_before_ellipsis"><strong><font color="red">                                                              █                 █</font></strong></a>
</pre>
</td>
</tr>
</table>
<table border="1", width="100%">Java Sources
<tr>
<td>
<pre>

    for (Type var : expr)
    <a title="sp_after_for_colon"><strong><font color="red">               █</font></strong></a>

</pre>
</td>
</tr>
</table>
</body>
</html>