[PHP-DOC] cvs: phpdoc /en/reference/tokenizer constants.xml reference.xml /en/reference/tokenizer/functions token-get-all.xml

2004-01-07 Thread Ken Tossell
kennyt  Wed Jan  7 18:15:48 2004 EDT

  Modified files:  
/phpdoc/en/reference/tokenizer  constants.xml reference.xml 
/phpdoc/en/reference/tokenizer/functionstoken-get-all.xml 
  Log:
  Noted that T_ML_COMMENT = T_COMMENT in PHP 5. (#25659)
  Changed short_open_tags to full tag.
  
  
Index: phpdoc/en/reference/tokenizer/constants.xml
diff -u phpdoc/en/reference/tokenizer/constants.xml:1.2 
phpdoc/en/reference/tokenizer/constants.xml:1.3
--- phpdoc/en/reference/tokenizer/constants.xml:1.2 Wed May 28 19:03:10 2003
+++ phpdoc/en/reference/tokenizer/constants.xml Wed Jan  7 18:15:48 2004
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=iso-8859-1?
-!-- $Revision: 1.2 $ --
+!-- $Revision: 1.3 $ --
 section id=tokenizer.constants
  reftitle.constants;
  extension.constants;
@@ -1033,9 +1033,12 @@
 (typeinteger/type)
/term
listitem
-simpara
- 
-/simpara
+note
+ simpara
+  constantT_ML_COMMENT/constant is not defined in PHP 5.
+  All comments in PHP 5 are of token constantT_COMMENT/constant.
+ /simpara
+/note
/listitem
   /varlistentry
   varlistentry
Index: phpdoc/en/reference/tokenizer/reference.xml
diff -u phpdoc/en/reference/tokenizer/reference.xml:1.14 
phpdoc/en/reference/tokenizer/reference.xml:1.15
--- phpdoc/en/reference/tokenizer/reference.xml:1.14Fri Dec 19 10:50:00 2003
+++ phpdoc/en/reference/tokenizer/reference.xml Wed Jan  7 18:15:48 2004
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=iso-8859-1?
-!-- $Revision: 1.14 $ --
+!-- $Revision: 1.15 $ --
  reference id=ref.tokenizer
   titleTokenizer functions/title
   titleabbrevTokenizer/titleabbrev
@@ -42,6 +42,13 @@
 ?php
   $source = file_get_contents(somefile.php);
   $tokens = token_get_all($source);
+  /* T_ML_COMMENT does not exist in PHP 5.
+   * The following three lines define it in order to
+   * preserve backwards compatibility.
+   */
+  if (!defined('T_ML_COMMENT')) {
+define('T_ML_COMMENT', T_COMMENT);
+  }
   foreach ($tokens as $token) {
 if (is_string($token)) {
   // simple 1-character token
@@ -51,7 +58,7 @@
   list($id, $text) = $token;
   switch ($id) { 
 case T_COMMENT: 
-case T_ML_COMMENT:
+case T_ML_COMMENT: // we've defined this
   // no action on comments
   break;
 default:
Index: phpdoc/en/reference/tokenizer/functions/token-get-all.xml
diff -u phpdoc/en/reference/tokenizer/functions/token-get-all.xml:1.6 
phpdoc/en/reference/tokenizer/functions/token-get-all.xml:1.7
--- phpdoc/en/reference/tokenizer/functions/token-get-all.xml:1.6   Mon Dec 15 
11:53:25 2003
+++ phpdoc/en/reference/tokenizer/functions/token-get-all.xml   Wed Jan  7 18:15:48 
2004
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=iso-8859-1?
-!-- $Revision: 1.6 $ --
+!-- $Revision: 1.7 $ --
   refentry id=function.token-get-all
refnamediv
 refnametoken_get_all/refname
@@ -30,17 +30,17 @@
  programlisting role=php
 ![CDATA[
 ?php
-  $tokens = token_get_all('?'); // = array(array(T_OPEN_TAG, '?'));
-  $tokens = token_get_all('? echo; ?'); /* = array(
-array(T_OPEN_TAG, '?'), 
+  $tokens = token_get_all('?php'); // = array(array(T_OPEN_TAG, '?'));
+  $tokens = token_get_all('?php echo; ?'); /* = array(
+array(T_OPEN_TAG, '?php'), 
 array(T_ECHO, 'echo'),
 ';',
 array(T_CLOSE_TAG, '?') ); */
 
 /* Note in the following example that the string is parsed as T_INLINE_HTML
-   rather than the otherwise expected T_ML_COMMENT.
+   rather than the otherwise expected T_COMMENT (T_ML_COMMENT in PHP 5).
This is because no open/close tags were used in the code provided.
-   This would be equivalent to putting a comment outside of ? ? tags in a normal 
file. */
+   This would be equivalent to putting a comment outside of ?php ? tags in a normal 
file. */
   $tokens = token_get_all('/* comment */'); // = array(array(T_INLINE_HTML, '/* 
comment */'));
 ?
 ]]


[PHP-DOC] cvs: phpdoc /en/reference/tokenizer constants.xml reference.xml

2004-01-07 Thread Ken Tossell
kennyt  Wed Jan  7 20:09:34 2004 EDT

  Modified files:  
/phpdoc/en/reference/tokenizer  constants.xml reference.xml 
  Log:
  Added docs and example concerning T_DOC_COMMENT.
  
  
Index: phpdoc/en/reference/tokenizer/constants.xml
diff -u phpdoc/en/reference/tokenizer/constants.xml:1.3 
phpdoc/en/reference/tokenizer/constants.xml:1.4
--- phpdoc/en/reference/tokenizer/constants.xml:1.3 Wed Jan  7 18:15:48 2004
+++ phpdoc/en/reference/tokenizer/constants.xml Wed Jan  7 20:09:33 2004
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=iso-8859-1?
-!-- $Revision: 1.3 $ --
+!-- $Revision: 1.4 $ --
 section id=tokenizer.constants
  reftitle.constants;
  extension.constants;
@@ -1043,6 +1043,19 @@
   /varlistentry
   varlistentry
term
+constantT_DOC_COMMENT/constant
+(typeinteger/type)
+   /term
+   listitem
+note
+ simpara
+  constantT_DOC_COMMENT/constant was introduced in PHP 5.
+ /simpara
+/note
+   /listitem
+  /varlistentry
+  varlistentry
+   term
 constantT_OPEN_TAG/constant 
 (typeinteger/type)
/term
Index: phpdoc/en/reference/tokenizer/reference.xml
diff -u phpdoc/en/reference/tokenizer/reference.xml:1.15 
phpdoc/en/reference/tokenizer/reference.xml:1.16
--- phpdoc/en/reference/tokenizer/reference.xml:1.15Wed Jan  7 18:15:48 2004
+++ phpdoc/en/reference/tokenizer/reference.xml Wed Jan  7 20:09:33 2004
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=iso-8859-1?
-!-- $Revision: 1.15 $ --
+!-- $Revision: 1.16 $ --
  reference id=ref.tokenizer
   titleTokenizer functions/title
   titleabbrevTokenizer/titleabbrev
@@ -45,9 +45,14 @@
   /* T_ML_COMMENT does not exist in PHP 5.
* The following three lines define it in order to
* preserve backwards compatibility.
+   *
+   * The next two lines define the PHP5-only T_DOC_COMMENT,
+   * which we will mask as T_ML_COMMENT for PHP 4.
*/
   if (!defined('T_ML_COMMENT')) {
 define('T_ML_COMMENT', T_COMMENT);
+  } else {
+define('T_DOC_COMMENT', T_ML_COMMENT);
   }
   foreach ($tokens as $token) {
 if (is_string($token)) {
@@ -59,6 +64,7 @@
   switch ($id) { 
 case T_COMMENT: 
 case T_ML_COMMENT: // we've defined this
+case T_DOC_COMMENT: // and this
   // no action on comments
   break;
 default: