cvs: pear /PHP_Parser/Parser/DocBlock DefaultLexer.lex DefaultLexer.php /PHP_Parser/tests PHP_Parser_DocBlock_DefaultLexer_tag_test.php
| From: | Greg Beaver | Date: | Wed, 07 Apr 2004 17:17:55 +0000 |
| Subject: | cvs: pear /PHP_Parser/Parser/DocBlock DefaultLexer.lex DefaultLexer.php /PHP_Parser/tests PHP_Parser_DocBlock_DefaultLexer_tag_test.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-17983@lists.php.net to get a copy of this message | ||
cellog Wed Apr 7 13:17:55 2004 EDT
Modified files:
/pear/PHP_Parser/Parser/DocBlock DefaultLexer.lex DefaultLexer.php
/pear/PHP_Parser/tests
PHP_Parser_DocBlock_DefaultLexer_tag_test.php
Log:
finish all unit tests for DefaultLexer!
http://cvs.php.net/diff.php/pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex?r1=1.12&r2=1.13&ty=u Index: pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex diff -u pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex:1.12 pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex:1.13 --- pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex:1.12 Wed Apr 7 12:55:08 2004 +++ pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex Wed Apr 7 13:17:55 2004 @@ -16,7 +16,7 @@ // | Authors: Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: DefaultLexer.lex,v 1.12 2004/04/07 16:55:08 cellog Exp $ +// $Id: DefaultLexer.lex,v 1.13 2004/04/07 17:17:55 cellog Exp $ // require_once 'PEAR/ErrorStack.php'; @@ -585,7 +585,7 @@ return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } -<YYINITIAL, INLINEINTERNALTAG> [\n]+ { +<YYINITIAL, INLINEINTERNALTAG, INTAG> [\n]+ { if (strlen($this->yytext()) >= 2) { $this->yy_buffer_index = $this->yy_buffer_end = $this->yy_buffer_start + 2; if ($this->debug) echo "initial double newline ".strlen($this->yytext())."\n"; @@ -595,13 +595,6 @@ return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } -<INTAG> [\n]+ { - if ($this->debug) echo "tags newline\n"; - $this->_atNewLine = true; - $this->yy_buffer_end = $this->yy_buffer_index = $this->yy_buffer_start + 1; - return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); -} - <INTAG> [^\n{<]+ { $test = trim($this->yytext()); if (strlen($test)) { http://cvs.php.net/diff.php/pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php?r1=1.10&r2=1.11&ty=u Index: pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php diff -u pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php:1.10 pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php:1.11 --- pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php:1.10 Wed Apr 7 12:55:08 2004 +++ pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php Wed Apr 7 13:17:55 2004 @@ -16,7 +16,7 @@ // | Authors: Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: DefaultLexer.php,v 1.10 2004/04/07 16:55:08 cellog Exp $ +// $Id: DefaultLexer.php,v 1.11 2004/04/07 17:17:55 cellog Exp $ // require_once 'PEAR/ErrorStack.php'; define('PHP_Parser_DocBlock_DefaultLexer_ERROR', 1); @@ -613,8 +613,8 @@ /* 27 */ YY_NO_ANCHOR, /* 28 */ YY_NO_ANCHOR, /* 29 */ YY_NO_ANCHOR, - /* 30 */ YY_NO_ANCHOR, - /* 31 */ YY_NOT_ACCEPT, + /* 30 */ YY_NOT_ACCEPT, + /* 31 */ YY_NO_ANCHOR, /* 32 */ YY_NO_ANCHOR, /* 33 */ YY_NO_ANCHOR, /* 34 */ YY_NO_ANCHOR, @@ -735,12 +735,12 @@ 0, 1, 2, 3, 4, 5, 1, 6, 7, 7, 7, 7, 1, 8, 8, 9, 1, 10, 7, 11, 12, 13, 14, 15, - 16, 17, 1, 18, 18, 1, 1, 7, - 17, 19, 1, 1, 1, 1, 20, 21, + 16, 1, 17, 17, 1, 1, 7, 18, + 16, 19, 1, 1, 1, 1, 20, 21, 22, 1, 6, 23, 7, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 28, 17, 46, 47, 48, + 43, 44, 45, 28, 16, 46, 47, 48, 49, 50, 51, 52, 53, 54, 14, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, @@ -762,14 +762,14 @@ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), - array( -1, -1, 3, 31, 3, 3, 3, 3, + array( -1, -1, 3, 30, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 42, 3, 3, 3, 3, 3, 3, 3 ), - array( -1, 5, 31, 96, 101, 46, 46, 46, - 46, 33, 31, 46, 46, 46, 44, 31, - 31, 42, 31, 46, 46, 46, 46, 46, - 31 ), + array( -1, 5, 30, 96, 101, 46, 46, 46, + 46, 33, 30, 46, 46, 46, 44, 30, + 30, 42, 30, 46, 46, 46, 46, 46, + 30 ), array( -1, 5, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -778,10 +778,10 @@ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), - array( -1, -1, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), + array( -1, -1, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), array( -1, -1, -1, -1, -1, 13, 13, 13, 13, -1, -1, 13, 13, 13, -1, -1, -1, -1, -1, 13, 13, 13, 13, 13, @@ -790,7 +790,7 @@ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39 ), - array( -1, -1, 64, 31, 17, 17, 17, 17, + array( -1, -1, 64, 30, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 42, 17, 17, 17, 17, 17, 17, 17 ), @@ -810,26 +810,26 @@ 22, -1, -1, 22, 22, 22, -1, -1, -1, -1, -1, 22, 22, 22, 22, 22, -1 ), - array( -1, 23, -1, -1, -1, -1, -1, -1, - -1, 77, -1, -1, -1, -1, -1, 78, - -1, -1, -1, -1, -1, -1, -1, -1, - -1 ), - array( -1, -1, 24, -1, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, - 24, -1, 24, 24, 24, 24, 24, 24, - 24 ), + array( -1, -1, 23, -1, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, -1, 23, 23, 23, 23, 23, 23, + 23 ), array( -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), - array( -1, 28, 28, -1, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, - 28, -1, 28, 28, 28, 28, 28, 28, - 28 ), - array( -1, 5, 31, 31, 31, 31, 31, 31, - 31, 33, 31, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), + array( -1, 27, 27, -1, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, -1, 27, 27, 27, 27, 27, 27, + 27 ), + array( -1, 31, -1, -1, -1, -1, -1, -1, + -1, 77, -1, -1, -1, -1, -1, 78, + -1, -1, -1, -1, -1, -1, -1, -1, + -1 ), + array( -1, 5, 30, 30, 30, 30, 30, 30, + 30, 33, 30, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), array( -1, -1, -1, -1, -1, 13, 13, 13, 13, -1, -1, 13, 13, 13, -1, -1, -1, -1, -1, 13, 13, 13, 13, 14, @@ -850,26 +850,26 @@ 40, 40, 40, 40, 40, 40, 40, 40, 40, -1, 40, 40, 40, 40, 40, 40, 40 ), - array( -1, 52, 31, 31, 53, 46, 46, 46, - 46, 54, 8, 46, 46, 46, 31, 31, - 31, 42, 31, 46, 46, 46, 46, 46, - 31 ), - array( -1, -1, 31, 96, 101, 46, 46, 46, - 46, 31, 31, 46, 46, 46, 31, 31, - 31, 42, 31, 46, 46, 46, 46, 46, - 31 ), - array( -1, 98, 31, 31, 102, 48, 48, 48, - 48, 55, 56, 48, 48, 48, 31, 31, - 31, 42, 31, 48, 48, 48, 48, 48, - 31 ), + array( -1, 52, 30, 30, 53, 46, 46, 46, + 46, 54, 8, 46, 46, 46, 30, 30, + 30, 42, 30, 46, 46, 46, 46, 46, + 30 ), + array( -1, -1, 30, 96, 101, 46, 46, 46, + 46, 30, 30, 46, 46, 46, 30, 30, + 30, 42, 30, 46, 46, 46, 46, 46, + 30 ), + array( -1, 98, 30, 30, 102, 48, 48, 48, + 48, 55, 56, 48, 48, 48, 30, 30, + 30, 42, 30, 48, 48, 48, 48, 48, + 30 ), array( -1, -1, -1, 69, 99, 70, 70, 70, 70, -1, -1, 70, 70, 70, -1, -1, -1, -1, -1, 70, 70, 70, 70, 70, -1 ), - array( -1, -1, 31, 31, 31, 50, 50, 50, - 50, 31, 9, 50, 50, 50, 31, 31, - 31, 42, 31, 50, 50, 50, 50, 50, - 31 ), + array( -1, -1, 30, 30, 30, 50, 50, 50, + 50, 30, 9, 50, 50, 50, 30, 30, + 30, 42, 30, 50, 50, 50, 50, 50, + 30 ), array( -1, -1, -1, 82, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -878,22 +878,22 @@ -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), - array( -1, -1, 31, 31, 31, 31, 31, 31, - 31, 31, 10, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), - array( -1, 52, 31, 31, 53, 31, 31, 31, - 31, 54, 31, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), - array( -1, 98, 31, 31, 102, 31, 31, 31, - 31, 55, 31, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), - array( -1, -1, 31, 31, 31, 31, 31, 31, - 31, 31, 11, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), + array( -1, -1, 30, 30, 30, 30, 30, 30, + 30, 30, 10, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), + array( -1, 52, 30, 30, 53, 30, 30, 30, + 30, 54, 30, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), + array( -1, 98, 30, 30, 102, 30, 30, 30, + 30, 55, 30, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), + array( -1, -1, 30, 30, 30, 30, 30, 30, + 30, 30, 11, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), array( -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -922,7 +922,7 @@ 17, 17, 17, 17, 17, 17, 17, 17, 17, 32, 17, 17, 17, 17, 17, 17, 17 ), - array( -1, 40, 31, 17, 17, 17, 17, 17, + array( -1, 40, 30, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 45, 17, 17, 17, 17, 17, 17, 17 ), @@ -970,18 +970,18 @@ -1, 77, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), - array( 1, 23, 24, 49, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, - 24, 25, 24, 24, 24, 24, 24, 24, - 24 ), - array( 1, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, - -1, 26, 26, 26, 26, 26, 26, 26, - 26 ), - array( 1, 27, 28, 51, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, - 28, 32, 28, 28, 28, 28, 28, 28, - 28 ), + array( 1, 31, 23, 49, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 24, 23, 23, 23, 23, 23, 23, + 23 ), + array( 1, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, + -1, 25, 25, 25, 25, 25, 25, 25, + 25 ), + array( 1, 26, 27, 51, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 32, 27, 27, 27, 27, 27, 27, + 27 ), array( -1, -1, -1, -1, 83, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -1007,7 +1007,7 @@ -1, -1, -1, -1, -1, -1, -1, -1, -1 ), array( -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 29, -1, -1, -1, -1, -1, + -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), array( -1, -1, -1, -1, 90, -1, -1, -1, @@ -1031,17 +1031,17 @@ -1, -1, -1, -1, -1, -1, -1, -1, -1 ), array( -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 30, -1, -1, -1, -1, -1, + -1, -1, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), array( -1, -1, -1, -1, -1, 13, 13, 13, 13, -1, -1, 13, 13, 13, -1, -1, -1, -1, -1, 13, 13, 13, 38, 13, -1 ), - array( -1, -1, 31, 31, 31, 48, 48, 48, - 48, 31, 31, 48, 48, 48, 31, 31, - 31, 42, 31, 48, 48, 48, 48, 48, - 31 ), + array( -1, -1, 30, 30, 30, 48, 48, 48, + 48, 30, 30, 48, 48, 48, 30, 30, + 30, 42, 30, 48, 48, 48, 48, 48, + 30 ), array( -1, -1, -1, 89, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -1054,18 +1054,18 @@ 72, -1, -1, 72, 72, 72, -1, -1, -1, -1, -1, 72, 72, 72, 72, 72, -1 ), - array( 1, 27, 28, 97, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, - 28, 32, 28, 28, 28, 28, 28, 28, - 28 ), - array( -1, -1, 31, 31, 31, 50, 50, 50, - 50, 31, 31, 50, 50, 50, 31, 31, - 31, 42, 31, 50, 50, 50, 50, 50, - 31 ), - array( -1, -1, 31, 31, 31, 31, 31, 31, - 31, 31, 56, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), + array( 1, 26, 27, 97, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 32, 27, 27, 27, 27, 27, 27, + 27 ), + array( -1, -1, 30, 30, 30, 50, 50, 50, + 50, 30, 30, 50, 50, 50, 30, 30, + 30, 42, 30, 50, 50, 50, 50, 50, + 30 ), + array( -1, -1, 30, 30, 30, 30, 30, 30, + 30, 30, 56, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), array( -1, -1, -1, -1, -1, 13, 13, 13, 13, -1, -1, 13, 13, 13, -1, -1, -1, -1, -1, 13, 95, 13, 13, 13, @@ -1502,13 +1502,6 @@ } case 23: { - if ($this->debug) echo "tags newline\n"; - $this->_atNewLine = true; - $this->yy_buffer_end = $this->yy_buffer_index = $this->yy_buffer_start + 1; - return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); -} -case 24: -{ $test = trim($this->yytext()); if (strlen($test)) { $whitespace = substr($this->yytext(), 0, strpos($this->yytext(), $test)); @@ -1559,38 +1552,48 @@ return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } } -case 25: +case 24: { if ($this->debug) echo "in tag normal bracket [{]\n"; return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } -case 26: +case 25: { if ($this->debug) echo "inline tag name [".$this->_tagName."]\n"; $this->yybegin(INLINETAG); $this->yy_buffer_end = $this->yy_buffer_index = $this->yy_buffer_start; return array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, $this->_tagName); } -case 27: +case 26: { if ($this->debug) echo '<code> newline ['.$this->yytext()."]\n"; return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } -case 28: +case 27: { if ($this->debug) echo "normal code text [".$this->yytext()."]\n"; return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } -case 29: +case 28: { if ($this->debug) echo "escaped tag [".$this->yytext()."]\n"; return array(PHP_PARSER_DOCLEX_ESCAPED_TAG, $this->yytext()); } -case 30: +case 29: { if ($this->debug) echo "escaped tag [".$this->yytext()."]\n"; return array(PHP_PARSER_DOCLEX_ESCAPED_TAG, $this->yytext()); } +case 31: +{ + if (strlen($this->yytext()) >= 2) { + $this->yy_buffer_index = $this->yy_buffer_end = $this->yy_buffer_start + 2; + if ($this->debug) echo "initial double newline ".strlen($this->yytext())."\n"; + return array(PHP_PARSER_DOCLEX_DOUBLENL, $this->yytext()); + } + if ($this->debug) echo "initial newline ".strlen($this->yytext())."\n"; + return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); +} case 32: { if ($this->debug) echo "everything else[" .$this->yytext()."]\n"; @@ -1933,4 +1936,4 @@ } return null; } -} \ No newline at end of file +} http://cvs.php.net/diff.php/pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php?r1=1.2&r2=1.3&ty=u Index: pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php diff -u pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php:1.2 pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php:1.3 --- pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php:1.2 Wed Apr 7 12:55:08 2004 +++ pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php Wed Apr 7 13:17:55 2004 @@ -3,7 +3,7 @@ /** * API Unit tests for PHP_Parser package. * - * @version $Id: PHP_Parser_DocBlock_DefaultLexer_tag_test.php,v 1.2 2004/04/07 16:55:08 cellog Exp $ + * @version $Id: PHP_Parser_DocBlock_DefaultLexer_tag_test.php,v 1.3 2004/04/07 17:17:55 cellog Exp $ * @author Laurent Laville <pear@laurent-laville.org> portions from HTML_CSS * @author Greg Beaver * @package PHP_Parser @@ -263,50 +263,58 @@ array(PHP_PARSER_DOCLEX_CLOSE_PRE, '</pre>'), array(PHP_PARSER_DOCLEX_TEXT, " < test bracket"), ), $data, 'tags failed 1'); - $this->lexer->setup('</b><samp></samp><kbd>'); + $this->lexer->setup('@since </b><samp></samp><kbd>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_CLOSE_B, '</b>'), array(PHP_PARSER_DOCLEX_OPEN_SAMP, '<samp>'), array(PHP_PARSER_DOCLEX_CLOSE_SAMP, '</samp>'), array(PHP_PARSER_DOCLEX_OPEN_KBD, '<kbd>'), ), $data, 'tags failed 2'); - $this->lexer->setup('</kbd><code></code><ol>'); + $this->lexer->setup('@since </kbd><code></code><ol>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_CLOSE_KBD, '</kbd>'), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), array(PHP_PARSER_DOCLEX_CLOSE_CODE, '</code>'), array(PHP_PARSER_DOCLEX_OPEN_LIST, '<ol>'), ), $data, 'tags failed 3'); - $this->lexer->setup('</ol><li></li><ul></ul>'); + $this->lexer->setup('@since </ol><li></li><ul></ul>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_CLOSE_LIST, '</ol>'), array(PHP_PARSER_DOCLEX_OPEN_LI, '<li>'), array(PHP_PARSER_DOCLEX_CLOSE_LI, '</li>'), array(PHP_PARSER_DOCLEX_OPEN_LIST, '<ul>'), array(PHP_PARSER_DOCLEX_CLOSE_LIST, '</ul>'), ), $data, 'tags failed 4'); - $this->lexer->setup('<strong></i></strong><em></em><var></var><i>'); + $this->lexer->setup('@since <strong></i></strong><em></em><var></var><i>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_B, '<strong>'), array(PHP_PARSER_DOCLEX_CLOSE_I, '</i>'), array(PHP_PARSER_DOCLEX_CLOSE_B, '</strong>'), @@ -326,7 +334,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<pre> + $this->lexer->setup('@since <pre> testing my this has <b> lots of doohickeys<</pre>><</pre >><</code>><</code >> </pre>'); $data = array(); @@ -335,6 +343,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_PRE, '<pre>'), array(PHP_PARSER_DOCLEX_TEXT, "\ntesting my this has <b> lots of doohickeys"), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<</pre>>'), @@ -352,7 +362,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<code> + $this->lexer->setup('@since <code> testing my this has <b> lots of doohickeys<</pre>><</code>><</code >> </code>'); $data = array(); @@ -361,6 +371,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), array(PHP_PARSER_DOCLEX_TEXT, "\ntesting my this has <b> lots of doohickeys<</pre>>"), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<</code>>'), @@ -378,13 +390,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<<one>><<two />>'); + $this->lexer->setup('@since <<one>><<two />>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<<one>>'), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<<two />>'), ), $data, 'escaped tag'); @@ -398,13 +412,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<br/><br />'); + $this->lexer->setup('@since <br/><br />'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_XML_TAG, '<br/>'), array(PHP_PARSER_DOCLEX_XML_TAG, '<br />'), ), $data, 'complete tag'); @@ -418,7 +434,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup(' + $this->lexer->setup('@since '); $data = array(); @@ -427,10 +443,11 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_DOUBLENL, "\n\n"), ), $data, 'first doublenl'); - $this->lexer->setup('testing my theory + $this->lexer->setup('@since testing my theory this is some text and some more text here we go @@ -443,7 +460,8 @@ } $this->assertEquals( array( - array(PHP_PARSER_DOCLEX_TEXT, "testing my theory\nthis is some text"), + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, " testing my theory\nthis is some text"), array(PHP_PARSER_DOCLEX_DOUBLENL, "\n\n"), array(PHP_PARSER_DOCLEX_TEXT, "and some more text here we go\nisn't this fun?"), array(PHP_PARSER_DOCLEX_DOUBLENL, "\n\n"), @@ -459,36 +477,42 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@inheritdoc}'); + $this->lexer->setup('@since {@inheritdoc}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'inheritdoc'), array(PHP_PARSER_DOCLEX_INLINE_TAG_CLOSE, '}'), ), $data, 'inline tag'); - $this->lexer->setup('{@link somefoo someotherfoo}'); + $this->lexer->setup('@since {@link somefoo someotherfoo}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'link'), array(PHP_PARSER_DOCLEX_INLINE_TAG_CONTENTS, ' somefoo someotherfoo'), array(PHP_PARSER_DOCLEX_INLINE_TAG_CLOSE, '}'), ), $data, 'inline tag contents'); - $this->lexer->setup('<code>{@id 3}</code>'); + $this->lexer->setup('@since <code>{@id 3}</code>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'id'), @@ -496,13 +520,15 @@ array(PHP_PARSER_DOCLEX_INLINE_TAG_CLOSE, '}'), array(PHP_PARSER_DOCLEX_CLOSE_CODE, '</code>'), ), $data, 'inline tag code'); - $this->lexer->setup('<pre>{@id 4}</pre>'); + $this->lexer->setup('@since <pre>{@id 4}</pre>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_PRE, '<pre>'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'id'), @@ -530,7 +556,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup(' - first item + $this->lexer->setup('@since - first item - second item - third item'); $data = array(); @@ -539,6 +565,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "-"), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -552,7 +579,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST, ' third item'), array(YY_EOF, ''), ), $data, 'simple list 1'); - $this->lexer->setup(' o first item + $this->lexer->setup('@since o first item o second item o third item'); $data = array(); @@ -561,6 +588,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "o"), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -574,7 +602,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST, ' third item'), array(YY_EOF, ''), ), $data, 'simple list 1.1'); - $this->lexer->setup(' 1 first item + $this->lexer->setup('@since 1 first item 2 second item 3 third item'); $data = array(); @@ -583,6 +611,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_NBULLET, "1"), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -596,7 +625,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST, ' third item'), array(YY_EOF, ''), ), $data, 'simple list 2'); - $this->lexer->setup(' 1. first item + $this->lexer->setup('@since 1. first item 2. second item 3. third item'); $data = array(); @@ -605,6 +634,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_NDBULLET, "1."), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -628,7 +658,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<b> + $this->lexer->setup('@since <b> - first item - second item - third item @@ -639,6 +669,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_B, '<b>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), @@ -655,7 +687,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_NL, "\n"), array(PHP_PARSER_DOCLEX_CLOSE_B, '</b>'), ), $data, 'simple list 1'); - $this->lexer->setup('<i> + $this->lexer->setup('@since <i> o first item o second item o third item @@ -666,6 +698,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_I, '<i>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), @@ -682,7 +716,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_NL, "\n"), array(PHP_PARSER_DOCLEX_CLOSE_I, '</i>'), ), $data, 'simple list 1.1'); - $this->lexer->setup('<kbd> + $this->lexer->setup('@since <kbd> 1 first item 2 second item 3 third item @@ -693,6 +727,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_KBD, '<kbd>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), @@ -709,7 +745,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_NL, "\n"), array(PHP_PARSER_DOCLEX_CLOSE_KBD, '</kbd>'), ), $data, 'simple list 2'); - $this->lexer->setup('<samp> + $this->lexer->setup('@since <samp> 1. first item 2. second item 3. third item @@ -720,6 +756,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_SAMP, '<samp>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), @@ -747,7 +785,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup(' - first item + $this->lexer->setup('@since - first item 1 nested first 2 nested second - second item @@ -764,6 +802,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "-"), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -816,7 +855,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<var> + $this->lexer->setup('@since <var> - first item 1 nested first 2 nested second @@ -834,6 +873,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_VAR, '<var>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), @@ -888,13 +929,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal}}'); + $this->lexer->setup('@since {@internal}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 1'); @@ -908,13 +951,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<b></p><pre></pre>}}'); + $this->lexer->setup('@since {@internal<b></p><pre></pre>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_B, '<b>'), array(PHP_PARSER_DOCLEX_CLOSE_P, '</p>'), @@ -922,13 +967,15 @@ array(PHP_PARSER_DOCLEX_CLOSE_PRE, '</pre>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'tags failed 1'); - $this->lexer->setup('{@internal</b><samp></samp><kbd>}}'); + $this->lexer->setup('@since {@internal</b><samp></samp><kbd>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_CLOSE_B, '</b>'), array(PHP_PARSER_DOCLEX_OPEN_SAMP, '<samp>'), @@ -936,13 +983,15 @@ array(PHP_PARSER_DOCLEX_OPEN_KBD, '<kbd>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'tags failed 2'); - $this->lexer->setup('{@internal</kbd><code></code><ol>}}'); + $this->lexer->setup('@since {@internal</kbd><code></code><ol>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_CLOSE_KBD, '</kbd>'), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), @@ -950,13 +999,15 @@ array(PHP_PARSER_DOCLEX_OPEN_LIST, '<ol>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'tags failed 3'); - $this->lexer->setup('{@internal</ol><li></li><ul></ul>}}'); + $this->lexer->setup('@since {@internal</ol><li></li><ul></ul>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_CLOSE_LIST, '</ol>'), array(PHP_PARSER_DOCLEX_OPEN_LI, '<li>'), @@ -965,13 +1016,15 @@ array(PHP_PARSER_DOCLEX_CLOSE_LIST, '</ul>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'tags failed 4'); - $this->lexer->setup('{@internal<strong></i></strong><em></em><var></var><i>}}'); + $this->lexer->setup('@since {@internal<strong></i></strong><em></em><var></var><i>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_B, '<strong>'), array(PHP_PARSER_DOCLEX_CLOSE_I, '</i>'), @@ -993,7 +1046,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<pre> + $this->lexer->setup('@since {@internal<pre> testing my this has <b> lots of doohickeys<</pre>><</pre >><</code>><</code >> </pre>}}'); $data = array(); @@ -1002,6 +1055,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_PRE, '<pre>'), array(PHP_PARSER_DOCLEX_TEXT, "\ntesting my this has <b> lots of doohickeys"), @@ -1021,7 +1076,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<code> + $this->lexer->setup('@since {@internal<code> testing my this has <b> lots of doohickeys<</pre>><</code>><</code >> </code>}}'); $data = array(); @@ -1030,6 +1085,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), array(PHP_PARSER_DOCLEX_TEXT, "\ntesting my this has <b> lots of doohickeys<</pre>>"), @@ -1049,13 +1106,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<<one>><<two />>}}'); + $this->lexer->setup('@since {@internal<<one>><<two />>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<<one>>'), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<<two />>'), @@ -1071,13 +1130,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<br/><br />}}'); + $this->lexer->setup('@since {@internal<br/><br />}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_XML_TAG, '<br/>'), array(PHP_PARSER_DOCLEX_XML_TAG, '<br />'), @@ -1093,7 +1154,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal + $this->lexer->setup('@since {@internal }}'); $data = array(); @@ -1102,12 +1163,14 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_DOUBLENL, "\n\n"), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'first doublenl'); - $this->lexer->setup('{@internal testing my theory + $this->lexer->setup('@since {@internal testing my theory this is some text and some more text here we go @@ -1120,6 +1183,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_TEXT, " testing my theory\nthis is some text"), array(PHP_PARSER_DOCLEX_DOUBLENL, "\n\n"), @@ -1138,26 +1203,30 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal{@inheritdoc}}}'); + $this->lexer->setup('@since {@internal{@inheritdoc}}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'inheritdoc'), array(PHP_PARSER_DOCLEX_INLINE_TAG_CLOSE, '}'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'inline tag'); - $this->lexer->setup('{@internal{@link somefoo someotherfoo}}}'); + $this->lexer->setup('@since {@internal{@link somefoo someotherfoo}}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'link'), @@ -1165,13 +1234,15 @@ array(PHP_PARSER_DOCLEX_INLINE_TAG_CLOSE, '}'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'inline tag contents'); - $this->lexer->setup('{@internal<code>{@id 3}</code>}}'); + $this->lexer->setup('@since {@internal<code>{@id 3}</code>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), @@ -1181,13 +1252,15 @@ array(PHP_PARSER_DOCLEX_CLOSE_CODE, '</code>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'inline tag code'); - $this->lexer->setup('{@internal<pre>{@id 4}</pre>}}'); + $this->lexer->setup('@since {@internal<pre>{@id 4}</pre>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_PRE, '<pre>'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), @@ -1197,13 +1270,15 @@ array(PHP_PARSER_DOCLEX_CLOSE_PRE, '</pre>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'inline tag pre'); - $this->lexer->setup('{@internal{@}{@*}}}'); + $this->lexer->setup('@since {@internal{@}{@*}}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_INLINE_ESC, '{@}'), array(PHP_PARSER_DOCLEX_INLINE_ESC, '{@*}'), @@ -1219,7 +1294,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal - first item + $this->lexer->setup('@since {@internal - first item - second item - third item}}'); $data = array(); @@ -1228,6 +1303,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "-"), @@ -1243,7 +1320,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_END, ''), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 1'); - $this->lexer->setup('{@internal o first item + $this->lexer->setup('@since {@internal o first item o second item o third item}}'); $data = array(); @@ -1252,6 +1329,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "o"), @@ -1267,7 +1346,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_END, ''), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 1.1'); - $this->lexer->setup('{@internal 1 first item + $this->lexer->setup('@since {@internal 1 first item 2 second item 3 third item}}'); $data = array(); @@ -1276,6 +1355,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_NBULLET, "1"), @@ -1291,7 +1372,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_END, ''), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 2'); - $this->lexer->setup('{@internal 1. first item + $this->lexer->setup('@since {@internal 1. first item 2. second item 3. third item}}'); $data = array(); @@ -1300,6 +1381,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_NDBULLET, "1."), @@ -1325,7 +1408,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<b> + $this->lexer->setup('@since {@internal<b> - first item - second item - third item @@ -1336,6 +1419,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_B, '<b>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), @@ -1354,7 +1439,7 @@ array(PHP_PARSER_DOCLEX_CLOSE_B, '</b>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 1'); - $this->lexer->setup('{@internal<i> + $this->lexer->setup('@since {@internal<i> o first item o second item o third item @@ -1365,6 +1450,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_I, '<i>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), @@ -1383,7 +1470,7 @@ array(PHP_PARSER_DOCLEX_CLOSE_I, '</i>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 1.1'); - $this->lexer->setup('{@internal<kbd> + $this->lexer->setup('@since {@internal<kbd> 1 first item 2 second item 3 third item @@ -1394,6 +1481,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_KBD, '<kbd>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), @@ -1412,7 +1501,7 @@ array(PHP_PARSER_DOCLEX_CLOSE_KBD, '</kbd>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 2'); - $this->lexer->setup('{@internal<samp> + $this->lexer->setup('@since {@internal<samp> 1. first item 2. second item 3. third item @@ -1423,6 +1512,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_SAMP, '<samp>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), @@ -1452,7 +1543,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal - first item + $this->lexer->setup('@since {@internal - first item 1 nested first 2 nested second - second item @@ -1469,6 +1560,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "-"), @@ -1523,7 +1616,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<var> + $this->lexer->setup('@since {@internal<var> - first item 1 nested first 2 nested second @@ -1541,6 +1634,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_VAR, '<var>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), @@ -1597,7 +1692,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup(' - first item + $this->lexer->setup('@since - first item 1 nested first 3 unnested second'); $data = array(); @@ -1606,6 +1701,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "-"), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -1636,7 +1732,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup(' 1. first + $this->lexer->setup('@since 1. first 2 invalid second'); $data = array(); while ($a = $this->lexer->advance()) { @@ -1644,6 +1740,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_NDBULLET, "1."), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first'),
http://cvs.php.net/diff.php/pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex?r1=1.12&r2=1.13&ty=u Index: pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex diff -u pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex:1.12 pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex:1.13 --- pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex:1.12 Wed Apr 7 12:55:08 2004 +++ pear/PHP_Parser/Parser/DocBlock/DefaultLexer.lex Wed Apr 7 13:17:55 2004 @@ -16,7 +16,7 @@ // | Authors: Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: DefaultLexer.lex,v 1.12 2004/04/07 16:55:08 cellog Exp $ +// $Id: DefaultLexer.lex,v 1.13 2004/04/07 17:17:55 cellog Exp $ // require_once 'PEAR/ErrorStack.php'; @@ -585,7 +585,7 @@ return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } -<YYINITIAL, INLINEINTERNALTAG> [\n]+ { +<YYINITIAL, INLINEINTERNALTAG, INTAG> [\n]+ { if (strlen($this->yytext()) >= 2) { $this->yy_buffer_index = $this->yy_buffer_end = $this->yy_buffer_start + 2; if ($this->debug) echo "initial double newline ".strlen($this->yytext())."\n"; @@ -595,13 +595,6 @@ return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } -<INTAG> [\n]+ { - if ($this->debug) echo "tags newline\n"; - $this->_atNewLine = true; - $this->yy_buffer_end = $this->yy_buffer_index = $this->yy_buffer_start + 1; - return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); -} - <INTAG> [^\n{<]+ { $test = trim($this->yytext()); if (strlen($test)) { http://cvs.php.net/diff.php/pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php?r1=1.10&r2=1.11&ty=u Index: pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php diff -u pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php:1.10 pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php:1.11 --- pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php:1.10 Wed Apr 7 12:55:08 2004 +++ pear/PHP_Parser/Parser/DocBlock/DefaultLexer.php Wed Apr 7 13:17:55 2004 @@ -16,7 +16,7 @@ // | Authors: Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: DefaultLexer.php,v 1.10 2004/04/07 16:55:08 cellog Exp $ +// $Id: DefaultLexer.php,v 1.11 2004/04/07 17:17:55 cellog Exp $ // require_once 'PEAR/ErrorStack.php'; define('PHP_Parser_DocBlock_DefaultLexer_ERROR', 1); @@ -613,8 +613,8 @@ /* 27 */ YY_NO_ANCHOR, /* 28 */ YY_NO_ANCHOR, /* 29 */ YY_NO_ANCHOR, - /* 30 */ YY_NO_ANCHOR, - /* 31 */ YY_NOT_ACCEPT, + /* 30 */ YY_NOT_ACCEPT, + /* 31 */ YY_NO_ANCHOR, /* 32 */ YY_NO_ANCHOR, /* 33 */ YY_NO_ANCHOR, /* 34 */ YY_NO_ANCHOR, @@ -735,12 +735,12 @@ 0, 1, 2, 3, 4, 5, 1, 6, 7, 7, 7, 7, 1, 8, 8, 9, 1, 10, 7, 11, 12, 13, 14, 15, - 16, 17, 1, 18, 18, 1, 1, 7, - 17, 19, 1, 1, 1, 1, 20, 21, + 16, 1, 17, 17, 1, 1, 7, 18, + 16, 19, 1, 1, 1, 1, 20, 21, 22, 1, 6, 23, 7, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 28, 17, 46, 47, 48, + 43, 44, 45, 28, 16, 46, 47, 48, 49, 50, 51, 52, 53, 54, 14, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, @@ -762,14 +762,14 @@ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), - array( -1, -1, 3, 31, 3, 3, 3, 3, + array( -1, -1, 3, 30, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 42, 3, 3, 3, 3, 3, 3, 3 ), - array( -1, 5, 31, 96, 101, 46, 46, 46, - 46, 33, 31, 46, 46, 46, 44, 31, - 31, 42, 31, 46, 46, 46, 46, 46, - 31 ), + array( -1, 5, 30, 96, 101, 46, 46, 46, + 46, 33, 30, 46, 46, 46, 44, 30, + 30, 42, 30, 46, 46, 46, 46, 46, + 30 ), array( -1, 5, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -778,10 +778,10 @@ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), - array( -1, -1, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), + array( -1, -1, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), array( -1, -1, -1, -1, -1, 13, 13, 13, 13, -1, -1, 13, 13, 13, -1, -1, -1, -1, -1, 13, 13, 13, 13, 13, @@ -790,7 +790,7 @@ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39 ), - array( -1, -1, 64, 31, 17, 17, 17, 17, + array( -1, -1, 64, 30, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 42, 17, 17, 17, 17, 17, 17, 17 ), @@ -810,26 +810,26 @@ 22, -1, -1, 22, 22, 22, -1, -1, -1, -1, -1, 22, 22, 22, 22, 22, -1 ), - array( -1, 23, -1, -1, -1, -1, -1, -1, - -1, 77, -1, -1, -1, -1, -1, 78, - -1, -1, -1, -1, -1, -1, -1, -1, - -1 ), - array( -1, -1, 24, -1, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, - 24, -1, 24, 24, 24, 24, 24, 24, - 24 ), + array( -1, -1, 23, -1, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, -1, 23, 23, 23, 23, 23, 23, + 23 ), array( -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), - array( -1, 28, 28, -1, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, - 28, -1, 28, 28, 28, 28, 28, 28, - 28 ), - array( -1, 5, 31, 31, 31, 31, 31, 31, - 31, 33, 31, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), + array( -1, 27, 27, -1, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, -1, 27, 27, 27, 27, 27, 27, + 27 ), + array( -1, 31, -1, -1, -1, -1, -1, -1, + -1, 77, -1, -1, -1, -1, -1, 78, + -1, -1, -1, -1, -1, -1, -1, -1, + -1 ), + array( -1, 5, 30, 30, 30, 30, 30, 30, + 30, 33, 30, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), array( -1, -1, -1, -1, -1, 13, 13, 13, 13, -1, -1, 13, 13, 13, -1, -1, -1, -1, -1, 13, 13, 13, 13, 14, @@ -850,26 +850,26 @@ 40, 40, 40, 40, 40, 40, 40, 40, 40, -1, 40, 40, 40, 40, 40, 40, 40 ), - array( -1, 52, 31, 31, 53, 46, 46, 46, - 46, 54, 8, 46, 46, 46, 31, 31, - 31, 42, 31, 46, 46, 46, 46, 46, - 31 ), - array( -1, -1, 31, 96, 101, 46, 46, 46, - 46, 31, 31, 46, 46, 46, 31, 31, - 31, 42, 31, 46, 46, 46, 46, 46, - 31 ), - array( -1, 98, 31, 31, 102, 48, 48, 48, - 48, 55, 56, 48, 48, 48, 31, 31, - 31, 42, 31, 48, 48, 48, 48, 48, - 31 ), + array( -1, 52, 30, 30, 53, 46, 46, 46, + 46, 54, 8, 46, 46, 46, 30, 30, + 30, 42, 30, 46, 46, 46, 46, 46, + 30 ), + array( -1, -1, 30, 96, 101, 46, 46, 46, + 46, 30, 30, 46, 46, 46, 30, 30, + 30, 42, 30, 46, 46, 46, 46, 46, + 30 ), + array( -1, 98, 30, 30, 102, 48, 48, 48, + 48, 55, 56, 48, 48, 48, 30, 30, + 30, 42, 30, 48, 48, 48, 48, 48, + 30 ), array( -1, -1, -1, 69, 99, 70, 70, 70, 70, -1, -1, 70, 70, 70, -1, -1, -1, -1, -1, 70, 70, 70, 70, 70, -1 ), - array( -1, -1, 31, 31, 31, 50, 50, 50, - 50, 31, 9, 50, 50, 50, 31, 31, - 31, 42, 31, 50, 50, 50, 50, 50, - 31 ), + array( -1, -1, 30, 30, 30, 50, 50, 50, + 50, 30, 9, 50, 50, 50, 30, 30, + 30, 42, 30, 50, 50, 50, 50, 50, + 30 ), array( -1, -1, -1, 82, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -878,22 +878,22 @@ -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), - array( -1, -1, 31, 31, 31, 31, 31, 31, - 31, 31, 10, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), - array( -1, 52, 31, 31, 53, 31, 31, 31, - 31, 54, 31, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), - array( -1, 98, 31, 31, 102, 31, 31, 31, - 31, 55, 31, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), - array( -1, -1, 31, 31, 31, 31, 31, 31, - 31, 31, 11, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), + array( -1, -1, 30, 30, 30, 30, 30, 30, + 30, 30, 10, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), + array( -1, 52, 30, 30, 53, 30, 30, 30, + 30, 54, 30, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), + array( -1, 98, 30, 30, 102, 30, 30, 30, + 30, 55, 30, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), + array( -1, -1, 30, 30, 30, 30, 30, 30, + 30, 30, 11, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), array( -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -922,7 +922,7 @@ 17, 17, 17, 17, 17, 17, 17, 17, 17, 32, 17, 17, 17, 17, 17, 17, 17 ), - array( -1, 40, 31, 17, 17, 17, 17, 17, + array( -1, 40, 30, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 45, 17, 17, 17, 17, 17, 17, 17 ), @@ -970,18 +970,18 @@ -1, 77, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), - array( 1, 23, 24, 49, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, - 24, 25, 24, 24, 24, 24, 24, 24, - 24 ), - array( 1, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, - -1, 26, 26, 26, 26, 26, 26, 26, - 26 ), - array( 1, 27, 28, 51, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, - 28, 32, 28, 28, 28, 28, 28, 28, - 28 ), + array( 1, 31, 23, 49, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 24, 23, 23, 23, 23, 23, 23, + 23 ), + array( 1, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, + -1, 25, 25, 25, 25, 25, 25, 25, + 25 ), + array( 1, 26, 27, 51, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 32, 27, 27, 27, 27, 27, 27, + 27 ), array( -1, -1, -1, -1, 83, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -1007,7 +1007,7 @@ -1, -1, -1, -1, -1, -1, -1, -1, -1 ), array( -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 29, -1, -1, -1, -1, -1, + -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), array( -1, -1, -1, -1, 90, -1, -1, -1, @@ -1031,17 +1031,17 @@ -1, -1, -1, -1, -1, -1, -1, -1, -1 ), array( -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 30, -1, -1, -1, -1, -1, + -1, -1, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ), array( -1, -1, -1, -1, -1, 13, 13, 13, 13, -1, -1, 13, 13, 13, -1, -1, -1, -1, -1, 13, 13, 13, 38, 13, -1 ), - array( -1, -1, 31, 31, 31, 48, 48, 48, - 48, 31, 31, 48, 48, 48, 31, 31, - 31, 42, 31, 48, 48, 48, 48, 48, - 31 ), + array( -1, -1, 30, 30, 30, 48, 48, 48, + 48, 30, 30, 48, 48, 48, 30, 30, + 30, 42, 30, 48, 48, 48, 48, 48, + 30 ), array( -1, -1, -1, 89, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -1054,18 +1054,18 @@ 72, -1, -1, 72, 72, 72, -1, -1, -1, -1, -1, 72, 72, 72, 72, 72, -1 ), - array( 1, 27, 28, 97, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, - 28, 32, 28, 28, 28, 28, 28, 28, - 28 ), - array( -1, -1, 31, 31, 31, 50, 50, 50, - 50, 31, 31, 50, 50, 50, 31, 31, - 31, 42, 31, 50, 50, 50, 50, 50, - 31 ), - array( -1, -1, 31, 31, 31, 31, 31, 31, - 31, 31, 56, 31, 31, 31, 31, 31, - 31, 42, 31, 31, 31, 31, 31, 31, - 31 ), + array( 1, 26, 27, 97, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 32, 27, 27, 27, 27, 27, 27, + 27 ), + array( -1, -1, 30, 30, 30, 50, 50, 50, + 50, 30, 30, 50, 50, 50, 30, 30, + 30, 42, 30, 50, 50, 50, 50, 50, + 30 ), + array( -1, -1, 30, 30, 30, 30, 30, 30, + 30, 30, 56, 30, 30, 30, 30, 30, + 30, 42, 30, 30, 30, 30, 30, 30, + 30 ), array( -1, -1, -1, -1, -1, 13, 13, 13, 13, -1, -1, 13, 13, 13, -1, -1, -1, -1, -1, 13, 95, 13, 13, 13, @@ -1502,13 +1502,6 @@ } case 23: { - if ($this->debug) echo "tags newline\n"; - $this->_atNewLine = true; - $this->yy_buffer_end = $this->yy_buffer_index = $this->yy_buffer_start + 1; - return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); -} -case 24: -{ $test = trim($this->yytext()); if (strlen($test)) { $whitespace = substr($this->yytext(), 0, strpos($this->yytext(), $test)); @@ -1559,38 +1552,48 @@ return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } } -case 25: +case 24: { if ($this->debug) echo "in tag normal bracket [{]\n"; return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } -case 26: +case 25: { if ($this->debug) echo "inline tag name [".$this->_tagName."]\n"; $this->yybegin(INLINETAG); $this->yy_buffer_end = $this->yy_buffer_index = $this->yy_buffer_start; return array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, $this->_tagName); } -case 27: +case 26: { if ($this->debug) echo '<code> newline ['.$this->yytext()."]\n"; return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } -case 28: +case 27: { if ($this->debug) echo "normal code text [".$this->yytext()."]\n"; return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); } -case 29: +case 28: { if ($this->debug) echo "escaped tag [".$this->yytext()."]\n"; return array(PHP_PARSER_DOCLEX_ESCAPED_TAG, $this->yytext()); } -case 30: +case 29: { if ($this->debug) echo "escaped tag [".$this->yytext()."]\n"; return array(PHP_PARSER_DOCLEX_ESCAPED_TAG, $this->yytext()); } +case 31: +{ + if (strlen($this->yytext()) >= 2) { + $this->yy_buffer_index = $this->yy_buffer_end = $this->yy_buffer_start + 2; + if ($this->debug) echo "initial double newline ".strlen($this->yytext())."\n"; + return array(PHP_PARSER_DOCLEX_DOUBLENL, $this->yytext()); + } + if ($this->debug) echo "initial newline ".strlen($this->yytext())."\n"; + return array(PHP_PARSER_DOCLEX_TEXT, $this->yytext()); +} case 32: { if ($this->debug) echo "everything else[" .$this->yytext()."]\n"; @@ -1933,4 +1936,4 @@ } return null; } -} \ No newline at end of file +} http://cvs.php.net/diff.php/pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php?r1=1.2&r2=1.3&ty=u Index: pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php diff -u pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php:1.2 pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php:1.3 --- pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php:1.2 Wed Apr 7 12:55:08 2004 +++ pear/PHP_Parser/tests/PHP_Parser_DocBlock_DefaultLexer_tag_test.php Wed Apr 7 13:17:55 2004 @@ -3,7 +3,7 @@ /** * API Unit tests for PHP_Parser package. * - * @version $Id: PHP_Parser_DocBlock_DefaultLexer_tag_test.php,v 1.2 2004/04/07 16:55:08 cellog Exp $ + * @version $Id: PHP_Parser_DocBlock_DefaultLexer_tag_test.php,v 1.3 2004/04/07 17:17:55 cellog Exp $ * @author Laurent Laville <pear@laurent-laville.org> portions from HTML_CSS * @author Greg Beaver * @package PHP_Parser @@ -263,50 +263,58 @@ array(PHP_PARSER_DOCLEX_CLOSE_PRE, '</pre>'), array(PHP_PARSER_DOCLEX_TEXT, " < test bracket"), ), $data, 'tags failed 1'); - $this->lexer->setup('</b><samp></samp><kbd>'); + $this->lexer->setup('@since </b><samp></samp><kbd>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_CLOSE_B, '</b>'), array(PHP_PARSER_DOCLEX_OPEN_SAMP, '<samp>'), array(PHP_PARSER_DOCLEX_CLOSE_SAMP, '</samp>'), array(PHP_PARSER_DOCLEX_OPEN_KBD, '<kbd>'), ), $data, 'tags failed 2'); - $this->lexer->setup('</kbd><code></code><ol>'); + $this->lexer->setup('@since </kbd><code></code><ol>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_CLOSE_KBD, '</kbd>'), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), array(PHP_PARSER_DOCLEX_CLOSE_CODE, '</code>'), array(PHP_PARSER_DOCLEX_OPEN_LIST, '<ol>'), ), $data, 'tags failed 3'); - $this->lexer->setup('</ol><li></li><ul></ul>'); + $this->lexer->setup('@since </ol><li></li><ul></ul>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_CLOSE_LIST, '</ol>'), array(PHP_PARSER_DOCLEX_OPEN_LI, '<li>'), array(PHP_PARSER_DOCLEX_CLOSE_LI, '</li>'), array(PHP_PARSER_DOCLEX_OPEN_LIST, '<ul>'), array(PHP_PARSER_DOCLEX_CLOSE_LIST, '</ul>'), ), $data, 'tags failed 4'); - $this->lexer->setup('<strong></i></strong><em></em><var></var><i>'); + $this->lexer->setup('@since <strong></i></strong><em></em><var></var><i>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_B, '<strong>'), array(PHP_PARSER_DOCLEX_CLOSE_I, '</i>'), array(PHP_PARSER_DOCLEX_CLOSE_B, '</strong>'), @@ -326,7 +334,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<pre> + $this->lexer->setup('@since <pre> testing my this has <b> lots of doohickeys<</pre>><</pre >><</code>><</code >> </pre>'); $data = array(); @@ -335,6 +343,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_PRE, '<pre>'), array(PHP_PARSER_DOCLEX_TEXT, "\ntesting my this has <b> lots of doohickeys"), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<</pre>>'), @@ -352,7 +362,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<code> + $this->lexer->setup('@since <code> testing my this has <b> lots of doohickeys<</pre>><</code>><</code >> </code>'); $data = array(); @@ -361,6 +371,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), array(PHP_PARSER_DOCLEX_TEXT, "\ntesting my this has <b> lots of doohickeys<</pre>>"), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<</code>>'), @@ -378,13 +390,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<<one>><<two />>'); + $this->lexer->setup('@since <<one>><<two />>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<<one>>'), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<<two />>'), ), $data, 'escaped tag'); @@ -398,13 +412,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<br/><br />'); + $this->lexer->setup('@since <br/><br />'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_XML_TAG, '<br/>'), array(PHP_PARSER_DOCLEX_XML_TAG, '<br />'), ), $data, 'complete tag'); @@ -418,7 +434,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup(' + $this->lexer->setup('@since '); $data = array(); @@ -427,10 +443,11 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_DOUBLENL, "\n\n"), ), $data, 'first doublenl'); - $this->lexer->setup('testing my theory + $this->lexer->setup('@since testing my theory this is some text and some more text here we go @@ -443,7 +460,8 @@ } $this->assertEquals( array( - array(PHP_PARSER_DOCLEX_TEXT, "testing my theory\nthis is some text"), + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, " testing my theory\nthis is some text"), array(PHP_PARSER_DOCLEX_DOUBLENL, "\n\n"), array(PHP_PARSER_DOCLEX_TEXT, "and some more text here we go\nisn't this fun?"), array(PHP_PARSER_DOCLEX_DOUBLENL, "\n\n"), @@ -459,36 +477,42 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@inheritdoc}'); + $this->lexer->setup('@since {@inheritdoc}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'inheritdoc'), array(PHP_PARSER_DOCLEX_INLINE_TAG_CLOSE, '}'), ), $data, 'inline tag'); - $this->lexer->setup('{@link somefoo someotherfoo}'); + $this->lexer->setup('@since {@link somefoo someotherfoo}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'link'), array(PHP_PARSER_DOCLEX_INLINE_TAG_CONTENTS, ' somefoo someotherfoo'), array(PHP_PARSER_DOCLEX_INLINE_TAG_CLOSE, '}'), ), $data, 'inline tag contents'); - $this->lexer->setup('<code>{@id 3}</code>'); + $this->lexer->setup('@since <code>{@id 3}</code>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'id'), @@ -496,13 +520,15 @@ array(PHP_PARSER_DOCLEX_INLINE_TAG_CLOSE, '}'), array(PHP_PARSER_DOCLEX_CLOSE_CODE, '</code>'), ), $data, 'inline tag code'); - $this->lexer->setup('<pre>{@id 4}</pre>'); + $this->lexer->setup('@since <pre>{@id 4}</pre>'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_PRE, '<pre>'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'id'), @@ -530,7 +556,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup(' - first item + $this->lexer->setup('@since - first item - second item - third item'); $data = array(); @@ -539,6 +565,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "-"), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -552,7 +579,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST, ' third item'), array(YY_EOF, ''), ), $data, 'simple list 1'); - $this->lexer->setup(' o first item + $this->lexer->setup('@since o first item o second item o third item'); $data = array(); @@ -561,6 +588,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "o"), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -574,7 +602,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST, ' third item'), array(YY_EOF, ''), ), $data, 'simple list 1.1'); - $this->lexer->setup(' 1 first item + $this->lexer->setup('@since 1 first item 2 second item 3 third item'); $data = array(); @@ -583,6 +611,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_NBULLET, "1"), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -596,7 +625,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST, ' third item'), array(YY_EOF, ''), ), $data, 'simple list 2'); - $this->lexer->setup(' 1. first item + $this->lexer->setup('@since 1. first item 2. second item 3. third item'); $data = array(); @@ -605,6 +634,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_NDBULLET, "1."), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -628,7 +658,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<b> + $this->lexer->setup('@since <b> - first item - second item - third item @@ -639,6 +669,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_B, '<b>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), @@ -655,7 +687,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_NL, "\n"), array(PHP_PARSER_DOCLEX_CLOSE_B, '</b>'), ), $data, 'simple list 1'); - $this->lexer->setup('<i> + $this->lexer->setup('@since <i> o first item o second item o third item @@ -666,6 +698,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_I, '<i>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), @@ -682,7 +716,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_NL, "\n"), array(PHP_PARSER_DOCLEX_CLOSE_I, '</i>'), ), $data, 'simple list 1.1'); - $this->lexer->setup('<kbd> + $this->lexer->setup('@since <kbd> 1 first item 2 second item 3 third item @@ -693,6 +727,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_KBD, '<kbd>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), @@ -709,7 +745,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_NL, "\n"), array(PHP_PARSER_DOCLEX_CLOSE_KBD, '</kbd>'), ), $data, 'simple list 2'); - $this->lexer->setup('<samp> + $this->lexer->setup('@since <samp> 1. first item 2. second item 3. third item @@ -720,6 +756,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_SAMP, '<samp>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), @@ -747,7 +785,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup(' - first item + $this->lexer->setup('@since - first item 1 nested first 2 nested second - second item @@ -764,6 +802,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "-"), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -816,7 +855,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('<var> + $this->lexer->setup('@since <var> - first item 1 nested first 2 nested second @@ -834,6 +873,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_OPEN_VAR, '<var>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), @@ -888,13 +929,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal}}'); + $this->lexer->setup('@since {@internal}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 1'); @@ -908,13 +951,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<b></p><pre></pre>}}'); + $this->lexer->setup('@since {@internal<b></p><pre></pre>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_B, '<b>'), array(PHP_PARSER_DOCLEX_CLOSE_P, '</p>'), @@ -922,13 +967,15 @@ array(PHP_PARSER_DOCLEX_CLOSE_PRE, '</pre>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'tags failed 1'); - $this->lexer->setup('{@internal</b><samp></samp><kbd>}}'); + $this->lexer->setup('@since {@internal</b><samp></samp><kbd>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_CLOSE_B, '</b>'), array(PHP_PARSER_DOCLEX_OPEN_SAMP, '<samp>'), @@ -936,13 +983,15 @@ array(PHP_PARSER_DOCLEX_OPEN_KBD, '<kbd>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'tags failed 2'); - $this->lexer->setup('{@internal</kbd><code></code><ol>}}'); + $this->lexer->setup('@since {@internal</kbd><code></code><ol>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_CLOSE_KBD, '</kbd>'), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), @@ -950,13 +999,15 @@ array(PHP_PARSER_DOCLEX_OPEN_LIST, '<ol>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'tags failed 3'); - $this->lexer->setup('{@internal</ol><li></li><ul></ul>}}'); + $this->lexer->setup('@since {@internal</ol><li></li><ul></ul>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_CLOSE_LIST, '</ol>'), array(PHP_PARSER_DOCLEX_OPEN_LI, '<li>'), @@ -965,13 +1016,15 @@ array(PHP_PARSER_DOCLEX_CLOSE_LIST, '</ul>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'tags failed 4'); - $this->lexer->setup('{@internal<strong></i></strong><em></em><var></var><i>}}'); + $this->lexer->setup('@since {@internal<strong></i></strong><em></em><var></var><i>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_B, '<strong>'), array(PHP_PARSER_DOCLEX_CLOSE_I, '</i>'), @@ -993,7 +1046,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<pre> + $this->lexer->setup('@since {@internal<pre> testing my this has <b> lots of doohickeys<</pre>><</pre >><</code>><</code >> </pre>}}'); $data = array(); @@ -1002,6 +1055,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_PRE, '<pre>'), array(PHP_PARSER_DOCLEX_TEXT, "\ntesting my this has <b> lots of doohickeys"), @@ -1021,7 +1076,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<code> + $this->lexer->setup('@since {@internal<code> testing my this has <b> lots of doohickeys<</pre>><</code>><</code >> </code>}}'); $data = array(); @@ -1030,6 +1085,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), array(PHP_PARSER_DOCLEX_TEXT, "\ntesting my this has <b> lots of doohickeys<</pre>>"), @@ -1049,13 +1106,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<<one>><<two />>}}'); + $this->lexer->setup('@since {@internal<<one>><<two />>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<<one>>'), array(PHP_PARSER_DOCLEX_ESCAPED_TAG, '<<two />>'), @@ -1071,13 +1130,15 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<br/><br />}}'); + $this->lexer->setup('@since {@internal<br/><br />}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_XML_TAG, '<br/>'), array(PHP_PARSER_DOCLEX_XML_TAG, '<br />'), @@ -1093,7 +1154,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal + $this->lexer->setup('@since {@internal }}'); $data = array(); @@ -1102,12 +1163,14 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_DOUBLENL, "\n\n"), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'first doublenl'); - $this->lexer->setup('{@internal testing my theory + $this->lexer->setup('@since {@internal testing my theory this is some text and some more text here we go @@ -1120,6 +1183,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_TEXT, " testing my theory\nthis is some text"), array(PHP_PARSER_DOCLEX_DOUBLENL, "\n\n"), @@ -1138,26 +1203,30 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal{@inheritdoc}}}'); + $this->lexer->setup('@since {@internal{@inheritdoc}}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'inheritdoc'), array(PHP_PARSER_DOCLEX_INLINE_TAG_CLOSE, '}'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'inline tag'); - $this->lexer->setup('{@internal{@link somefoo someotherfoo}}}'); + $this->lexer->setup('@since {@internal{@link somefoo someotherfoo}}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), array(PHP_PARSER_DOCLEX_INLINE_TAG_NAME, 'link'), @@ -1165,13 +1234,15 @@ array(PHP_PARSER_DOCLEX_INLINE_TAG_CLOSE, '}'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'inline tag contents'); - $this->lexer->setup('{@internal<code>{@id 3}</code>}}'); + $this->lexer->setup('@since {@internal<code>{@id 3}</code>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_CODE, '<code>'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), @@ -1181,13 +1252,15 @@ array(PHP_PARSER_DOCLEX_CLOSE_CODE, '</code>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'inline tag code'); - $this->lexer->setup('{@internal<pre>{@id 4}</pre>}}'); + $this->lexer->setup('@since {@internal<pre>{@id 4}</pre>}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_PRE, '<pre>'), array(PHP_PARSER_DOCLEX_INLINE_TAG_OPEN, '{@'), @@ -1197,13 +1270,15 @@ array(PHP_PARSER_DOCLEX_CLOSE_PRE, '</pre>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'inline tag pre'); - $this->lexer->setup('{@internal{@}{@*}}}'); + $this->lexer->setup('@since {@internal{@}{@*}}}'); $data = array(); while ($a = $this->lexer->advance()) { $data[] = array($this->lexer->token, $this->lexer->value); } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_INLINE_ESC, '{@}'), array(PHP_PARSER_DOCLEX_INLINE_ESC, '{@*}'), @@ -1219,7 +1294,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal - first item + $this->lexer->setup('@since {@internal - first item - second item - third item}}'); $data = array(); @@ -1228,6 +1303,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "-"), @@ -1243,7 +1320,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_END, ''), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 1'); - $this->lexer->setup('{@internal o first item + $this->lexer->setup('@since {@internal o first item o second item o third item}}'); $data = array(); @@ -1252,6 +1329,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "o"), @@ -1267,7 +1346,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_END, ''), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 1.1'); - $this->lexer->setup('{@internal 1 first item + $this->lexer->setup('@since {@internal 1 first item 2 second item 3 third item}}'); $data = array(); @@ -1276,6 +1355,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_NBULLET, "1"), @@ -1291,7 +1372,7 @@ array(PHP_PARSER_DOCLEX_SIMPLELIST_END, ''), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 2'); - $this->lexer->setup('{@internal 1. first item + $this->lexer->setup('@since {@internal 1. first item 2. second item 3. third item}}'); $data = array(); @@ -1300,6 +1381,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_NDBULLET, "1."), @@ -1325,7 +1408,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<b> + $this->lexer->setup('@since {@internal<b> - first item - second item - third item @@ -1336,6 +1419,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_B, '<b>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), @@ -1354,7 +1439,7 @@ array(PHP_PARSER_DOCLEX_CLOSE_B, '</b>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 1'); - $this->lexer->setup('{@internal<i> + $this->lexer->setup('@since {@internal<i> o first item o second item o third item @@ -1365,6 +1450,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_I, '<i>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), @@ -1383,7 +1470,7 @@ array(PHP_PARSER_DOCLEX_CLOSE_I, '</i>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 1.1'); - $this->lexer->setup('{@internal<kbd> + $this->lexer->setup('@since {@internal<kbd> 1 first item 2 second item 3 third item @@ -1394,6 +1481,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_KBD, '<kbd>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), @@ -1412,7 +1501,7 @@ array(PHP_PARSER_DOCLEX_CLOSE_KBD, '</kbd>'), array(PHP_PARSER_DOCLEX_ENDINTERNAL, '}}'), ), $data, 'simple list 2'); - $this->lexer->setup('{@internal<samp> + $this->lexer->setup('@since {@internal<samp> 1. first item 2. second item 3. third item @@ -1423,6 +1512,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_SAMP, '<samp>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), @@ -1452,7 +1543,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal - first item + $this->lexer->setup('@since {@internal - first item 1 nested first 2 nested second - second item @@ -1469,6 +1560,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "-"), @@ -1523,7 +1616,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup('{@internal<var> + $this->lexer->setup('@since {@internal<var> - first item 1 nested first 2 nested second @@ -1541,6 +1634,8 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), + array(PHP_PARSER_DOCLEX_TEXT, ' '), array(PHP_PARSER_DOCLEX_INTERNAL, '{@internal'), array(PHP_PARSER_DOCLEX_OPEN_VAR, '<var>'), array(PHP_PARSER_DOCLEX_TEXT, "\n"), @@ -1597,7 +1692,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup(' - first item + $this->lexer->setup('@since - first item 1 nested first 3 unnested second'); $data = array(); @@ -1606,6 +1701,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_BULLET, "-"), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first item'), @@ -1636,7 +1732,7 @@ if (!$this->_methodExists('advance')) { return; } - $this->lexer->setup(' 1. first + $this->lexer->setup('@since 1. first 2 invalid second'); $data = array(); while ($a = $this->lexer->advance()) { @@ -1644,6 +1740,7 @@ } $this->assertEquals( array( + array(PHP_PARSER_DOCLEX_TAG, '@since'), array(PHP_PARSER_DOCLEX_WHITESPACE, " "), array(PHP_PARSER_DOCLEX_NDBULLET, "1."), array(PHP_PARSER_DOCLEX_SIMPLELIST, ' first'),