PageRenderTime 51ms CodeModel.GetById 45ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-1-pre5/modes/python.xml

#
XML | 336 lines | 319 code | 4 blank | 13 comment | 0 complexity | 30e99b3fb65ce3363b946e246fb1b581 MD5 | raw file
  1<?xml version="1.0"?>
  2
  3<!DOCTYPE MODE SYSTEM "xmode.dtd">
  4
  5<!-- Python mode, by Slava Pestov. Based on PythonTokenMarker by -->
  6<!-- Jonathan Revusky -->
  7
  8<!-- Modified 19-Jul-00 by Ivan Frohne to: -->
  9<!--  (a) implement 'indentOnEnter'; -->
 10<!--  (b) indent next line automatically after control structures followed -->
 11<!--	  by ':'; -->
 12<!--  (c) make """ or ''' multiline quotes TYPE LITERAL2; -->
 13<!--  (d) add TYPE FUNCTION identified by a following '(' -->
 14<!--  (e) eliminate the '?' SEQ TYPE ('?' has no meaning in Python); -->
 15<!--  (f) change the TYPE of 'and', 'or', and 'not' to KEYWORD1; and -->
 16<!--  (g) add all builtin functions, builtin exceptions, -->
 17<!--	  builtin type methods, File object methods, and special type -->
 18<!--	  attributes as TYPE KEYWORD3. -->
 19
 20<MODE>
 21	<PROPS>
 22		<PROPERTY NAME="indentPrevLine" VALUE="\s*.{3,}:\s*(#.*)?" />
 23		<PROPERTY NAME="lineComment" VALUE="#" />
 24	</PROPS>
 25	<RULES ESCAPE="\" IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE">
 26		<!-- Comment -->
 27		<EOL_SPAN TYPE="COMMENT1">#</EOL_SPAN>
 28
 29		<!-- Triple-quotes -->
 30		<SPAN TYPE="LITERAL2">
 31			<BEGIN>"""</BEGIN>
 32			<END>"""</END>
 33		</SPAN>
 34
 35		<SPAN TYPE="LITERAL2">
 36			<BEGIN>'''</BEGIN>
 37			<END>'''</END>
 38		</SPAN>
 39
 40		<!-- Standard literals -->
 41		<SPAN TYPE="LITERAL1">
 42			<BEGIN>"</BEGIN>
 43			<END>"</END>
 44		</SPAN>
 45		<SPAN TYPE="LITERAL1">
 46			<BEGIN>'</BEGIN>
 47			<END>'</END>
 48		</SPAN>
 49
 50		<SEQ TYPE="OPERATOR">=</SEQ>
 51		<SEQ TYPE="OPERATOR">!</SEQ>
 52		<SEQ TYPE="OPERATOR">&gt;=</SEQ>
 53		<SEQ TYPE="OPERATOR">&lt;=</SEQ>
 54		<SEQ TYPE="OPERATOR">+</SEQ>
 55		<SEQ TYPE="OPERATOR">-</SEQ>
 56		<SEQ TYPE="OPERATOR">/</SEQ>
 57		<SEQ TYPE="OPERATOR">*</SEQ>
 58		<SEQ TYPE="OPERATOR">&gt;</SEQ>
 59		<SEQ TYPE="OPERATOR">&lt;</SEQ>
 60		<SEQ TYPE="OPERATOR">%</SEQ>
 61		<SEQ TYPE="OPERATOR">&amp;</SEQ>
 62		<SEQ TYPE="OPERATOR">|</SEQ>
 63		<SEQ TYPE="OPERATOR">^</SEQ>
 64		<SEQ TYPE="OPERATOR">~</SEQ>
 65
 66		<MARK_PREVIOUS TYPE="FUNCTION"
 67			EXCLUDE_MATCH="TRUE">(</MARK_PREVIOUS>
 68
 69		<KEYWORDS>
 70			<!--  Reserved Words  -->
 71			<KEYWORD1>and</KEYWORD1>
 72			<KEYWORD1>as</KEYWORD1>
 73			<KEYWORD1>assert</KEYWORD1>
 74			<KEYWORD1>break</KEYWORD1>
 75			<KEYWORD1>class</KEYWORD1>
 76			<KEYWORD1>continue</KEYWORD1>
 77			<KEYWORD1>def</KEYWORD1>
 78			<KEYWORD1>del</KEYWORD1>
 79			<KEYWORD1>elif</KEYWORD1>
 80			<KEYWORD1>else</KEYWORD1>
 81			<KEYWORD1>except</KEYWORD1>
 82			<KEYWORD1>exec</KEYWORD1>
 83			<KEYWORD1>finally</KEYWORD1>
 84			<KEYWORD1>for</KEYWORD1>
 85			<KEYWORD1>from</KEYWORD1>
 86			<KEYWORD1>global</KEYWORD1>
 87			<KEYWORD1>if</KEYWORD1>
 88			<KEYWORD1>import</KEYWORD1>
 89			<KEYWORD1>in</KEYWORD1>
 90			<KEYWORD1>is</KEYWORD1>
 91			<KEYWORD1>lambda</KEYWORD1>
 92			<KEYWORD1>not</KEYWORD1>
 93			<KEYWORD1>or</KEYWORD1>
 94			<KEYWORD1>pass</KEYWORD1>
 95			<KEYWORD1>print</KEYWORD1>
 96			<KEYWORD1>raise</KEYWORD1>
 97			<KEYWORD1>return</KEYWORD1>
 98			<KEYWORD1>try</KEYWORD1>
 99			<KEYWORD1>while</KEYWORD1>
100			<KEYWORD1>yield</KEYWORD1>
101
102			<!-- builtins -->
103			<KEYWORD2>abs</KEYWORD2>
104			<KEYWORD2>apply</KEYWORD2>
105			<KEYWORD2>bool</KEYWORD2>
106			<KEYWORD2>buffer</KEYWORD2>
107			<KEYWORD2>callable</KEYWORD2>
108			<KEYWORD2>chr</KEYWORD2>
109			<KEYWORD2>classmethod</KEYWORD2>
110			<KEYWORD2>cmp</KEYWORD2>
111			<KEYWORD2>coerce</KEYWORD2>
112			<KEYWORD2>compile</KEYWORD2>
113			<KEYWORD2>complex</KEYWORD2>
114			<KEYWORD2>delattr</KEYWORD2>
115			<KEYWORD2>dict</KEYWORD2>
116			<KEYWORD2>dir</KEYWORD2>
117			<KEYWORD2>divmod</KEYWORD2>
118			<KEYWORD2>eval</KEYWORD2>
119			<KEYWORD2>execfile</KEYWORD2>
120			<KEYWORD2>file</KEYWORD2>
121			<KEYWORD2>filter</KEYWORD2>
122			<KEYWORD2>float</KEYWORD2>
123			<KEYWORD2>getattr</KEYWORD2>
124			<KEYWORD2>globals</KEYWORD2>
125			<KEYWORD2>hasattr</KEYWORD2>
126			<KEYWORD2>hash</KEYWORD2>
127			<KEYWORD2>hex</KEYWORD2>
128			<KEYWORD2>id</KEYWORD2>
129			<KEYWORD2>input</KEYWORD2>
130			<KEYWORD2>int</KEYWORD2>
131			<KEYWORD2>intern</KEYWORD2>
132			<KEYWORD2>isinstance</KEYWORD2>
133			<KEYWORD2>issubclass</KEYWORD2>
134			<KEYWORD2>iter</KEYWORD2>
135			<KEYWORD2>len</KEYWORD2>
136			<KEYWORD2>list</KEYWORD2>
137			<KEYWORD2>locals</KEYWORD2>
138			<KEYWORD2>long</KEYWORD2>
139			<KEYWORD2>map</KEYWORD2>
140			<KEYWORD2>max</KEYWORD2>
141			<KEYWORD2>min</KEYWORD2>
142			<KEYWORD2>object</KEYWORD2>
143			<KEYWORD2>oct</KEYWORD2>
144			<KEYWORD2>open</KEYWORD2>
145			<KEYWORD2>ord</KEYWORD2>
146			<KEYWORD2>pow</KEYWORD2>
147			<KEYWORD2>property</KEYWORD2>
148			<KEYWORD2>range</KEYWORD2>
149			<KEYWORD2>raw_input</KEYWORD2>
150			<KEYWORD2>reduce</KEYWORD2>
151			<KEYWORD2>reload</KEYWORD2>
152			<KEYWORD2>repr</KEYWORD2>
153			<KEYWORD2>round</KEYWORD2>
154			<KEYWORD2>setattr</KEYWORD2>
155			<KEYWORD2>slice</KEYWORD2>
156			<KEYWORD2>staticmethod</KEYWORD2>
157			<KEYWORD2>str</KEYWORD2>
158			<KEYWORD2>super</KEYWORD2>
159			<KEYWORD2>tuple</KEYWORD2>
160			<KEYWORD2>type</KEYWORD2>
161			<KEYWORD2>unichr</KEYWORD2>
162			<KEYWORD2>unicode</KEYWORD2>
163			<KEYWORD2>vars</KEYWORD2>
164			<KEYWORD2>xrange</KEYWORD2>
165			<KEYWORD2>zip</KEYWORD2>
166
167			<!-- exceptions -->
168			<KEYWORD3>ArithmeticError</KEYWORD3>
169			<KEYWORD3>AssertionError</KEYWORD3>
170			<KEYWORD3>AttributeError</KEYWORD3>
171			<KEYWORD3>DeprecationWarning</KEYWORD3>
172			<KEYWORD3>EOFError</KEYWORD3>
173			<KEYWORD3>EnvironmentError</KEYWORD3>
174			<KEYWORD3>Exception</KEYWORD3>
175			<KEYWORD3>FloatingPointError</KEYWORD3>
176			<KEYWORD3>IOError</KEYWORD3>
177			<KEYWORD3>ImportError</KEYWORD3>
178			<KEYWORD3>IndentationError</KEYWORD3>
179			<KEYWORD3>IndexError</KEYWORD3>
180			<KEYWORD3>KeyError</KEYWORD3>
181			<KEYWORD3>KeyboardInterrupt</KEYWORD3>
182			<KEYWORD3>LookupError</KEYWORD3>
183			<KEYWORD3>MemoryError</KEYWORD3>
184			<KEYWORD3>NameError</KEYWORD3>
185			<KEYWORD3>NotImplemented</KEYWORD3>
186			<KEYWORD3>NotImplementedError</KEYWORD3>
187			<KEYWORD3>OSError</KEYWORD3>
188			<KEYWORD3>OverflowError</KEYWORD3>
189			<KEYWORD3>OverflowWarning</KEYWORD3>
190			<KEYWORD3>ReferenceError</KEYWORD3>
191			<KEYWORD3>RuntimeError</KEYWORD3>
192			<KEYWORD3>RuntimeWarning</KEYWORD3>
193			<KEYWORD3>StandardError</KEYWORD3>
194			<KEYWORD3>StopIteration</KEYWORD3>
195			<KEYWORD3>SyntaxError</KEYWORD3>
196			<KEYWORD3>SyntaxWarning</KEYWORD3>
197			<KEYWORD3>SystemError</KEYWORD3>
198			<KEYWORD3>SystemExit</KEYWORD3>
199			<KEYWORD3>TabError</KEYWORD3>
200			<KEYWORD3>TypeError</KEYWORD3>
201			<KEYWORD3>UnboundLocalError</KEYWORD3>
202			<KEYWORD3>UnicodeError</KEYWORD3>
203			<KEYWORD3>UserWarning</KEYWORD3>
204			<KEYWORD3>ValueError</KEYWORD3>
205			<KEYWORD3>Warning</KEYWORD3>
206			<KEYWORD3>WindowsError</KEYWORD3>
207			<KEYWORD3>ZeroDivisionError</KEYWORD3>
208
209			<!-- types (from types module) -->
210			<KEYWORD3>BufferType</KEYWORD3>
211			<KEYWORD3>BuiltinFunctionType</KEYWORD3>
212			<KEYWORD3>BuiltinMethodType</KEYWORD3>
213			<KEYWORD3>ClassType</KEYWORD3>
214			<KEYWORD3>CodeType</KEYWORD3>
215			<KEYWORD3>ComplexType</KEYWORD3>
216			<KEYWORD3>DictProxyType</KEYWORD3>
217			<KEYWORD3>DictType</KEYWORD3>
218			<KEYWORD3>DictionaryType</KEYWORD3>
219			<KEYWORD3>EllipsisType</KEYWORD3>
220			<KEYWORD3>FileType</KEYWORD3>
221			<KEYWORD3>FloatType</KEYWORD3>
222			<KEYWORD3>FrameType</KEYWORD3>
223			<KEYWORD3>FunctionType</KEYWORD3>
224			<KEYWORD3>GeneratorType</KEYWORD3>
225			<KEYWORD3>InstanceType</KEYWORD3>
226			<KEYWORD3>IntType</KEYWORD3>
227			<KEYWORD3>LambdaType</KEYWORD3>
228			<KEYWORD3>ListType</KEYWORD3>
229			<KEYWORD3>LongType</KEYWORD3>
230			<KEYWORD3>MethodType</KEYWORD3>
231			<KEYWORD3>ModuleType</KEYWORD3>
232			<KEYWORD3>NoneType</KEYWORD3>
233			<KEYWORD3>ObjectType</KEYWORD3>
234			<KEYWORD3>SliceType</KEYWORD3>
235			<KEYWORD3>StringType</KEYWORD3>
236			<KEYWORD3>StringTypes</KEYWORD3>
237			<KEYWORD3>TracebackType</KEYWORD3>
238			<KEYWORD3>TupleType</KEYWORD3>
239			<KEYWORD3>TypeType</KEYWORD3>
240			<KEYWORD3>UnboundMethodType</KEYWORD3>
241			<KEYWORD3>UnicodeType</KEYWORD3>
242			<KEYWORD3>XRangeType</KEYWORD3>
243
244			<KEYWORD3>False</KEYWORD3>
245			<KEYWORD3>None</KEYWORD3>
246			<KEYWORD3>True</KEYWORD3>
247
248			<KEYWORD3>__abs__</KEYWORD3>
249			<KEYWORD3>__add__</KEYWORD3>
250			<KEYWORD3>__all__</KEYWORD3>
251			<KEYWORD3>__author__</KEYWORD3>
252			<KEYWORD3>__bases__</KEYWORD3>
253			<KEYWORD3>__builtins__</KEYWORD3>
254			<KEYWORD3>__call__</KEYWORD3>
255			<KEYWORD3>__class__</KEYWORD3>
256			<KEYWORD3>__cmp__</KEYWORD3>
257			<KEYWORD3>__coerce__</KEYWORD3>
258			<KEYWORD3>__contains__</KEYWORD3>
259			<KEYWORD3>__debug__</KEYWORD3>
260			<KEYWORD3>__del__</KEYWORD3>
261			<KEYWORD3>__delattr__</KEYWORD3>
262			<KEYWORD3>__delitem__</KEYWORD3>
263			<KEYWORD3>__delslice__</KEYWORD3>
264			<KEYWORD3>__dict__</KEYWORD3>
265			<KEYWORD3>__div__</KEYWORD3>
266			<KEYWORD3>__divmod__</KEYWORD3>
267			<KEYWORD3>__doc__</KEYWORD3>
268			<KEYWORD3>__eq__</KEYWORD3>
269			<KEYWORD3>__file__</KEYWORD3>
270			<KEYWORD3>__float__</KEYWORD3>
271			<KEYWORD3>__floordiv__</KEYWORD3>
272			<KEYWORD3>__future__</KEYWORD3>
273			<KEYWORD3>__ge__</KEYWORD3>
274			<KEYWORD3>__getattr__</KEYWORD3>
275			<KEYWORD3>__getattribute__</KEYWORD3>
276			<KEYWORD3>__getitem__</KEYWORD3>
277			<KEYWORD3>__getslice__</KEYWORD3>
278			<KEYWORD3>__gt__</KEYWORD3>
279			<KEYWORD3>__hash__</KEYWORD3>
280			<KEYWORD3>__hex__</KEYWORD3>
281			<KEYWORD3>__iadd__</KEYWORD3>
282			<KEYWORD3>__import__</KEYWORD3>
283			<KEYWORD3>__imul__</KEYWORD3>
284			<KEYWORD3>__init__</KEYWORD3>
285			<KEYWORD3>__int__</KEYWORD3>
286			<KEYWORD3>__invert__</KEYWORD3>
287			<KEYWORD3>__iter__</KEYWORD3>
288			<KEYWORD3>__le__</KEYWORD3>
289			<KEYWORD3>__len__</KEYWORD3>
290			<KEYWORD3>__long__</KEYWORD3>
291			<KEYWORD3>__lshift__</KEYWORD3>
292			<KEYWORD3>__lt__</KEYWORD3>
293			<KEYWORD3>__members__</KEYWORD3>
294			<KEYWORD3>__metaclass__</KEYWORD3>
295			<KEYWORD3>__mod__</KEYWORD3>
296			<KEYWORD3>__mro__</KEYWORD3>
297			<KEYWORD3>__mul__</KEYWORD3>
298			<KEYWORD3>__name__</KEYWORD3>
299			<KEYWORD3>__ne__</KEYWORD3>
300			<KEYWORD3>__neg__</KEYWORD3>
301			<KEYWORD3>__new__</KEYWORD3>
302			<KEYWORD3>__nonzero__</KEYWORD3>
303			<KEYWORD3>__oct__</KEYWORD3>
304			<KEYWORD3>__or__</KEYWORD3>
305			<KEYWORD3>__path__</KEYWORD3>
306			<KEYWORD3>__pos__</KEYWORD3>
307			<KEYWORD3>__pow__</KEYWORD3>
308			<KEYWORD3>__radd__</KEYWORD3>
309			<KEYWORD3>__rdiv__</KEYWORD3>
310			<KEYWORD3>__rdivmod__</KEYWORD3>
311			<KEYWORD3>__reduce__</KEYWORD3>
312			<KEYWORD3>__repr__</KEYWORD3>
313			<KEYWORD3>__rfloordiv__</KEYWORD3>
314			<KEYWORD3>__rlshift__</KEYWORD3>
315			<KEYWORD3>__rmod__</KEYWORD3>
316			<KEYWORD3>__rmul__</KEYWORD3>
317			<KEYWORD3>__ror__</KEYWORD3>
318			<KEYWORD3>__rpow__</KEYWORD3>
319			<KEYWORD3>__rrshift__</KEYWORD3>
320			<KEYWORD3>__rsub__</KEYWORD3>
321			<KEYWORD3>__rtruediv__</KEYWORD3>
322			<KEYWORD3>__rxor__</KEYWORD3>
323			<KEYWORD3>__setattr__</KEYWORD3>
324			<KEYWORD3>__setitem__</KEYWORD3>
325			<KEYWORD3>__setslice__</KEYWORD3>
326			<KEYWORD3>__self__</KEYWORD3>
327			<KEYWORD3>__slots__</KEYWORD3>
328			<KEYWORD3>__str__</KEYWORD3>
329			<KEYWORD3>__sub__</KEYWORD3>
330			<KEYWORD3>__truediv__</KEYWORD3>
331			<KEYWORD3>__version__</KEYWORD3>
332			<KEYWORD3>__xor__</KEYWORD3>
333		</KEYWORDS>
334	</RULES>
335</MODE>
336