From: <tec...@us...> - 2008-09-21 17:19:20
|
Revision: 1025 http://colorer.svn.sourceforge.net/colorer/?rev=1025&view=rev Author: techtonik Date: 2008-09-21 17:19:13 +0000 (Sun, 21 Sep 2008) Log Message: ----------- + magic features of python syntax Modified Paths: -------------- branches/TECHTONIK-HRC-REF/colorer/hrc/base/python.hrc Modified: branches/TECHTONIK-HRC-REF/colorer/hrc/base/python.hrc =================================================================== --- branches/TECHTONIK-HRC-REF/colorer/hrc/base/python.hrc 2008-09-21 16:20:10 UTC (rev 1024) +++ branches/TECHTONIK-HRC-REF/colorer/hrc/base/python.hrc 2008-09-21 17:19:13 UTC (rev 1025) @@ -30,6 +30,7 @@ <region name="pyOperator" parent="def:Operator"/> <region name="pyDelimiter" parent="def:Symbol"/> <region name="pyOutline" parent="def:Outlined"/> + <region name="pySpecialName" parent="def:ParameterStrong"/> <scheme name="StringCommon"> <!-- common escapes for all types of Python strings --> @@ -86,13 +87,148 @@ </keywords> </scheme> + + <scheme name="SpecialNames"> + <!-- python magic --> + <keywords ignorecase="no" region="pySpecialName"> + <!-- The standard type hierarchy : http://docs.python.org/ref/types.html --> + <word name="None"/> + <word name="NotImplemented"/> + <word name="Ellipsis"/> + <word name="None"/> + <!-- User-defined functions special attributes --> + <word name="func_doc"/> + <word name="__doc__"/> + <word name="func_name"/> + <word name="__name__"/> + <word name="__module__"/> + <word name="func_defaults"/> + <word name="func_code"/> + <word name="func_globals"/> + <word name="func_dict"/> + <word name="func_closure"/> + <!-- Special method names : http://docs.python.org/ref/specialnames.html --> + <word name="__new__"/> + <word name="__init__"/> + <word name="__del__"/> + <word name="__repr__"/> + <word name="__str__"/> + <word name="__lt__"/> + <word name="__le__"/> + <word name="__eq__"/> + <word name="__ne__"/> + <word name="__gt__"/> + <word name="__ge__"/> + <word name="__cmp__"/> + <word name="__hash__"/> + <word name="__nonzero__"/> + <word name="__unicode__"/> + <!-- Customized attribute access --> + <word name="__getattr__"/> + <word name="__setattr__"/> + <word name="__delattr__"/> + <word name="__getattribute__"/> + <!-- Implementing descriptors --> + <word name="__get__"/> + <word name="__set__"/> + <word name="__delete__"/> + + + <word name="__slots__"/> + <word name="__metaclass__"/> + <word name="__call__"/> + + + <!-- Emulating containers --> + <word name="__len__"/> + <word name="__getitem__"/> + <word name="__setitem__"/> + <word name="__delitem__"/> + <word name="__iter__"/> + <word name="__contains__"/> + <!-- Emulating numeric types --> + <word name="__add__"/> + <word name="__sub__"/> + <word name="__mul__"/> + <word name="__floordiv__"/> + <word name="__mod__"/> + <word name="__divmod__"/> + <word name="__pow__"/> + <word name="__lshift__"/> + <word name="__rshift__"/> + <word name="__and__"/> + <word name="__xor__"/> + <word name="__or__"/> + + <word name="__div__"/> + <word name="__truediv__"/> + + <word name="__radd__"/> + <word name="__rsub__"/> + <word name="__rmul__"/> + <word name="__rdiv__"/> + <word name="__rtruediv__"/> + <word name="__rfloordiv__"/> + <word name="__rmod__"/> + <word name="__rdivmod__"/> + <word name="__rpow__"/> + <word name="__rlshift__"/> + <word name="__rrshift__"/> + <word name="__rand__"/> + <word name="__rxor__"/> + <word name="__ror__"/> + + <word name="__iadd__"/> + <word name="__isub__"/> + <word name="__imul__"/> + <word name="__idiv__"/> + <word name="__itruediv__"/> + <word name="__ifloordiv__"/> + <word name="__imod__"/> + <word name="__ipow__"/> + <word name="__ilshift__"/> + <word name="__irshift__"/> + <word name="__iand__"/> + <word name="__ixor__"/> + <word name="__ior__"/> + + <word name="__neg__"/> + <word name="__pos__"/> + <word name="__abs__"/> + <word name="__invert__"/> + + <word name="__complex__"/> + <word name="__int__"/> + <word name="__long__"/> + <word name="__float__"/> + + <word name="__oct__"/> + <word name="__hex__"/> + + <word name="__index__"/> + + <word name="__coerce__"/> + + <!-- With Statement Context Managers --> + + <word name="__enter__"/> + <word name="__exit__"/> + </keywords> + </scheme> + + <scheme name="python"> <!-- python outliner: class, def and __main__ --> <regexp match="/\M(?{pyOutline}^\s*(class|def)\s+\w+)/" /> <regexp match="/\M(?{pyOutline}^if\s+__name__\s+==\s+\"__main__\")/x"/> <inherit scheme="Keywords"/> + <inherit scheme="SpecialNames"/> + <!-- encoding declaration : http://docs.python.org/ref/encodings.html + todo - make it match only at file start --> + <regexp match="/^# (-\+- |vim:fileen)coding[=:]\s*(\w+).*/" region="pyComment" region2="pySpecialName"/> + <!-- python operators : http://docs.python.org/ref/keywords.html --> <keywords region="pyOperator"> <symb name="+"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |