blob: 22bb63c1c44299485b7de8cd980dca97dfca5395 [file] [log] [blame]
40 columns |
>>> Line comment after `if`.
if // comment
(c) { body; }
<<<
if // comment
(c) {
body;
}
>>> Line comment before condition.
if (// comment
c) { body; }
<<<
if ( // comment
c) {
body;
}
>>> Line comment after condition.
if (c // comment
){ body; }
<<<
if (c // comment
) {
body;
}
>>> Line comment after `)`.
if (c) // comment
{ body; }
<<<
if (c) // comment
{
body;
}
>>> Line comment after non-block then body.
if (true) body; // comment
<<<
if (true) body; // comment
>>> Line comment after block then body.
if (true) {body;} // comment
<<<
if (true) {
body;
} // comment
>>> Line comment after non-block then body with else.
if (true) body; // comment
else other;
<<<
if (true)
body; // comment
else
other;
>>> Line comment after block then body with else.
if (true) {body;} // comment
else {other;}
<<<
if (true) {
body;
} // comment
else {
other;
}
>>> Line comment after `else` with block body.
if (true) {body;} else // comment
{other;}
<<<
if (true) {
body;
} else // comment
{
other;
}
>>> Line comment after `else` with non-block body.
if (true) body; else // comment
other;
<<<
if (true)
body;
else // comment
other;
>>> Line comment after non-block else body.
if (true) body; else other; // comment
<<<
if (true)
body;
else
other; // comment
>>> Line comment after block else body.
if (true) {body;} else {other;} // comment
<<<
if (true) {
body;
} else {
other;
} // comment
>>> Hanging line comment before infix condition.
if (// comment
a && b) { body; }
<<<
### The indentation is odd here because it's an odd place for a comment.
if ( // comment
a && b) {
body;
}
>>> Non-hanging line comment before infix condition.
if (
// comment
a && b) { body; }
<<<
### The indentation is odd here because it's an odd place for a comment.
if (
// comment
a && b) {
body;
}
>>> Hanging line comment before infix chain condition.
if (// comment
a && b && c) { body; }
<<<
### The indentation is odd here because it's an odd place for a comment.
if ( // comment
a && b && c) {
body;
}
>>> Non-hanging line comment before infix chain condition.
if (
// comment
a && b && c) { body; }
<<<
### The indentation is odd here because it's an odd place for a comment.
if (
// comment
a && b && c) {
body;
}