Attached is a patch which should allow the scripting engine to also allow
\r as line delimiters. If someone on Mac OS X who has had problems can
test this and send me feedback that would be great.
The INI file scanner and maybe other problematic places in PHP have not
been fixed. I want to first see that this really addresses a problem that
exists in Mac OS X.

Andi
Index: zend_language_scanner.l
===================================================================
RCS file: /repository/Zend/zend_language_scanner.l,v
retrieving revision 1.19
diff -u -u -r1.19 zend_language_scanner.l
--- zend_language_scanner.l     2001/04/28 20:21:42     1.19
+++ zend_language_scanner.l     2001/05/02 21:22:38
@@ -603,6 +603,7 @@
 ENCAPSED_TOKENS [\[\]{}$]
 ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
 ANY_CHAR (.|[\n])
+NEWLINE ("\r"|"\n"|"\r\n")
 
 %option noyylineno
 %option noyywrap
@@ -1122,7 +1123,7 @@
 }
 
 
-<INITIAL>"<?php_track_vars?>"("\n"|"\r\n")? {
+<INITIAL>"<?php_track_vars?>"{NEWLINE}? {
        zend_error(E_WARNING, "&lt;?php_track_vars?&gt; is no longer supported - 
please use the track_vars INI directive instead");
        HANDLE_NEWLINE(yytext[yyleng-1]);
        zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
@@ -1177,7 +1178,7 @@
        yymore();
 }
 
-<ST_ONE_LINE_COMMENT>"\n"|"\r\n" {
+<ST_ONE_LINE_COMMENT>{NEWLINE} {
        zendlval->value.str.val = yytext; /* no copying - intentional */
        zendlval->value.str.len = yyleng;
        zendlval->type = IS_STRING;
@@ -1220,7 +1221,7 @@
        yymore();
 }
 
-<ST_IN_SCRIPTING>("?>"|"</script"{WHITESPACE}*">")("\n"|"\r\n")? {
+<ST_IN_SCRIPTING>("?>"|"</script"{WHITESPACE}*">"){NEWLINE}? {
        zendlval->value.str.val = yytext; /* no copying - intentional */
        zendlval->value.str.len = yyleng;
        zendlval->type = IS_STRING;
@@ -1230,7 +1231,7 @@
 }
 
 
-<ST_IN_SCRIPTING>"%>"("\n"|"\r\n")? {
+<ST_IN_SCRIPTING>"%>"{NEWLINE}? {
        if (CG(asp_tags)) {
                BEGIN(INITIAL);
                zendlval->value.str.len = yyleng;
@@ -1373,7 +1374,7 @@
 }
 
 
-<ST_IN_SCRIPTING>"<<<"{TABS_AND_SPACES}{LABEL}("\r")?"\n" {
+<ST_IN_SCRIPTING>"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} {
        char *s;
        CG(zend_lineno)++;
        CG(heredoc_len) = yyleng-3-1-(yytext[yyleng-2]=='\r'?1:0);
@@ -1400,7 +1401,7 @@
 }
 
 
-<ST_HEREDOC>^{LABEL}(";")?("\r")?"\n" {
+<ST_HEREDOC>^{LABEL}(";")?{NEWLINE} {
        int label_len;
        unsigned char unput_semicolon;
 
-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to