PageRenderTime 34ms CodeModel.GetById 22ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms


HTML | 20 lines | 20 code | 0 blank | 0 comment | 0 complexity | 390176c1fcd20c9da0eebef92cc7d2b6 MD5 | raw file
 1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>The MATCH_TYPE Attribute</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="jEdit 4.3 User's Guide"><link rel="up" href="writing-modes.html" title="Chapter 10. Mode Definition Syntax"><link rel="prev" href="mode-syntax-tokens.html" title="Token Types"><link rel="next" href="installing-modes.html" title="Chapter 11. Installing Edit Modes"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The MATCH_TYPE Attribute</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mode-syntax-tokens.html">Prev</a> </td><th width="60%" align="center">Chapter 10. Mode Definition Syntax</th><td width="20%" align="right"> <a accesskey="n" href="installing-modes.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="mode-match-type"></a>The MATCH_TYPE Attribute</h2></div></div></div><p>The <code class="literal">MATCH_TYPE</code> attribute is used by some of the
 2        rules to control how the region matched by the rule will be
 3        highlighted.</p><p>For example, when using a <code class="literal">MARK_PREVIOUS</code> rule to
 4        highlight a function call of the form <code class="literal">fcall()</code>, the
 5        following rule could be used:</p><pre class="programlisting">
 6   &lt;MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR"&gt;(&lt;/MARK_PREVIOUS&gt;</pre><p>This would cause <code class="literal">fcall</code> to be highlighted as
 7        <code class="literal">FUNCTION</code>, and <code class="literal">(</code> to be highlighted
 8        as <code class="literal">OPERATOR</code>. In this case, to maintain bracket
 9        matching working, a <code class="literal">SEQ</code> rule would have to be added
10        to match <code class="literal">)</code> and mark it as
11        <code class="literal">OPERATOR</code>.</p><p>The <code class="literal">MATCH_TYPE</code> attribute value can be any of
12        the valid token types, or the following special values:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="literal">RULE</code>: this is the default value. It
13                tells the syntax system to use the same token type as the TYPE
14                attribute of the rule. This is equivalent to
15                <code class="literal">EXCLUDE_MATCH="FALSE"</code> in 4.2 and earlier mode
16                files.</p></li><li><p><code class="literal">CONTEXT</code>: using this value tells the
17                syntax system to mark the matched region using the default token
18                type for the current rule set. In 4.2 and earlier mode files,
19                this was specified by
20                <code class="literal">EXCLUDE_MATCH="TRUE"</code>.</p></li></ul></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mode-syntax-tokens.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="writing-modes.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="installing-modes.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Token Types </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 11. Installing Edit Modes</td></tr></table></div></body></html>