Index: coder.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/coder/coder.module,v
retrieving revision 1.88.2.8
diff -u -r1.88.2.8 coder.module
--- coder.module 21 Nov 2007 13:50:56 -0000 1.88.2.8
+++ coder.module 21 Nov 2007 15:46:20 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: coder.module,v 1.88.2.8 2007/11/21 13:50:56 snpower Exp $
+// $Id: coder.module,v 1.88.2.7 2007/09/16 06:13:54 douggreen Exp $

 /** @file
  * Developer Module that assists with code review and version upgrade that
@@ -711,6 +711,7 @@
     $in_comment = 0;
     $beginning_of_line = 0;
     $in_php = 0;
+    $in_allphp = 0;
     $in_quote_html = 0;
     $in_backslash = 0;
     $in_quote = 0;
@@ -719,12 +720,14 @@
     $heredoc = '';
     $all_lines = array();
     $php_lines = array();
+    $allphp_lines = array();
     $html_lines = array();
     $quote_lines = array();
     $doublequote_lines = array();
     $comment_lines = array();
     $this_all_lines = '';
     $this_php_lines = '';
+    $this_allphp_lines = '';
     $this_html_lines = '';
     $this_quote_lines = '';
     $this_doublequote_lines = '';
@@ -753,6 +756,9 @@
           if (trim($this_php_lines) != '') {
             $php_lines[$lineno] = $this_php_lines;
           }
+          if (trim($this_allphp_lines) != '') {
+            $allphp_lines[$lineno] = $this_allphp_lines;
+          }
           if (trim($this_html_lines) != '') {
             $html_lines[$lineno] = $this_html_lines;
           }
@@ -771,6 +777,7 @@
         $lineno ++;
         $this_all_lines = '';
         $this_php_lines = '';
+        $this_allphp_lines = '';
         $this_html_lines = '';
         $this_quote_lines = '';
         $this_doublequote_lines = '';
@@ -783,7 +790,7 @@
       }
       $this_all_lines .= $char;

-      if ($in_php) {
+      if ($in_php || $in_allphp) {
         // when in a quoted string, look for the trailing quote
         // strip characters in the string, replacing with '' or ""
         if ($in_quote) {
@@ -811,6 +818,7 @@
           if ($char == $in_quote_html) {
             $in_quote_html = 0;
           }
+          $this_allphp_lines .= $char;
           unset($char); // NOTE: trailing char output with starting one
         }

@@ -836,6 +844,7 @@
         elseif ($char == '?' && $content[$pos + 1] == '>') {
           unset($char);
           $in_php = 0;
+          $in_allphp = 0;
           $this_all_lines .= '>';
           $pos ++;
         }
@@ -897,6 +906,7 @@

                 // replace heredoc's with an empty string
                 $this_php_lines .= '\'\'';
+                $this_allphp_lines .= '\'\'';
                 unset($char);
               }
               break;
@@ -904,6 +914,7 @@
         }
         if (isset($char)) {
           $this_php_lines .= $char;
+          $this_allphp_lines .= $char;
         }
       }
       else {
@@ -912,11 +923,13 @@
             if ($content[$pos + 1] == '?') {
               if ($content[$pos + 2] == ' ') {
                 $in_php = 1;
+                $in_allphp = 1;
                 $this_all_lines .= '? ';
                 $pos += 2;
               }
               elseif (substr($content, $pos + 2, 3) == 'php') {
                 $in_php = 1;
+                $in_allphp = 1;
                 $this_all_lines .= '?php';
                 $pos += 4;
               }
@@ -936,6 +949,9 @@
     if (trim($this_php_lines) != '') {
       $php_lines[$lineno] = $this_php_lines;
     }
+    if (trim($this_allphp_lines) != '') {
+      $allphp_lines[$lineno] = $this_allphp_lines;
+    }
     if (trim($this_html_lines) != '') {
       $html_lines[$lineno] = $this_html_lines;
     }
@@ -952,6 +968,7 @@
     // add the files lines to the arguments
     $coder_args['#all_lines'] = $all_lines;
     $coder_args['#php_lines'] = $php_lines;
+    $coder_args['#allphp_lines'] = $allphp_lines;
     $coder_args['#html_lines'] = $html_lines;
     $coder_args['#quote_lines'] = $quote_lines;
     $coder_args['#doublequote_lines'] = $doublequote_lines;
@@ -1009,7 +1026,7 @@
         if (isset($rule['#original'])) { // deprecated
           $lines = $coder_args['#all_lines'];
         }
-        elseif (isset($rule['#source'])) { // all, html, comment, or php
+        elseif (isset($rule['#source'])) { // all, html, comment, allphp or php
           $source = '#'. $rule['#source'] .'_lines';
           $lines = $coder_args[$source];
         }
