Keyword flags colorization:keyword flags, Spell:colorizer flag – Crunch CRiSP File Editor 6 User Manual

Page 75

Advertising
background image

Page 75

More than one keyword can be specified on each line; each keyword is enclosed in double quotes.
Backslashes are used inside the quotes to escape the next character. (Usually only needed for
literal double quotes or backslashes.

Keywords are case dependent unless the case_independent flag is applied to the keyword or
specified in the flags= line.

Each keyword can be preceded by one or more flags. The keyword specific flags are described
below. The meaning of these flags only applies to the next keyword, and is turned off for
subsequent keywords.

The text for a keyword is taken literally, but certain regular expression characters can be used to give more
powerful meaning to the construct. These regular expression characters are a limited subset of the complete
form of regular expressions that are available when performing search and replacing operations.

Keyword Flags

Colorization:keyword flags

The following flags can be used when specifying keywords to

affect the normal meaning of the keyword:

accept_backslashes

Normally used for things like string constants. When this is used, it is usually used for a keyword
which is defined as a pair of strings, e.g. a start string character, and an end string character. With
this flag in effect it means that a backslash inside the keyword turns off the effect of a special
character. For example in the C definition of a string constant, a backslash can be used to include a
double quote in the string constant itself, and hence does not terminate the string.

accept_double_char

Use this for string constants or any other paired string, where two occurrences of the starting
character are to be treated as part of the keyword and not a terminator. (This only makes sense
with comments or string constants where the starting and ending characters are the same).

case_independent

You can specify that some keywords are case sensitive or not by using this keyword. You can
specify that all keywords are case independent by using this flag in the flags= section.

embedded

This flag means that the keyword can be embedded inside any arbitrary text. For example, say you
have a file containing a DNA sequence. This file may consist of a sequence of letters like this:

GGTTTGAACATCATCATCGGGAAAAATTTT....

You might want all the sequences ATC to be treated as keywords and hence colored differently
from the rest of the text. You wouldn't normally be able to do this because CRiSP would treat the
whole string as a single keyword. By specifying something like:

keyword=embedded "ATC"

means that as soon as the sequence ATC is seen, then it will be colored even although it is sitting
inside a higher level keyword.

regexp

If this keyword is present, then the keyword string will be treated as a Unix style regular expression
rather than the limited style regular expression described elsewhere. Using regular expressions is a
slower way of specifying a keyword, but is useful to handle some of those exceptional syntax cases
in a language. For example, in the CHILL language, a hexadecimal constant can be described as:

keyword= regexp "H'[0-9A-F]*"

spell

Use this attribute to enable spell checking. You wouldn't normally use this for an explicit keyword,
but would use for keywords defined as expressions, e.g. comments, string
literals.

spell:colorizer flag

Advertising