[PHP-DEV] PHP 4.0 Bug #3077 Updated: ASP tags aren't recognized From: Bug Database (php-dev <email protected>)
Date: 12/31/99

ID: 3077
User Update by: djm <email protected>
Status: Open
Bug Type: Scripting Engine problem
Description: ASP tags aren't recognized

Ok, I have a workaround, and a related bug fix.
I think the first time I missed an occurrence of asp_tags in zend-scanner.l.
This time I did a global search and replace, and ASP tags started working. phpinfo() still shows that I set the asp_tags flag On, so I don't understand why this made a difference.

Once I got that working, I found a clearer bug: the scanner doesn't support one-line comments in ASP tags.
Even though they're shown in the ASP tags example at
http://www.php.net/manual/language.basic-syntax.php3

Here are the changes I made to get it working:

--- zend-scanner.l 1999/12/30 22:31:18 1.1.1.2
+++ zend-scanner.l 2000/01/01 02:24:16
@@ -1031,7 +1031,7 @@
 
 
 <INITIAL>"<%="|"<?=" {
- if ((yytext[1]=='%' && CG(asp_tags))
+ if ((yytext[1]=='%' && CG(short_tags))
                || (yytext[1]=='?' && CG(short_tags))) {
                zendlval->value.str.val = yytext; /* no copying - intentional */
                zendlval->value.str.len = yyleng;
@@ -1048,7 +1048,7 @@
 
 
 <INITIAL>"<%" {
- if (CG(asp_tags)) {
+ if (CG(short_tags)) {
                zendlval->value.str.val = yytext; /* no copying - intentional */
                zendlval->value.str.len = yyleng;
                zendlval->type = IS_STRING;
@@ -1111,7 +1111,7 @@
 }
 
 
-<ST_IN_SCRIPTING>([#]|"//")([^\n\r?]|"?"[^>\n\r])*("?\n"|"?\r\n")? { /* eat one line comments */
+<ST_IN_SCRIPTING>([#]|"//")([^\n\r?%]|[?%][^>\n\r])*([?%]"\n"|[?%]"\r\n")? { /* eat one line comments */
        HANDLE_NEWLINE(yytext[yyleng-1]);
        return T_COMMENT;
 }
@@ -1151,7 +1151,7 @@
        zendlval->value.str.len = yyleng;
        zendlval->type = IS_STRING;
        HANDLE_NEWLINES(yytext,yyleng);
- if (CG(asp_tags)) {
+ if (CG(short_tags)) {
                BEGIN(INITIAL);
                return T_CLOSE_TAG; /* implicit ';' at php-end tag */
        } else {

Full Bug description available at: http://bugs.php.net/version4/?id=3077

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>