function coder_preprocessor_switch_duplicate_exit in Coder 5.2
Same name and namespace in other branches
- 5 scripts/coder_format/coder_format.inc \coder_preprocessor_switch_duplicate_exit()
- 6.2 scripts/coder_format/coder_format.inc \coder_preprocessor_switch_duplicate_exit()
- 6 scripts/coder_format/coder_format.inc \coder_preprocessor_switch_duplicate_exit()
- 7.2 scripts/coder_format/coder_format.inc \coder_preprocessor_switch_duplicate_exit()
- 7 scripts/coder_format/coder_format.inc \coder_preprocessor_switch_duplicate_exit()
Related topics
File
- scripts/
coder_format/ coder_format.inc, line 1170
Code
function coder_preprocessor_switch_duplicate_exit() {
return array(
'#title' => 'Either exit a switch case with return *or* break.',
'#search' => '@
(return # match a return
\\s+ # - followed by some white-space
.+ # - followed by any characters
; # - followed by a semicolon
)
\\s+ # match white-space (required)
break; # match a directly following "break;"
@mx',
'#replace' => '$1',
);
}