multi-word keywords

Discuss syntax highlighting or submit new syntax files.
Post Reply
zipobibrock5e8
Posts: 1
Joined: 05 May 2011 16:35

multi-word keywords

Post by zipobibrock5e8 »

Is there a way?

I'd like to be able to highlight things like "ip access-list" in Cisco configs, and to be able to treat "ip access-list extended" different from "ip access-list standard" for instance.

I created a syntax and a color file, and it worked for single-word keywords and just ignored any line in my keyword list that had a space in it. Is there a way to get this to work?
User avatar
rjbill
Posts: 877
Joined: 13 Jun 2011 06:36

Re: multi-word keywords

Post by rjbill »

No official reply, but I'm going to say, "No",
because SPACE characters are delimiters. (in the absolute sense)
Afaik, you cannot include them as part of a keyword.
Someone will correct me if I'm wrong.

I can see where that might be nice in some specifications, though.
Just like I could use some stuff to support RTF, which is a special kind
of specification that is different from more standard programming-like specs.

If they could support SPACE characters somehow, that would be nice.
You would (maybe) have to have some way to specify them, though, with a special
"this is a SPACE" character, which you should be able to specify based on
what is available in the spec in question.

So you might use a plus sign (+), or an underscore (_), or whatever you
are not using otherwise, which would then have to be "converted" into
a SPACE character internally.

So in your example, they would be "ip+access-list+extended" and "ip+access-list+standard",
with a plus sign as the SPACE specifier.
RJTE version 16.16 (Beta 2) - 64-bit
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB

Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
User avatar
Rickard Johansson
Site Admin
Posts: 6627
Joined: 19 Jul 2006 14:29

Re: multi-word keywords

Post by Rickard Johansson »

The official reply is "No". But it seems to me you should be able to make it fairly readable anyway using different colors for keywords, e.g.

ip access-list standard
ip access-list extended
Post Reply