nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Color Syntax Highlighting for PHP


From: Ryan Rubley
Subject: [Nano-devel] Color Syntax Highlighting for PHP
Date: Wed, 09 Apr 2003 15:45:39 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4a) Gecko/20030404


Am I right to say its probably impossible to do this with the current regex implementation? Somehow the regex's need to hold a state such that different color syntax can apply to the html vs the code inside <? ?> blocks. I can't even figure out if its possible to highlight basic html in a manner similar to Mozilla's view source where <tag attr=value> has the "attr" one color and the "value" a different color. Even if it only highlighted "value" where "value" was inside quotes, you can't seem to disable the highlighting of quoted strings that are not part of html tag attributes. If you could nest regex's maybe it would be easier.. I would love to see the ability to define blocks such as:
syntax "PHP" "\.php$"
block "HTMLTAG" start="<[^?]" end=">"
block "PHPCODE" start="<\?" end="\?>"

blocksyntax "HTMLTAG"
color brightblack start="<" end=">"
color brightmagenta "</?[a-zA-Z_][a-zA-Z0-9_]*"
color brightwhite "[<>]"

blocksyntax "PHPCODE"
color brightyellow "\$[a-zA-Z_][a-zA-Z0-9_]*"

but that probably requires a major overhaul in the color code I would bet.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]