PageRenderTime 141ms CodeModel.GetById 34ms RepoModel.GetById 0ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/users-guide/mode-rule-import.html

#
HTML | 33 lines | 29 code | 4 blank | 0 comment | 0 complexity | d0d0fd9dd7aa9620324a946a8cba4a3f MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>The IMPORT Tag</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-rule-seq-regexp.html" title="The SEQ_REGEXP Tag"><link rel="next" href="mode-rule-keywords.html" title="The KEYWORDS Tag"></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 IMPORT Tag</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mode-rule-seq-regexp.html">Prev</a> </td><th width="60%" align="center">Chapter 10. Mode Definition Syntax</th><td width="20%" align="right"> <a accesskey="n" href="mode-rule-keywords.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-rule-import"></a>The IMPORT Tag</h2></div></div></div><p>The <code class="literal">IMPORT</code> tag, which must be placed inside a
  2. <code class="literal">RULES</code> tag, loads all rules defined in a given ruleset
  3. into the current ruleset; in other words, it has the same effect as
  4. copying and pasting the imported ruleset.</p><p>The only required attribute <code class="literal">DELEGATE</code> must be
  5. set to the name of a ruleset. To import a ruleset defined in the current
  6. mode, just specify its name. To import a ruleset defined in another
  7. mode, specify a name of the form
  8. <code class="literal"><em class="replaceable"><code>mode</code></em>::<em class="replaceable"><code>ruleset</code></em></code>.
  9. Note that the first (unnamed) ruleset in a mode is called
  10. &#8220;<span class="quote">MAIN</span>&#8221;.</p><p>One quirk is that the definition of the imported ruleset is not
  11. copied to the location of the <code class="literal">IMPORT</code> tag, but rather
  12. to the end of the containing ruleset. This has implications with
  13. rule-ordering; see <a class="xref" href="mode-tag-rules.html#rule-ordering" title="Rule Ordering Requirements">the section called &#8220;Rule Ordering Requirements&#8221;</a>.</p><p>Here is an example from the PHP mode, which extends the inline
  14. JavaScript highlighting to support embedded PHP:</p><pre class="programlisting">
  15. &lt;RULES SET="JAVASCRIPT+PHP"&gt;
  16. &lt;SPAN TYPE="MARKUP" DELEGATE="php::PHP"&gt;
  17. &lt;BEGIN&gt;&amp;lt;?php&lt;/BEGIN&gt;
  18. &lt;END&gt;?&amp;gt;&lt;/END&gt;
  19. &lt;/SPAN&gt;
  20. &lt;SPAN TYPE="MARKUP" DELEGATE="php::PHP"&gt;
  21. &lt;BEGIN&gt;&amp;lt;?&lt;/BEGIN&gt;
  22. &lt;END&gt;?&amp;gt;&lt;/END&gt;
  23. &lt;/SPAN&gt;
  24. &lt;SPAN TYPE="MARKUP" DELEGATE="php::PHP"&gt;
  25. &lt;BEGIN&gt;&amp;lt;%=&lt;/BEGIN&gt;
  26. &lt;END&gt;%&amp;gt;&lt;/END&gt;
  27. &lt;/SPAN&gt;
  28. &lt;IMPORT DELEGATE="javascript::MAIN"/&gt;
  29. &lt;/RULES&gt;</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mode-rule-seq-regexp.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="mode-rule-keywords.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The SEQ_REGEXP Tag </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> The KEYWORDS Tag</td></tr></table></div></body></html>