[Dojo-checkins] pottedmeat - r11337 - util/trunk/docscripts/lib/parser

dojo-checkins-admin at dojotoolkit.org dojo-checkins-admin at dojotoolkit.org
Fri Nov 2 12:59:58 UTC 2007


Author: pottedmeat
Date: Fri Nov  2 12:59:58 2007
New Revision: 11337

Modified:
   util/trunk/docscripts/lib/parser/DojoPackage.php
Log:
Refs #4686. Make sure that ====== comment blocks are extracted properly


Modified: util/trunk/docscripts/lib/parser/DojoPackage.php
==============================================================================
--- util/trunk/docscripts/lib/parser/DojoPackage.php	(original)
+++ util/trunk/docscripts/lib/parser/DojoPackage.php	Fri Nov  2 12:59:58 2007
@@ -202,16 +202,25 @@
     $lines[] = '';
     $in_comment = false;
     foreach ($lines as $line_number => $line) {
-      if (!$in_comment) {
-        if (preg_match('%/\*={5,}%', $line, $match)) {
+      $pos = 0;
+      $found = true;
+      while ($found) {
+        $found = false;
+        if (!$in_comment) {
+          if (preg_match('%/\*={5,}%', $line, $match, PREG_OFFSET_CAPTURE, $pos)) {
+            $lines[$line_number] = Text::blankOut($match[0][0], $line);
+            $found = true;
+            $in_comment = true;
+            $pos = $match[0][1] + strlen($match[0][0]);
+          }
+        }
+        elseif (preg_match('%={5,}\*/%', $line, $match, PREG_OFFSET_CAPTURE, $pos)) {
           $lines[$line_number] = Text::blankOut($match[0], $line);
-          $in_comment = true;
+          $found = true;
+          $in_comment = false;
+          $pos = $match[0][1] + strlen($match[0][0]);
         }
       }
-      elseif (preg_match('%={5,}\*/%', $line, $match)) {
-        $lines[$line_number] = Text::blankOut($match[0], $line);
-        $in_comment = false;
-      }
     }
     return $this->source = $lines;
   }


More information about the Dojo-checkins mailing list