Author: kn
Date: Mon Feb 11 11:47:24 2008
New Revision: 7335

Log:
- Removed debug code and fixed docs

Modified:
    experimental/Document/src/document/rst/tokenizer.php
    experimental/Document/src/exceptions/rst_tokenizer.php

Modified: experimental/Document/src/document/rst/tokenizer.php
==============================================================================
--- experimental/Document/src/document/rst/tokenizer.php [iso-8859-1] (original)
+++ experimental/Document/src/document/rst/tokenizer.php [iso-8859-1] Mon Feb 
11 11:47:24 2008
@@ -97,37 +97,6 @@
         return $this->tokenizeString( file_get_contents( $file ) );
     }
 
-    protected function dumpTokenizerState( $line, $position, $tokens, $string )
-    {
-        $lastToken = end( $tokens );
-
-        // Get last 5 token in reverse order
-        $tokens = array_reverse( $tokens );
-        $lastTokensString = '';
-        foreach ( array_splice( $tokens, 0, 5 ) as $token )
-        {
-            $lastTokensString .= $token->type . ', ';
-        }
-
-        printf( 
-            "\nAt line %d char %d in string '%s'.\n",
-            $line, $position, substr( $string, 0, 20 )
-        );
-
-        if ( $lastToken )
-        {
-            printf( 
-                "- Last token read: (%d, '%s', %d:%d)\n",
-                $lastToken->type, $lastToken->content, $lastToken->line, 
$lastToken->position
-            );
-        }
-
-        printf( 
-            "- Last tokens in list: %s\n",
-            $lastTokensString
-        );
-    }
-
     /**
      * Tokenize the given string
      * 
@@ -149,12 +118,8 @@
         {
             foreach ( $this->tokens as $token => $expression )
             {
-//                $this->dumpTokenizerState( $line, $position, $tokens, 
$string );
-
                 if ( preg_match( $expression, $string, $matches ) )
                 {
-//                    echo "- Matched token $token (" . $matches['value'] . 
":" . strlen( $matches['value'] ) . ")\n";
-
                     // A token matched, so add the matched token to the token
                     // list and update all variables.
                     $tokens[] = new ezcDocumentRstToken(

Modified: experimental/Document/src/exceptions/rst_tokenizer.php
==============================================================================
--- experimental/Document/src/exceptions/rst_tokenizer.php [iso-8859-1] 
(original)
+++ experimental/Document/src/exceptions/rst_tokenizer.php [iso-8859-1] Mon Feb 
11 11:47:24 2008
@@ -18,9 +18,11 @@
 class ezcDocumentRstTokenizerException extends ezcDocumentException
 {
     /**
-     * Construct exception from array with XML errors
+     * Construct exception from errnous string and current position
      * 
-     * @param array $errors 
+     * @param int $line 
+     * @param int $position 
+     * @param string $string 
      * @return void
      */
     public function __construct( $line, $position, $string )


-- 
svn-components mailing list
[EMAIL PROTECTED]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to