PageRenderTime 90ms CodeModel.GetById 60ms app.highlight 5ms RepoModel.GetById 21ms app.codeStats 0ms

/jEdit/tags/jedit-4-3-pre5/modes/freemarker.xml

#
XML | 204 lines | 167 code | 25 blank | 12 comment | 0 complexity | 1e76027cc09909267c86a2a281ae4972 MD5 | raw file
  1<?xml version="1.0"?>
  2
  3<!DOCTYPE MODE SYSTEM "xmode.dtd">
  4
  5<!-- A JEdit mode configuration file for FTL (FreeMarker Template Language)
  6     Note that this version will only work with JEdit 4.1pre6 or later.
  7     by Jonathan Revusky, revusky@users.sourceforge.net -->
  8
  9<MODE>
 10  <RULES IGNORE_CASE="FALSE">
 11
 12    <!-- JavaScript -->
 13    <SPAN TYPE="MARKUP" DELEGATE="html::JAVASCRIPT">
 14    <BEGIN>&lt;script</BEGIN>
 15    <END>&lt;/script&gt;</END>
 16    </SPAN>
 17    <SPAN TYPE="MARKUP" DELEGATE="html::JAVASCRIPT">
 18    <BEGIN>&lt;Script</BEGIN>
 19    <END>&lt;/Script&gt;</END>
 20    </SPAN>
 21    <SPAN TYPE="MARKUP" DELEGATE="html::JAVASCRIPT">
 22    <BEGIN>&lt;SCRIPT</BEGIN>
 23    <END>&lt;/SCRIPT&gt;</END>
 24    </SPAN>
 25
 26    <!-- stylesheet -->
 27    <SPAN TYPE="MARKUP" DELEGATE="html::CSS">
 28    <BEGIN>&lt;style</BEGIN>
 29    <END>&lt;/style&gt;</END>
 30    </SPAN>
 31    <SPAN TYPE="MARKUP" DELEGATE="html::CSS">
 32    <BEGIN>&lt;Style</BEGIN>
 33    <END>&lt;/Style&gt;</END>
 34    </SPAN>
 35    <SPAN TYPE="MARKUP" DELEGATE="html::CSS">
 36    <BEGIN>&lt;STYLE</BEGIN>
 37    <END>&lt;/STYLE&gt;</END>
 38    </SPAN>
 39
 40    <!-- XML/HTML comment -->
 41    <SPAN TYPE="COMMENT2" DELEGATE="xml::DTD-TAGS">
 42    <BEGIN>&lt;!--</BEGIN>
 43    <END>--&gt;</END>
 44    </SPAN>
 45
 46    <!-- DTD instructions -->
 47    <SPAN TYPE="KEYWORD2" DELEGATE="xml::DTD-TAGS">
 48    <BEGIN>&lt;!</BEGIN>
 49    <END>&gt;</END>
 50    </SPAN>
 51
 52    <!-- FTL markup starts here. -->
 53
 54    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
 55      <BEGIN>${</BEGIN>
 56      <END>}</END>
 57    </SPAN>
 58
 59    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
 60      <BEGIN>#{</BEGIN>
 61      <END>}</END>
 62    </SPAN>
 63
 64    <SPAN_REGEXP TYPE="KEYWORD1" HASH_CHAR="&lt;" DELEGATE="EXPRESSION">
 65      <BEGIN>&lt;#ftl\&gt;</BEGIN>
 66      <END>&gt;</END>
 67    </SPAN_REGEXP>
 68
 69    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="EXPRESSION" HASH_CHAR="&lt;">
 70      <BEGIN>&lt;#?(if|elseif|switch|foreach|list|case|assign|local|global|setting|include|import|stop|escape|macro|function|transform|call|visit|recurse)(\s|/|$)</BEGIN>
 71      <END>&gt;</END>
 72    </SPAN_REGEXP>
 73
 74    <SEQ_REGEXP TYPE="KEYWORD1" HASH_CHAR="&lt;"
 75	>&lt;/#?(assign|local|global|if|switch|foreach|list|escape|macro|function|transform|compress|noescape)&gt;</SEQ_REGEXP>
 76
 77    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="INVALID" HASH_CHAR="&lt;">
 78      <BEGIN>&lt;#?(else|compress|noescape|default|break|flush|nested|t|rt|lt|return|recurse)\&gt;</BEGIN>
 79      <END>&gt;</END>
 80    </SPAN_REGEXP>
 81
 82    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="INVALID" HASH_CHAR="&lt;">
 83      <BEGIN>&lt;/@(([_@\p{Alpha}][_@\p{Alnum}]*)(\.[_@\p{Alpha}][_@\p{Alnum}]*)*?)?</BEGIN>
 84      <END>&gt;</END>
 85    </SPAN_REGEXP>
 86
 87    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="EXPRESSION" HASH_CHAR="&lt;">
 88      <BEGIN>&lt;@([_@\p{Alpha}][_@\p{Alnum}]*)(\.[_@\p{Alpha}][_@\p{Alnum}]*?)*</BEGIN>
 89      <END>&gt;</END>
 90    </SPAN_REGEXP>
 91
 92    <SPAN TYPE="COMMENT1">
 93      <BEGIN>&lt;#--</BEGIN>
 94      <END>--&gt;</END>
 95    </SPAN>
 96
 97    <SEQ TYPE="KEYWORD1">&lt;stop&gt;</SEQ>
 98     <SPAN TYPE="COMMENT1">
 99    <BEGIN>&lt;comment&gt;</BEGIN>
