cvs: ZendEngine2 / zend_language_scanner.l
| From: | Andi Gutmans | Date: | Thu, 24 Feb 2005 19:25:44 +0000 |
| Subject: | cvs: ZendEngine2 / zend_language_scanner.l | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3438@lists.php.net to get a copy of this message | ||
andi Thu Feb 24 14:25:44 2005 EDT
Modified files:
/ZendEngine2 zend_language_scanner.l
Log:
- Make one line comments work the same with <script ...> </script> as with
- other tags. This will break scripts that have whitespace at the end
- of the closing tag </script > but this is barely used as it is
- and I doubt ppl used whitespace. (patch by Jani)
http://cvs.php.net/diff.php/ZendEngine2/zend_language_scanner.l?r1=1.121&r2=1.122&ty=u
Index: ZendEngine2/zend_language_scanner.l
diff -u ZendEngine2/zend_language_scanner.l:1.121 ZendEngine2/zend_language_scanner.l:1.122
--- ZendEngine2/zend_language_scanner.l:1.121 Sat Feb 19 09:33:41 2005
+++ ZendEngine2/zend_language_scanner.l Thu Feb 24 14:25:44 2005
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_language_scanner.l,v 1.121 2005/02/19 14:33:41 hirokawa Exp $ */
+/* $Id: zend_language_scanner.l,v 1.122 2005/02/24 19:25:44 andi Exp $ */
#define yyleng SCNG(yy_leng)
#define yytext SCNG(yy_text)
@@ -1433,11 +1433,11 @@
yymore();
}
-<ST_ONE_LINE_COMMENT>"?"|"%"|">" {
+<ST_ONE_LINE_COMMENT>"?"|"%"|">"|"<" {
yymore();
}
-<ST_ONE_LINE_COMMENT>[^\n\r?%>]+ {
+<ST_ONE_LINE_COMMENT>[^\n\r?%><]+ {
yymore();
}
@@ -1450,6 +1450,14 @@
return T_COMMENT;
}
+<ST_ONE_LINE_COMMENT>"</script>" {
+ zendlval->value.str.val = yytext; /* no copying - intentional */
+ zendlval->value.str.len = yyleng;
+ zendlval->type = IS_STRING;
+ BEGIN(ST_IN_SCRIPTING);
+ return T_COMMENT;
+}
+
<ST_ONE_LINE_COMMENT>"?>"|"%>" {
if (CG(asp_tags) || yytext[yyleng-2] != '%') { /* asp comment? */
zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1498,7 +1506,7 @@
yymore();
}
-<ST_IN_SCRIPTING>("?>"|"</script"{WHITESPACE}*">"){NEWLINE}?
{
+<ST_IN_SCRIPTING>("?>"|"</script>"){NEWLINE}? {
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;