You are here

function coder_preprocessor_inline_comment in Coder 5

Same name and namespace in other branches
  1. 5.2 scripts/coder_format/coder_format.inc \coder_preprocessor_inline_comment()
  2. 6.2 scripts/coder_format/coder_format.inc \coder_preprocessor_inline_comment()
  3. 6 scripts/coder_format/coder_format.inc \coder_preprocessor_inline_comment()
  4. 7.2 scripts/coder_format/coder_format.inc \coder_preprocessor_inline_comment()
  5. 7 scripts/coder_format/coder_format.inc \coder_preprocessor_inline_comment()

Related topics

File

scripts/coder_format/coder_format.inc, line 842

Code

function coder_preprocessor_inline_comment() {
  return array(
    '#title' => 'Move inline comments above remarked line.',
    '#weight' => 2,
    // [\040\t] matches only a space or tab
    // (?!case) prevents matching of case statements
    // \S prevents matching of lines containing only a comment
    // [^:] prevents matching of URL protocols
    // [^;\$] prevents matching of CVS keyword Id comment and double slashes
    //   in quotes (f.e. "W3C//DTD")
    '#search' => '@^([\\040\\t]*)(?!case)(\\S.+?)[\\040\\t]*[^:]//\\s*([^;\\$]+?)$@m',
    '#replace' => "\$1// \$3\n\$1\$2",
  );
}