The MATCH_TYPE Attribute
Prev | Chapter 10. Mode Definition Syntax | Next

## The MATCH_TYPE Attribute

The `MATCH_TYPE` attribute is used by some of the rules to control how the region matched by the rule will be highlighted.

For example, when using a `MARK_PREVIOUS` rule to highlight a function call of the form `fcall()`, the following rule could be used:

       <MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR">(</MARK_PREVIOUS>

This would cause `fcall` to be highlighted as `FUNCTION`, and `(` to be highlighted as `OPERATOR`. In this case, to maintain bracket matching working, a `SEQ` rule would have to be added to match `)` and mark it as `OPERATOR`.

The `MATCH_TYPE` attribute value can be any of the valid token types, or the following special values:

- `RULE`: this is the default value. It tells the syntax system to use the same token type as the TYPE attribute of the rule. This is equivalent to `EXCLUDE_MATCH="FALSE"` in 4.2 and earlier mode files.

- `CONTEXT`: using this value tells the syntax system to mark the matched region using the default token type for the current rule set. In 4.2 and earlier mode files, this was specified by `EXCLUDE_MATCH="TRUE"`.

Prev | Up | Next
Token Types | Home | Chapter 11. Installing Edit Modes