Page 1 of 1

multi-word keywords

Posted: 05 May 2011 16:39
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?

Re: multi-word keywords

Posted: 11 Jul 2011 23:28
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.

Re: multi-word keywords

Posted: 12 Jul 2011 10:04
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