Hello!

Some characters (like [, ], {, } and backslash sequences) in double
quote strings are highlighted as keywords even on places where they
don't have any special meaning (like [] in "foo[] $a"). I mean
highlighted by `php -s` and highlight_* functions.

These characters are not highlighted in constant strings (i.e. strings
without variables). 

To behave the same in both cases and to not confuse someone by
highlighting characters without special meaning, I am sending this
patch.

Jakub Vrana
Index: zend_highlight.c
===================================================================
RCS file: /repository/ZendEngine2/zend_highlight.c,v
retrieving revision 1.40
diff -u -r1.40 zend_highlight.c
--- zend_highlight.c    29 Nov 2003 19:05:14 -0000      1.40
+++ zend_highlight.c    20 Dec 2003 12:39:11 -0000
@@ -137,11 +137,11 @@
                                continue;
                                break;
                        default:
-                               if (token.type==0) {
-                                       next_color = 
syntax_highlighter_ini->highlight_keyword;
+                               if (in_string) {
+                                       next_color = 
syntax_highlighter_ini->highlight_string;
                                } else {
-                                       if (in_string) {
-                                               next_color = 
syntax_highlighter_ini->highlight_string;
+                                       if (token.type==0) {
+                                               next_color = 
syntax_highlighter_ini->highlight_keyword;
                                        } else {
                                                next_color = 
syntax_highlighter_ini->highlight_default;
                                        }
-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to