Double syntax context switch

Paul Sheer psheer at icon.co.za
Sun Apr 17 09:27:17 UTC 2005


> 
> Ok. So if I get rid of the "exclusive" keyword this indeed works fine.
> Maybe I started from a bad example that I didn't fully understand. What
> exactly is the "exclusive" keyword supposed to accomplish? And why
> *does* the context change happen when using that keyword as in the
> example I gave? Is that supposed to happen?
> 

:-) like i say - the current implementation *is*
the specification LOL. so exactly how it behaves
is the way it is supposed to!  *duck*

you just have to experiment

to be less evasive: i should say that keywords
take precidence over context switches. this allows
you to have

#define something(x)		\
		do {		\
			bla;	\
		} while (0)

the context is from '#' to the terminating '\n'.
BUT a '\\\n' is a keyword. so the keyword overrides
the terminating newline until the newline appears
by itself on the fourth line. only then does the 
context end. So there are certain things you simply
cannot do. Notice in c.syntax that the '/' is commented
out. This is because it breaks the C '/*' context.
I consider this to be an acceptable compromise.

What we actually need is a "priority" option
to make keyword take precidence over contexts
and visa versa.

try a syntax rule like

  context exclusive BEGIN END green/7

and then

  context           BEGIN END green/7

and you will see.

> Would you happen to have a pointer where I can read up on the syntax
> file syntax? Thanks.

unfortunately not.

however, the syntax files in the distribution of cooledit have
every combination of thing that you can do

-paul





More information about the mc-devel mailing list