100    <END>&lt;/comment&gt;</END>
101    </SPAN>
102    <SPAN TYPE="INVALID">
103      <BEGIN>&lt;#</BEGIN>
104      <END>&gt;</END>
105    </SPAN>
106    <SPAN TYPE="INVALID">
107      <BEGIN>&lt;/#</BEGIN>
108      <END>&gt;</END>
109    </SPAN>
110
111    <!-- non-FTL markup -->
112    <SPAN TYPE="MARKUP" DELEGATE="TAGS">
113    <BEGIN>&lt;</BEGIN>
114    <END>&gt;</END>
115    </SPAN>
116  </RULES>
117
118  <RULES SET="EXPRESSION"
119      DEFAULT="KEYWORD2"
120      HIGHLIGHT_DIGITS="TRUE"
121      ESCAPE="\"
122    >
123    <SPAN TYPE="COMMENT1">
124      <BEGIN>&lt;#--</BEGIN>
125      <END>--&gt;</END>
126    </SPAN>
127    <SPAN TYPE="COMMENT1">
128      <BEGIN>&lt;!--</BEGIN>
129      <END>--&gt;</END>
130    </SPAN>
131
132    <SPAN TYPE="LITERAL1">
133    <BEGIN>"</BEGIN>
134    <END>"</END>
135    </SPAN>
136    <SPAN TYPE="OPERATOR" DELEGATE="EXPRESSION">
137      <BEGIN>(</BEGIN><END>)</END>
138    </SPAN>
139    <SEQ TYPE="OPERATOR">=</SEQ>
140    <SEQ TYPE="OPERATOR">!</SEQ>
141    <SEQ TYPE="OPERATOR">|</SEQ>
142    <SEQ TYPE="OPERATOR">&amp;</SEQ>
143    <SEQ TYPE="OPERATOR">&lt;</SEQ>
144    <SEQ TYPE="OPERATOR">&gt;</SEQ>
145    <SEQ TYPE="OPERATOR">*</SEQ>
146    <SEQ TYPE="OPERATOR">/</SEQ>
147    <SEQ TYPE="OPERATOR">-</SEQ>
148    <SEQ TYPE="OPERATOR">+</SEQ>
149    <SEQ TYPE="OPERATOR">%</SEQ>
150    <SEQ TYPE="OPERATOR">.</SEQ>
151    <SEQ TYPE="OPERATOR">:</SEQ>
152    <SEQ TYPE="OPERATOR">.</SEQ>
153    <SEQ TYPE="OPERATOR">.</SEQ>
154    <SEQ TYPE="OPERATOR">[</SEQ>
155    <SEQ TYPE="OPERATOR">]</SEQ>
156    <SEQ TYPE="OPERATOR">{</SEQ>
157    <SEQ TYPE="OPERATOR">}</SEQ>
158    <SEQ TYPE="OPERATOR">;</SEQ>
159    <!-- Builtins -->
160    <MARK_FOLLOWING TYPE="FUNCTION">?</MARK_FOLLOWING>
161    <KEYWORDS IGNORE_CASE="FALSE">
162      <KEYWORD1>true</KEYWORD1>
163      <KEYWORD1>false</KEYWORD1>
164      <KEYWORD1>as</KEYWORD1>
165      <KEYWORD1>in</KEYWORD1>
166      <KEYWORD1>using</KEYWORD1>
167      <OPERATOR>gt</OPERATOR>
168      <OPERATOR>gte</OPERATOR>
169      <OPERATOR>lt</OPERATOR>
170      <OPERATOR>lte</OPERATOR>
171    </KEYWORDS>
172  </RULES>
173
174  <RULES SET="TAGS" DEFAULT="MARKUP" ESCAPE="\">
175    <SPAN TYPE="LITERAL1" DELEGATE="INQUOTE">
176    <BEGIN>"</BEGIN>
177    <END>"</END>
178    </SPAN>
179
180    <SPAN TYPE="LITERAL1" DELEGATE="INQUOTE">
181    <BEGIN>'</BEGIN>
182    <END>'</END>
183    </SPAN>
184
185    <SEQ TYPE="OPERATOR">=</SEQ>
186  </RULES>
187
188
189  <!-- a ruleset for when we are within a quoted string within an SGML tag
190       It can contain FTL interpolations -->
191  <RULES SET="INQUOTE">
192    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
193    <BEGIN>${</BEGIN>
194    <END>}</END>
195    </SPAN>
196    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
197    <BEGIN>#{</BEGIN>
198    <END>}</END>
199    </SPAN>
200  </RULES>
201
202  <!-- empty ruleset to delegate to for spots where any non-whitespace is invalid -->
203  <RULES SET="INVALID" DEFAULT="INVALID" />
204</MODE>