GNOME Bugzilla – Bug 339491
PHP syntax highlighting is not working well using the heredoc way
Last modified: 2007-08-25 13:45:21 UTC
Please describe the problem: Some texts inside a heredoc definition will confuse the highlighting, giving wrong colors to the document. I have found the problem writing XML definitions. Steps to reproduce: 1. New document 2. Activate php syntax highlighting 3. Write this php code, for example: echo <<< HTML <?xml version="1.0" encoding="UTF-8"?> HTML; Actual results: Colors are wrong Expected results: Right colors for the text, and for the rest of the code Does this happen every time? Yes Other information: The heredoc syntaxis is defined here: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
This syntax is not highlighted because of a limitation of the highlighting engine. This bug is somewhat related to bug #323998. Reassigning to gtksourceview since it belongs to the syntax highlighting stuff.
Ubuntu bug about that: https://launchpad.net/products/gtksourceview/+bug/43182 "gEdit Incorrectly Highlights strings in Heredoc http://img69.imageshack.us/img69/5664/geditbug3no.png Within Heredoc string syntax, PHP can have both apostrophes (') and double quotes (") without the need for escaping them. View the attached image. If I have an apostrophe within heredoc (as an apostrophe, not syntacially), gEdit highlights the rest of the document as if it was in quote marks (highlights the remaining document pink). This is very hard to describe. I am also unsure how it SHOULD highlight but the current way "
proper heredoc processing available in php.lang attached to bug 341215
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.