The MARK_PREVIOUS Tag
Prev | Chapter 10. Mode Definition Syntax | Next

## The MARK_PREVIOUS Tag

The `MARK_PREVIOUS` rule, which must be placed inside a `RULES` tag, highlights from the end of the previous syntax token to the matched text. The text to match is specified between opening and closing `MARK_PREVIOUS` tags. The following attributes are supported:

- `TYPE` - The token type to highlight the text with. See the section called “Token Types” for a list of token types.

- `AT_LINE_START` - If set to `TRUE`, the sequence will only be highlighted if it occurs at the beginning of a line.

- `AT_WHITESPACE_END` - If set to `TRUE`, the sequence will only be highlighted if it is the first non-whitespace text in the line.

- `AT_WORD_START` - If set to `TRUE`, the sequence will only be highlighted if it occurs at the beginning of a word.

- `EXCLUDE_MATCH` - If set to `TRUE`, the match will not be highlighted, only the text before it will.

Here is a rule that highlights labels in Java mode (for example, “XXX:”):

    <MARK_PREVIOUS AT_WHITESPACE_END="TRUE"
       EXCLUDE_MATCH="TRUE">:</MARK_PREVIOUS>

Prev | Up | Next
The EOL_SPAN_REGEXP Tag | Home | The MARK_FOLLOWING Tag