The flags= directive colorization:flags directive – Crunch CRiSP File Editor 6 User Manual

Page 71

Advertising
background image

Page 71

colorizers available, based on the filename not the section name.

The flags= Directive

Colorization:flags directive

The flags= entry in a keyword section are used to

provide various hints about the language being colorized. Each hint is a word; see the list below for a
description of the various attributes defined. There can be multiple flags= lines. Use whatever layout best
suits you.

The various keywords described for the flags= directive may also be specified with the actual keyword
definitions as well. Not all combinations of flags are meaningful. For example, you can specify that string
constants allow backslashes inside them (accept_backslashes). See the sections on handling the
keyword=, string=, etc directives.

accept_backslashes

This says that the backslash (\) character is used within the language to turn off the special
meaning of certain characters. For example, in a Shell script, the backslash character would be
used to specify a single quote as in:

echo \"

Without this attribute, the backslash would be ignored and the double quote character would
indicate that a string was starting.

accept_double_char

Use this in a language which uses a doubling-up of quote marks to indicate a single quote in a
string. For example, whereas in C, to define a single apostrophe char constant would be specified
as: '\' ', in Ingres Windows 4GL, you would specify ' ' ' ', i.e. four consecutive apostrophes.

c_floats

This specifies the language supports floating point numbers, in the same format as the C language.
This allows for an exponent and a fractional part. The C floating point convention is suitable for
nearly every programming language, including Ada and Fortran. Although Fortran accepts a double
precision exponent (e.g. 1.234d+04), CRiSP does not support this.

c_hexadecimal

Use this flag if the language supports the specification of hexadecimal numbers in a manner similar
to the C language, e.g. a leading 0x followed by the hex digits.

case_independent

Use this flag if the language accepts keywords without regard to case. C is a case-sensitive
language, whereas Fortran is not. SQL is another language which is not case sensitive.

eol_terminate

This flag is used to mark string constants which should be terminated if the end of line is reached
before a matching close delimiter is found.

Without this flag, the space between the end of the line and the start of the next line would be
colored in the string color. With this flag, the coloring is turned off at the end of the line defining the
start of the string constant.

The perl and AML colorizers use this facility because of ambiguities in parsing their source files.

embedded

This flag is not usually specified as part of the flags= definition, but is used in keyword definitions to
indicate that a keyword may start inside a word.

no_numbers

Set this hint if your language has no notion of numbers. This is used for example in the nroff/troff
colorizer; this avoids numbers being colored as numbers. Instead they are treated as part of the
normal text.

spell

Specifies that the default setting for all keywords is for spell checking. You would not normally use
this as it would cause keywords (which are usually not valid words in your native language) to be
underlined showing a mis-spelling. But you might use the spell_text keyword below.

Advertising