Browse Source

- 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)
PHP-5.1
Andi Gutmans 22 years ago
parent
commit
ac63e8c2c1
  1. 14
      Zend/zend_language_scanner.l

14
Zend/zend_language_scanner.l

@ -1433,11 +1433,11 @@ NEWLINE ("\r"|"\n"|"\r\n")
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 @@ NEWLINE ("\r"|"\n"|"\r\n")
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 @@ NEWLINE ("\r"|"\n"|"\r\n")
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;

Loading…
Cancel
Save