5
This was added to find some of the stuff that annoys Nicolai, such as:
6
if (a) throw wexception
7
("Message explaining what went wrong, using format "
8
"argument such as %u, %ill and %s",
9
7, -9380350846789, "hej");
11
He requires it to be formatted like this instead:
16
So a line with "for (a)", "if (a)" or "while (a)" must end with one of the
17
characters in the string "){};\". Although a comment at the end is allowed
18
(therefore the complex regexp).
20
It would indeed be inconsistent to wrap within the controlled statement without
21
wrapping before it. A justification to do that would be to save vertical screen
24
Do the same for do, else and return statements. Unfortunately it will miss
25
lines ending with do or else followed by something very short (a single letter,
28
because it has to allow "do if" and "else if".
31
error_msg = """Multiline conditional should break after conditional. if (a) blah... -> if (a) \\n blah"""
36
[^/\#"']|/([^/"']|"([^"\]|\\"|\\[^"])*"|'(\\[\'0nt]|[^\'])')|"([^"]|\\")*"|'(\\[\'0nt]|[^\'])'
39
(^|\t)((do|else)[ ]([^/i]|(i[^f]))|return[ ]+)|(for|if|while)[ ]*\((/[^/*]|[^/])*\)[ ]*
51
'if (condition) do_something',
52
'if (a) throw wexception',
62
'\return this is a doxygen comment',
64
'if (condition) do_something();',
65
'if (c) throw wexception("Something went wrong.");',
67
' ("calculated value for (%i, %i)",',