#26629 [Opn->Bgs]: Inconsistent handle of \n in highlight_string and highlight_file
| From: | derick@php.net | Date: | Fri, 19 Dec 2003 11:39:49 +0000 |
| Subject: | #26629 [Opn->Bgs]: Inconsistent handle of \n in highlight_string and highlight_file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-52297@lists.php.net to get a copy of this message | ||
ID: 26629
Updated by: derick@php.net
Reported By: vrana@php.net
-Status: Open
+Status: Bogus
Bug Type: Strings related
PHP Version: 4.3.4
New Comment:
The current behavior is CORRECT, so your report is BOGUS. highlight_*
uses the lexical analyer to highlight and this is the perfectly good
behavior as I told you atleast 5 times now. Please keep the status to
bogus.
Previous Comments:
------------------------------------------------------------------------
[2003-12-19 06:15:06] vrana@php.net
So the newline character should be highlighted as a string and not as a
keyword.
If you will not fix this, change the state to Wont fix and not to
Bogus.
------------------------------------------------------------------------
[2003-12-17 04:31:47] derick@php.net
Because the lexer in PHP handles those cases different.
"$a\n" = quote + variable + newline character + quote
"a\n" = string
Try this script:
<pre>
<?php
highlight_string('<?php "a\n"; ?>');
var_dump(token_get_all('<?php "a\n"; ?>'));
highlight_string('<?php "$a\n"; ?>');
var_dump(token_get_all('<?php "$a\n"; ?>'));
?>
</pre>
(and leave this bug bogus)
------------------------------------------------------------------------
[2003-12-17 03:51:38] vrana@php.net
Tell me a reason why \n should be highlighted as keyword in "$a\n" and
in "a\n" not.
------------------------------------------------------------------------
[2003-12-16 17:11:51] derick@php.net
You're wrong. The current behavior is correct.
------------------------------------------------------------------------
[2003-12-16 17:01:57] vrana@php.net
I don't know what "1 string" is. Is "$a\n" also "1 string"? If it
is,
there should not be \n highlighted in it.
The problem is that in "$a\n" is \n highlighted and in "a\n" isn't. I
believe that it should be consistent.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/26629
--
Edit this bug report at http://bugs.php.net/?id=26629&edit=1