function coder_preprocessor_inline_comment in Coder 7.2
Same name and namespace in other branches
- 5.2 scripts/coder_format/coder_format.inc \coder_preprocessor_inline_comment()
- 5 scripts/coder_format/coder_format.inc \coder_preprocessor_inline_comment()
- 6.2 scripts/coder_format/coder_format.inc \coder_preprocessor_inline_comment()
- 6 scripts/coder_format/coder_format.inc \coder_preprocessor_inline_comment()
- 7 scripts/coder_format/coder_format.inc \coder_preprocessor_inline_comment()
Related topics
File
- scripts/
coder_format/ coder_format.inc, line 1201 - Coder format helper functions.
Code
function coder_preprocessor_inline_comment() {
return array(
'#title' => 'Move inline comments above remarked line.',
'#weight' => 2,
'#search' => '@
^([\\040\\t]*) # match spaces or tabs only.
(?!case) # do not match case statements.
(\\S.+? # do not match lines containing only a comment.
[;,{] # match the TRICKY lines only.
)
[\\040\\t]* # match spaces or tabs only.
(?!:) # do not match URL protocols.
//\\s* # match inline comment token.
([^;\\$]+?)$ # fetch comment, but do not match CVS keyword Id, nested comments, and comment tokens in quotes (f.e. "W3C//DTD").
@mx',
'#replace' => "\$1// \$3\n\$1\$2",
);
}