Re: conditional highlight (without losing other definitions)

Lorenzo Bettini <[email protected]> Sun, 26 Feb 2012 11:01:33 +0100
Newsgroups gmane.comp.gnu.source-highlight.general
Message-ID <[email protected]>
On 02/26/2012 10:30 AM, Federico Bruni wrote:
> I changed my mind again: I prefer the environment, even if it gets huge
> (see below).
> The only problem is: the delimiters "\markup {" and "}" are not
> highlighted: "}" should be highlighted as cbracket and "\markup" same
> colour as markup_command.
>
> There's a workaround?

from what I see, the only expression that deals with "\markup {" and "}" 
is the following one

environment markup delim '\\markup\s*\{' "}" multiline nested begin

thus both strings will be highlighted as markup...

>
> # Markup commands (any \command inside \markup{})
> environment markup delim '\\markup\s*\{' "}" multiline nested begin
> # definitions I want to preserve in this environment
> cbracket = $CBRACKET
> string delim "\"" "\"" multiline
> comment delim "%{" "%}" multiline nested
> comment start "%"
> scheme_value = $SCHEME_VALUE
> environment scheme delim '#\'?\(' ")" multiline nested begin
> environment scheme delim "(" ")" multiline nested begin
> include "url.lang"
> end
> environment string delim "\"" "\"" multiline begin
> include "url.lang"
> end
> end
> # actual definition
> markup_command = '\\[[:alpha:]-]+'
>
> # needed for nested blocks inside \markup{}
> environment markup delim "{" "}" multiline nested begin
> cbracket = $CBRACKET
> string delim "\"" "\"" multiline
> comment delim "%{" "%}" multiline nested
> comment start "%"
> scheme_value = $SCHEME_VALUE
> environment scheme delim '#\'?\(' ")" multiline nested begin
> environment scheme delim "(" ")" multiline nested begin
> include "url.lang"
> end
> environment string delim "\"" "\"" multiline begin
> include "url.lang"
> end
> end
> markup_command = '\\[[:alpha:]-]+'
> end
> end
>
> _______________________________________________
> Help-source-highlight mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/help-source-highlight


-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net