KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

274 lines
14KB

  1. <?php
  2. /**************************************************************************************
  3. * pys60.php
  4. * ----------
  5. * Author: Sohan Basak (ronnie.basak96 @gmail.com)
  6. * Copyright: (c) 2012 Sohan Basak (http://tothepower.tk), Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2012/05/03
  9. *
  10. * Python for S60 language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * No Changes Till Date
  15. *
  16. * The python.php file is extended to pys60.php with required modifications
  17. *
  18. * NOTES
  19. *
  20. * -I have kept the ":" in Reserved chars, so that it gets highlighted differently than brackets and/or symbols
  21. *
  22. *************************************************************************************
  23. *
  24. * This file is part of GeSHi.
  25. *
  26. * GeSHi is free software; you can redistribute it and/or modify
  27. * it under the terms of the GNU General Public License as published by
  28. * the Free Software Foundation; either version 2 of the License, or
  29. * (at your option) any later version.
  30. *
  31. * GeSHi is distributed in the hope that it will be useful,
  32. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  34. * GNU General Public License for more details.
  35. *
  36. * You should have received a copy of the GNU General Public License
  37. * along with GeSHi; if not, write to the Free Software
  38. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  39. *
  40. ************************************************************************************/
  41. $language_data = array (
  42. 'LANG_NAME' => 'Python for S60',
  43. 'COMMENT_SINGLE' => array(1 => '#'),
  44. 'COMMENT_MULTI' => array(),
  45. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  46. 'QUOTEMARKS' => array('"', "'", '"""',"'''",'""','""'),
  47. 'ESCAPE_CHAR' => '\\',
  48. 'KEYWORDS' => array(
  49. /*
  50. ** Set 1: reserved words
  51. ** http://python.org/doc/current/ref/keywords.html
  52. */
  53. 1 => array(
  54. 'and', 'del', 'for', 'is', 'raise', 'assert', 'elif', 'from', 'lambda', 'return', 'break',
  55. 'else', 'global', 'not', 'try', 'class', 'except', 'if', 'or', 'while', 'continue', 'exec',
  56. 'import', 'pass', 'yield', 'def', 'finally', 'in', 'print', "<<", ">>", "as"
  57. ),
  58. /*
  59. ** Set 2: builtins
  60. ** http://python.org/doc/current/lib/built-in-funcs.html
  61. */
  62. 2 => array(
  63. '__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp',
  64. 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile',
  65. 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',
  66. 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',
  67. 'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
  68. 'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
  69. 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode',
  70. 'vars', 'xrange', 'zip',
  71. // Built-in constants: http://python.org/doc/current/lib/node35.html
  72. 'False', 'True', 'None', 'NotImplemented', 'Ellipsis',
  73. // Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html
  74. 'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',
  75. 'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',
  76. 'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',
  77. 'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',
  78. 'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',
  79. 'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',
  80. 'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',
  81. 'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',
  82. 'RuntimeWarning', 'FutureWarning',
  83. //Symbian Errors
  84. "SymbianError", "KernelError",
  85. // self: this is a common python convention (but not a reserved word)
  86. 'self'
  87. ),
  88. /*
  89. ** Set 3: standard library
  90. ** http://python.org/doc/current/lib/modindex.html
  91. */
  92. 3 => array(
  93. '__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',
  94. 'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',
  95. 'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',
  96. 'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',
  97. 'collections', 'colorsys', 'commands', 'compileall', 'compiler',
  98. 'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',
  99. 'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',
  100. 'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',
  101. 'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',
  102. 'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',
  103. 'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',
  104. 'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',
  105. 'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',
  106. 'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',
  107. 'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',
  108. 'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',
  109. 'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',
  110. 'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',
  111. 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',
  112. 're', 'readline', 'resource', 'rexec', 'rgbimg', 'rlcompleter',
  113. 'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',
  114. 'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',
  115. 'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',
  116. 'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',
  117. 'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',
  118. 'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',
  119. 'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',
  120. 'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',
  121. 'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',
  122. 'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib', "os.path", "sys.path",
  123. //PythonS60 Standard Library
  124. //http://pys60.garage.maemo.org/doc/s60/
  125. //These are the standard modules in the archive
  126. "appuifw", "globalui","e32", "telephone", "aosocket", "btsocket",
  127. "sysinfo","camera","graphics","keycapture","key_codes","topwindow", "gles",
  128. "glcanvas","sensor", "audio","messaging", "inbox","location","positioning",
  129. "contacts", "e32calendar", "e32db","e32dbm","logs","scriptext",
  130. "series60_console",
  131. //These are external but very often usable modules
  132. "appuifw2","ArchetypeUI","elementtree","lightblue",
  133. "activaprofile","Adjustor","akntextutils","aosocketnativenew",
  134. "appreciation","applicationmanager","appswitch","atextit","bt_teror","btconsole",
  135. "btswitch","cElementTree","cenrep","cerealizer","cl_gui","clipboard",
  136. "clipboard_CHN","debugger","decompile2",
  137. "dir_iter","download","easydb","ECenrep","Edit_find","efeature","elocation","envy",
  138. "EProfile","erestart","error","esyagent","Execwap","exprofile","fastcamera",
  139. "feature","fgimage","filebrowser","firmware","fold","fonts","fraction","FTP",
  140. "ftplibnew","fy_manager","fy_menu","gles_utils","gps_location","hack",
  141. "HTML2TXT","iapconnect","icon_image","image_decoder",
  142. "ini","interactive_console","inting","key_modifiers","key_tricks","keypress",
  143. "landmarks","lite_fm","locationacq","locationrequestor",
  144. "logo","markupbase","mbm","mbm2","minidb","miniinfo","MISC",
  145. "misty","Msg","ntpath","odict","Paintbox","pathinfo","pexif","pickcolor",
  146. "powlite_fm","powlite_fm2","powlite_fm3","powlite_fme","prgbar","prodb",
  147. "profileengine","progressbar","progressbartw","progressnotes",
  148. "ProgressBarTW2","proshivka","py_upload","pyConnection","PyFileMan",
  149. "pykeylock","PyPyc","pyqq","pys60crypto","pys60usb","rfc822",
  150. "RUSOS","scmk","scrollpage","SISFIELDS","SISFIELD","sisfile",
  151. "SISINFO","sisreader","Sistools","smidi","smsreject","speechy","sre_compile",
  152. "sre_constants","sre_parse","sre","sysagent","syslang","TextMan",
  153. "textrenderer","TextWrap","topwind","tsocket","uikludge","uikludges","uitricks",
  154. "walkfile","wallpaper","wfm_lite",
  155. "wif_keys","wif","window","wlanmgmt","wlantools","wt_color","wt_requesters",
  156. "zhkey",
  157. //These are recent additions
  158. "miffile"
  159. ),
  160. /*
  161. ** Set 4: special methods
  162. ** http://python.org/doc/current/ref/specialnames.html
  163. */
  164. 4 => array(
  165. ///*
  166. //// Iterator types: http://python.org/doc/current/lib/typeiter.html
  167. //'__iter__', 'next',
  168. //// String types: http://python.org/doc/current/lib/string-methods.html
  169. //'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
  170. //'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle',
  171. //'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
  172. //'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
  173. //'translate', 'upper', 'zfill',
  174. // */
  175. // Basic customization: http://python.org/doc/current/ref/customization.html
  176. '__new__', '__init__', '__del__', '__repr__', '__str__',
  177. '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',
  178. '__hash__', '__nonzero__', '__unicode__', '__dict__',
  179. // Attribute access: http://python.org/doc/current/ref/attribute-access.html
  180. '__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',
  181. '__delete__', '__slots__',
  182. // Class creation, callable objects
  183. '__metaclass__', '__call__',
  184. // Container types: http://python.org/doc/current/ref/sequence-types.html
  185. '__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',
  186. '__getslice__', '__setslice__', '__delslice__',
  187. // Numeric types: http://python.org/doc/current/ref/numeric-types.html
  188. '__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',
  189. '__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',
  190. '__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',
  191. '__long__','__lshift__',
  192. '__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',
  193. '__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',
  194. '__rshift__','__rsub__','__rmul__','__rand__','__rxor__','__ror__',
  195. '__sub__','__xor__'
  196. )
  197. ),
  198. 'SYMBOLS' => array(
  199. '(', ')', '[', ']', '{', '}', '*', '&', '%', '!', ';', '<', '>', '?', '`'
  200. ),
  201. 'CASE_SENSITIVE' => array(
  202. GESHI_COMMENTS => true,
  203. 1 => true,
  204. 2 => true,
  205. 3 => true,
  206. 4 => true
  207. ),
  208. 'STYLES' => array(
  209. 'KEYWORDS' => array(
  210. 1 => 'color: #006000;font-weight:bold;', // Reserved
  211. 2 => 'color: #800950;font-size:105%', // Built-ins + self
  212. 3 => 'color: #003399;font-size:106%', // Standard lib
  213. 4 => 'color: #0000cd;' // Special methods
  214. ),
  215. 'COMMENTS' => array(
  216. 1 => 'color: #808080; font-style:italic;font-size:92%',
  217. 'MULTI' => 'color: #808080; font-style: italic;'
  218. ),
  219. 'ESCAPE_CHAR' => array(
  220. 0 => 'color: #930; font-weight: bold;font-size:105%'
  221. ),
  222. 'BRACKETS' => array(
  223. 0 => 'color: maroon;font-size:102%;padding:2px'
  224. ),
  225. 'STRINGS' => array(
  226. 0 => 'color: #666;'
  227. ),
  228. 'NUMBERS' => array(
  229. 0 => 'color: #2356F8;'
  230. ),
  231. 'METHODS' => array(
  232. 1 => 'color: navy;'
  233. ),
  234. 'SYMBOLS' => array(
  235. 0 => 'color: #66ccFF;'
  236. ),
  237. 'REGEXPS' => array(
  238. ),
  239. 'SCRIPT' => array(
  240. )
  241. ),
  242. 'URLS' => array(
  243. 1 => '',
  244. 2 => '',
  245. 3 => '',
  246. 4 => ''
  247. ),
  248. 'OOLANG' => true,
  249. 'OBJECT_SPLITTERS' => array(
  250. 1 => '.'
  251. ),
  252. 'REGEXPS' => array(
  253. ),
  254. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  255. 'SCRIPT_DELIMITERS' => array(
  256. ),
  257. 'HIGHLIGHT_STRICT_BLOCK' => array(
  258. )
  259. );
  260. ?>