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.

441 lines
21KB

  1. <?php
  2. /*************************************************************************************
  3. * erlang.php
  4. * --------
  5. * Author: Benny Baumann (BenBE@geshi.org)
  6. * Contributions:
  7. * - Uwe Dauernheim (uwe@dauernheim.net)
  8. * - Dan Forest-Barbier (dan@twisted.in)
  9. * Copyright: (c) 2008 Uwe Dauernheim (http://www.kreisquadratur.de/)
  10. * Release Version: 1.0.8.11
  11. * Date Started: 2008-09-27
  12. *
  13. * Erlang language file for GeSHi.
  14. *
  15. * CHANGES
  16. * -------
  17. * 2009/05/02 (1.0.8.3)
  18. * - Now using 'PARSER_CONTROL' instead of huge rexgexps, better and cleaner
  19. *
  20. * 2009/04/26 (1.0.8.3)
  21. * - Only link to existing docs / Fixes
  22. *
  23. * 2008-09-28 (1.0.0.1)
  24. * [!] Bug fixed with keyword module.
  25. * [+] Added more function names
  26. *
  27. * 2008-09-27 (1.0.0)
  28. * [ ] First Release
  29. *
  30. * TODO (updated 2008-09-27)
  31. * -------------------------
  32. * [!] Stop ';' from being transformed to '<SEMI>'
  33. *
  34. *************************************************************************************
  35. *
  36. * This file is part of GeSHi.
  37. *
  38. * GeSHi is free software; you can redistribute it and/or modify
  39. * it under the terms of the GNU General Public License as published by
  40. * the Free Software Foundation; either version 2 of the License, or
  41. * (at your option) any later version.
  42. *
  43. * GeSHi is distributed in the hope that it will be useful,
  44. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  45. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  46. * GNU General Public License for more details.
  47. *
  48. * You should have received a copy of the GNU General Public License
  49. * along with GeSHi; if not, write to the Free Software
  50. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  51. *
  52. ************************************************************************************/
  53. $language_data = array(
  54. 'LANG_NAME' => 'Erlang',
  55. 'COMMENT_SINGLE' => array(1 => '%'),
  56. 'COMMENT_MULTI' => array(),
  57. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  58. 'QUOTEMARKS' => array('"'),
  59. 'HARDQUOTE' => array("'", "'"),
  60. 'HARDESCAPE' => array("'", "\\"),
  61. 'HARDCHAR' => "\\",
  62. 'ESCAPE_CHAR' => '\\',
  63. 'NUMBERS' => GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_FLT_SCI_ZERO,
  64. 'KEYWORDS' => array(
  65. //Control flow keywrods
  66. 1 => array(
  67. 'after', 'andalso', 'begin', 'case', 'catch', 'end', 'fun', 'if',
  68. 'of', 'orelse', 'receive', 'try', 'when', 'query'
  69. ),
  70. //Binary operators
  71. 2 => array(
  72. 'and', 'band', 'bnot', 'bor', 'bsl', 'bsr', 'bxor', 'div', 'not',
  73. 'or', 'rem', 'xor'
  74. ),
  75. 3 => array(
  76. 'abs', 'alive', 'apply', 'atom_to_list', 'binary_to_list',
  77. 'binary_to_term', 'concat_binary', 'date', 'disconnect_node',
  78. 'element', 'erase', 'exit', 'float', 'float_to_list', 'get',
  79. 'get_keys', 'group_leader', 'halt', 'hd', 'integer_to_list',
  80. 'is_alive', 'length', 'link', 'list_to_atom', 'list_to_binary',
  81. 'list_to_float', 'list_to_integer', 'list_to_pid', 'list_to_tuple',
  82. 'load_module', 'make_ref', 'monitor_node', 'node', 'nodes', 'now',
  83. 'open_port', 'pid_to_list', 'process_flag', 'process_info',
  84. 'process', 'put', 'register', 'registered', 'round', 'self',
  85. 'setelement', 'size', 'spawn', 'spawn_link', 'split_binary',
  86. 'statistics', 'term_to_binary', 'throw', 'time', 'tl', 'trunc',
  87. 'tuple_to_list', 'unlink', 'unregister', 'whereis'
  88. ),
  89. // Built-In Functions
  90. 4 => array(
  91. 'atom', 'binary', 'constant', 'function', 'integer', 'is_atom',
  92. 'is_binary', 'is_constant', 'is_function', 'is_integer', 'is_list',
  93. 'is_number', 'is_pid', 'is_reference', 'is_record', 'list',
  94. 'number', 'pid', 'ports', 'port_close', 'port_info', 'reference'
  95. ),
  96. // Erlang/OTP internal modules (scary one)
  97. 5 => array(
  98. 'alarm_handler', 'any', 'app', 'application', 'appmon', 'appup',
  99. 'array', 'asn1ct', 'asn1rt', 'auth', 'base64', 'beam_lib', 'c',
  100. 'calendar', 'code', 'common_test_app', 'compile', 'config',
  101. 'corba', 'corba_object', 'cosEventApp', 'CosEventChannelAdmin',
  102. 'CosEventChannelAdmin_ConsumerAdmin',
  103. 'CosEventChannelAdmin_EventChannel',
  104. 'CosEventChannelAdmin_ProxyPullConsumer',
  105. 'CosEventChannelAdmin_ProxyPullSupplier',
  106. 'CosEventChannelAdmin_ProxyPushConsumer',
  107. 'CosEventChannelAdmin_ProxyPushSupplier',
  108. 'CosEventChannelAdmin_SupplierAdmin', 'CosEventDomainAdmin',
  109. 'CosEventDomainAdmin_EventDomain',
  110. 'CosEventDomainAdmin_EventDomainFactory',
  111. 'cosEventDomainApp', 'CosFileTransfer_Directory',
  112. 'CosFileTransfer_File', 'CosFileTransfer_FileIterator',
  113. 'CosFileTransfer_FileTransferSession',
  114. 'CosFileTransfer_VirtualFileSystem',
  115. 'cosFileTransferApp', 'CosNaming', 'CosNaming_BindingIterator',
  116. 'CosNaming_NamingContext', 'CosNaming_NamingContextExt',
  117. 'CosNotification', 'CosNotification_AdminPropertiesAdmin',
  118. 'CosNotification_QoSAdmin', 'cosNotificationApp',
  119. 'CosNotifyChannelAdmin_ConsumerAdmin',
  120. 'CosNotifyChannelAdmin_EventChannel',
  121. 'CosNotifyChannelAdmin_EventChannelFactory',
  122. 'CosNotifyChannelAdmin_ProxyConsumer',
  123. 'CosNotifyChannelAdmin_ProxyPullConsumer',
  124. 'CosNotifyChannelAdmin_ProxyPullSupplier',
  125. 'CosNotifyChannelAdmin_ProxyPushConsumer',
  126. 'CosNotifyChannelAdmin_ProxyPushSupplier',
  127. 'CosNotifyChannelAdmin_ProxySupplier',
  128. 'CosNotifyChannelAdmin_SequenceProxyPullConsumer',
  129. 'CosNotifyChannelAdmin_SequenceProxyPullSupplier',
  130. 'CosNotifyChannelAdmin_SequenceProxyPushConsumer',
  131. 'CosNotifyChannelAdmin_SequenceProxyPushSupplier',
  132. 'CosNotifyChannelAdmin_StructuredProxyPullConsumer',
  133. 'CosNotifyChannelAdmin_StructuredProxyPullSupplier',
  134. 'CosNotifyChannelAdmin_StructuredProxyPushConsumer',
  135. 'CosNotifyChannelAdmin_StructuredProxyPushSupplier',
  136. 'CosNotifyChannelAdmin_SupplierAdmin',
  137. 'CosNotifyComm_NotifyPublish', 'CosNotifyComm_NotifySubscribe',
  138. 'CosNotifyFilter_Filter', 'CosNotifyFilter_FilterAdmin',
  139. 'CosNotifyFilter_FilterFactory', 'CosNotifyFilter_MappingFilter',
  140. 'cosProperty', 'CosPropertyService_PropertiesIterator',
  141. 'CosPropertyService_PropertyNamesIterator',
  142. 'CosPropertyService_PropertySet',
  143. 'CosPropertyService_PropertySetDef',
  144. 'CosPropertyService_PropertySetDefFactory',
  145. 'CosPropertyService_PropertySetFactory', 'cosTime',
  146. 'CosTime_TimeService', 'CosTime_TIO', 'CosTime_UTO',
  147. 'CosTimerEvent_TimerEventHandler',
  148. 'CosTimerEvent_TimerEventService', 'cosTransactions',
  149. 'CosTransactions_Control', 'CosTransactions_Coordinator',
  150. 'CosTransactions_RecoveryCoordinator', 'CosTransactions_Resource',
  151. 'CosTransactions_SubtransactionAwareResource',
  152. 'CosTransactions_Terminator', 'CosTransactions_TransactionFactory',
  153. 'cover', 'cprof', 'cpu_sup', 'crashdump', 'crypto', 'crypto_app',
  154. 'ct', 'ct_cover', 'ct_ftp', 'ct_master', 'ct_rpc', 'ct_snmp',
  155. 'ct_ssh', 'ct_telnet', 'dbg', 'debugger', 'dets', 'dialyzer',
  156. 'dict', 'digraph', 'digraph_utils', 'disk_log', 'disksup',
  157. 'docb_gen', 'docb_transform', 'docb_xml_check', 'docbuilder_app',
  158. 'driver_entry', 'edoc', 'edoc_doclet', 'edoc_extract',
  159. 'edoc_layout', 'edoc_lib', 'edoc_run', 'egd', 'ei', 'ei_connect',
  160. 'epmd', 'epp', 'epp_dodger', 'eprof', 'erl', 'erl_boot_server',
  161. 'erl_call', 'erl_comment_scan', 'erl_connect', 'erl_ddll',
  162. 'erl_driver', 'erl_error', 'erl_eterm', 'erl_eval',
  163. 'erl_expand_records', 'erl_format', 'erl_global', 'erl_id_trans',
  164. 'erl_internal', 'erl_lint', 'erl_malloc', 'erl_marshal',
  165. 'erl_parse', 'erl_pp', 'erl_prettypr', 'erl_prim_loader',
  166. 'erl_prim_loader_stub', 'erl_recomment', 'erl_scan',
  167. 'erl_set_memory_block', 'erl_syntax', 'erl_syntax_lib', 'erl_tar',
  168. 'erl_tidy', 'erlang', 'erlang_mode', 'erlang_stub', 'erlc',
  169. 'erlsrv', 'error_handler', 'error_logger', 'erts_alloc',
  170. 'erts_alloc_config', 'escript', 'et', 'et_collector',
  171. 'et_selector', 'et_viewer', 'etop', 'ets', 'eunit', 'file',
  172. 'file_sorter', 'filelib', 'filename', 'fixed', 'fprof', 'ftp',
  173. 'gb_sets', 'gb_trees', 'gen_event', 'gen_fsm', 'gen_sctp',
  174. 'gen_server', 'gen_tcp', 'gen_udp', 'gl', 'global', 'global_group',
  175. 'glu', 'gs', 'heart', 'http', 'httpd', 'httpd_conf',
  176. 'httpd_socket', 'httpd_util', 'i', 'ic', 'ic_c_protocol',
  177. 'ic_clib', 'igor', 'inet', 'inets', 'init', 'init_stub',
  178. 'instrument', 'int', 'interceptors', 'inviso', 'inviso_as_lib',
  179. 'inviso_lfm', 'inviso_lfm_tpfreader', 'inviso_rt',
  180. 'inviso_rt_meta', 'io', 'io_lib', 'kernel_app', 'lib', 'lists',
  181. 'lname', 'lname_component', 'log_mf_h', 'make', 'math', 'megaco',
  182. 'megaco_codec_meas', 'megaco_codec_transform',
  183. 'megaco_edist_compress', 'megaco_encoder', 'megaco_flex_scanner',
  184. 'megaco_tcp', 'megaco_transport', 'megaco_udp', 'megaco_user',
  185. 'memsup', 'mnesia', 'mnesia_frag_hash', 'mnesia_registry',
  186. 'mod_alias', 'mod_auth', 'mod_esi', 'mod_security',
  187. 'Module_Interface', 'ms_transform', 'net_adm', 'net_kernel',
  188. 'new_ssl', 'nteventlog', 'observer_app', 'odbc', 'orber',
  189. 'orber_acl', 'orber_diagnostics', 'orber_ifr', 'orber_tc',
  190. 'orddict', 'ordsets', 'os', 'os_mon', 'os_mon_mib', 'os_sup',
  191. 'otp_mib', 'overload', 'packages', 'percept', 'percept_profile',
  192. 'pg', 'pg2', 'pman', 'pool', 'prettypr', 'proc_lib', 'proplists',
  193. 'public_key', 'qlc', 'queue', 'random', 'rb', 're', 'regexp',
  194. 'registry', 'rel', 'release_handler', 'reltool', 'relup', 'rpc',
  195. 'run_erl', 'run_test', 'runtime_tools_app', 'sasl_app', 'script',
  196. 'seq_trace', 'sets', 'shell', 'shell_default', 'slave', 'snmp',
  197. 'snmp_app', 'snmp_community_mib', 'snmp_framework_mib',
  198. 'snmp_generic', 'snmp_index', 'snmp_notification_mib', 'snmp_pdus',
  199. 'snmp_standard_mib', 'snmp_target_mib', 'snmp_user_based_sm_mib',
  200. 'snmp_view_based_acm_mib', 'snmpa', 'snmpa_conf', 'snmpa_error',
  201. 'snmpa_error_io', 'snmpa_error_logger', 'snmpa_error_report',
  202. 'snmpa_local_db', 'snmpa_mpd', 'snmpa_network_interface',
  203. 'snmpa_network_interface_filter',
  204. 'snmpa_notification_delivery_info_receiver',
  205. 'snmpa_notification_filter', 'snmpa_supervisor', 'snmpc', 'snmpm',
  206. 'snmpm_conf', 'snmpm_mpd', 'snmpm_network_interface', 'snmpm_user',
  207. 'sofs', 'ssh', 'ssh_channel', 'ssh_connection', 'ssh_sftp',
  208. 'ssh_sftpd', 'ssl', 'ssl_app', 'ssl_pkix', 'start', 'start_erl',
  209. 'start_webtool', 'stdlib_app', 'string', 'supervisor',
  210. 'supervisor_bridge', 'sys', 'systools', 'tags', 'test_server',
  211. 'test_server_app', 'test_server_ctrl', 'tftp', 'timer', 'toolbar',
  212. 'ttb', 'tv', 'unicode', 'unix_telnet', 'user', 'webtool', 'werl',
  213. 'win32reg', 'wrap_log_reader', 'wx', 'wx_misc', 'wx_object',
  214. 'wxAcceleratorEntry', 'wxAcceleratorTable', 'wxArtProvider',
  215. 'wxAuiDockArt', 'wxAuiManager', 'wxAuiNotebook', 'wxAuiPaneInfo',
  216. 'wxAuiTabArt', 'wxBitmap', 'wxBitmapButton', 'wxBitmapDataObject',
  217. 'wxBoxSizer', 'wxBrush', 'wxBufferedDC', 'wxBufferedPaintDC',
  218. 'wxButton', 'wxCalendarCtrl', 'wxCalendarDateAttr',
  219. 'wxCalendarEvent', 'wxCaret', 'wxCheckBox', 'wxCheckListBox',
  220. 'wxChildFocusEvent', 'wxChoice', 'wxClientDC', 'wxClipboard',
  221. 'wxCloseEvent', 'wxColourData', 'wxColourDialog',
  222. 'wxColourPickerCtrl', 'wxColourPickerEvent', 'wxComboBox',
  223. 'wxCommandEvent', 'wxContextMenuEvent', 'wxControl',
  224. 'wxControlWithItems', 'wxCursor', 'wxDataObject', 'wxDateEvent',
  225. 'wxDatePickerCtrl', 'wxDC', 'wxDialog', 'wxDirDialog',
  226. 'wxDirPickerCtrl', 'wxDisplayChangedEvent', 'wxEraseEvent',
  227. 'wxEvent', 'wxEvtHandler', 'wxFileDataObject', 'wxFileDialog',
  228. 'wxFileDirPickerEvent', 'wxFilePickerCtrl', 'wxFindReplaceData',
  229. 'wxFindReplaceDialog', 'wxFlexGridSizer', 'wxFocusEvent', 'wxFont',
  230. 'wxFontData', 'wxFontDialog', 'wxFontPickerCtrl',
  231. 'wxFontPickerEvent', 'wxFrame', 'wxGauge', 'wxGBSizerItem',
  232. 'wxGenericDirCtrl', 'wxGLCanvas', 'wxGraphicsBrush',
  233. 'wxGraphicsContext', 'wxGraphicsFont', 'wxGraphicsMatrix',
  234. 'wxGraphicsObject', 'wxGraphicsPath', 'wxGraphicsPen',
  235. 'wxGraphicsRenderer', 'wxGrid', 'wxGridBagSizer', 'wxGridCellAttr',
  236. 'wxGridCellEditor', 'wxGridCellRenderer', 'wxGridEvent',
  237. 'wxGridSizer', 'wxHelpEvent', 'wxHtmlEasyPrinting', 'wxIcon',
  238. 'wxIconBundle', 'wxIconizeEvent', 'wxIdleEvent', 'wxImage',
  239. 'wxImageList', 'wxJoystickEvent', 'wxKeyEvent',
  240. 'wxLayoutAlgorithm', 'wxListBox', 'wxListCtrl', 'wxListEvent',
  241. 'wxListItem', 'wxListView', 'wxMask', 'wxMaximizeEvent',
  242. 'wxMDIChildFrame', 'wxMDIClientWindow', 'wxMDIParentFrame',
  243. 'wxMemoryDC', 'wxMenu', 'wxMenuBar', 'wxMenuEvent', 'wxMenuItem',
  244. 'wxMessageDialog', 'wxMiniFrame', 'wxMirrorDC',
  245. 'wxMouseCaptureChangedEvent', 'wxMouseEvent', 'wxMoveEvent',
  246. 'wxMultiChoiceDialog', 'wxNavigationKeyEvent', 'wxNcPaintEvent',
  247. 'wxNotebook', 'wxNotebookEvent', 'wxNotifyEvent',
  248. 'wxPageSetupDialog', 'wxPageSetupDialogData', 'wxPaintDC',
  249. 'wxPaintEvent', 'wxPalette', 'wxPaletteChangedEvent', 'wxPanel',
  250. 'wxPasswordEntryDialog', 'wxPen', 'wxPickerBase', 'wxPostScriptDC',
  251. 'wxPreviewCanvas', 'wxPreviewControlBar', 'wxPreviewFrame',
  252. 'wxPrintData', 'wxPrintDialog', 'wxPrintDialogData', 'wxPrinter',
  253. 'wxPrintout', 'wxPrintPreview', 'wxProgressDialog',
  254. 'wxQueryNewPaletteEvent', 'wxRadioBox', 'wxRadioButton',
  255. 'wxRegion', 'wxSashEvent', 'wxSashLayoutWindow', 'wxSashWindow',
  256. 'wxScreenDC', 'wxScrollBar', 'wxScrolledWindow', 'wxScrollEvent',
  257. 'wxScrollWinEvent', 'wxSetCursorEvent', 'wxShowEvent',
  258. 'wxSingleChoiceDialog', 'wxSizeEvent', 'wxSizer', 'wxSizerFlags',
  259. 'wxSizerItem', 'wxSlider', 'wxSpinButton', 'wxSpinCtrl',
  260. 'wxSpinEvent', 'wxSplashScreen', 'wxSplitterEvent',
  261. 'wxSplitterWindow', 'wxStaticBitmap', 'wxStaticBox',
  262. 'wxStaticBoxSizer', 'wxStaticLine', 'wxStaticText', 'wxStatusBar',
  263. 'wxStdDialogButtonSizer', 'wxStyledTextCtrl', 'wxStyledTextEvent',
  264. 'wxSysColourChangedEvent', 'wxTextAttr', 'wxTextCtrl',
  265. 'wxTextDataObject', 'wxTextEntryDialog', 'wxToggleButton',
  266. 'wxToolBar', 'wxToolTip', 'wxTopLevelWindow', 'wxTreeCtrl',
  267. 'wxTreeEvent', 'wxUpdateUIEvent', 'wxWindow', 'wxWindowCreateEvent',
  268. 'wxWindowDC', 'wxWindowDestroyEvent', 'wxXmlResource', 'xmerl',
  269. 'xmerl_eventp', 'xmerl_scan', 'xmerl_xpath', 'xmerl_xs',
  270. 'xmerl_xsd', 'xref', 'yecc', 'zip', 'zlib', 'zlib_stub'
  271. ),
  272. // Binary modifiers
  273. 6 => array(
  274. 'big', 'binary', 'float', 'integer', 'little', 'signed', 'unit', 'unsigned'
  275. )
  276. ),
  277. 'SYMBOLS' => array(
  278. 0 => array('(', ')', '[', ']', '{', '}'),
  279. 1 => array('->', ',', ';', '.'),
  280. 2 => array('<<', '>>'),
  281. 3 => array('=', '||', '-', '+', '*', '/', '++', '--', '!', '<', '>', '>=',
  282. '=<', '==', '/=', '=:=', '=/=')
  283. ),
  284. 'CASE_SENSITIVE' => array(
  285. GESHI_COMMENTS => false,
  286. 1 => true,
  287. 2 => true,
  288. 3 => true,
  289. 4 => true,
  290. 5 => true,
  291. 6 => true
  292. ),
  293. 'STYLES' => array(
  294. 'KEYWORDS' => array(
  295. 1 => 'color: #186895;',
  296. 2 => 'color: #014ea4;',
  297. 3 => 'color: #fa6fff;',
  298. 4 => 'color: #fa6fff;',
  299. 5 => 'color: #ff4e18;',
  300. 6 => 'color: #9d4f37;'
  301. ),
  302. 'COMMENTS' => array(
  303. 1 => 'color: #666666; font-style: italic;',
  304. 'MULTI' => 'color: #666666; font-style: italic;'
  305. ),
  306. 'ESCAPE_CHAR' => array(
  307. 0 => 'color: #000099; font-weight: bold;',
  308. 'HARD' => 'color: #000099; font-weight: bold;'
  309. ),
  310. 'BRACKETS' => array(
  311. 0 => 'color: #109ab8;'
  312. ),
  313. 'STRINGS' => array(
  314. 0 => 'color: #ff7800;'
  315. ),
  316. 'NUMBERS' => array(
  317. 0 => 'color: #ff9600;'
  318. ),
  319. 'METHODS' => array(
  320. 1 => 'color: #006600;',
  321. 2 => 'color: #006600;'
  322. ),
  323. 'SYMBOLS' => array(
  324. 0 => 'color: #004866;',
  325. 1 => 'color: #6bb810;',
  326. 2 => 'color: #ee3800;',
  327. 3 => 'color: #014ea4;'
  328. ),
  329. 'REGEXPS' => array(
  330. 0 => 'color: #6941fd;',
  331. 1 => 'color: #d400ed;',
  332. 2 => 'color: #5400b3;',
  333. 3 => 'color: #ff3c00;',
  334. 4 => 'color: #6941fd;',
  335. 5 => 'color: #45b3e6;',
  336. 6 => 'color: #ff9600;',
  337. 7 => 'color: #d400ed;',
  338. 8 => 'color: #ff9600;'
  339. ),
  340. 'SCRIPT' => array(
  341. )
  342. ),
  343. 'URLS' => array(
  344. 1 => '',
  345. 2 => '',
  346. 3 => '',
  347. 4 => '',
  348. 5 => 'http://erlang.org/doc/man/{FNAME}.html',
  349. 6 => ''
  350. ),
  351. 'OOLANG' => true,
  352. 'OBJECT_SPLITTERS' => array(
  353. 1 => '-&gt;',
  354. 2 => ':'
  355. ),
  356. 'REGEXPS' => array(
  357. //�Macro definitions
  358. 0 => array(
  359. GESHI_SEARCH => '(-define\s*\()([a-zA-Z0-9_]+)(\(|,)',
  360. GESHI_REPLACE => '\2',
  361. GESHI_MODIFIERS => '',
  362. GESHI_BEFORE => '\1',
  363. GESHI_AFTER => '\3'
  364. ),
  365. // Record definitions
  366. 1 => array(
  367. GESHI_SEARCH => '(-record\s*\()([a-zA-Z0-9_]+)(,)',
  368. GESHI_REPLACE => '\2',
  369. GESHI_MODIFIERS => '',
  370. GESHI_BEFORE => '\1',
  371. GESHI_AFTER => '\3'
  372. ),
  373. // Precompiler directives
  374. 2 => array(
  375. GESHI_SEARCH => '(-)([a-z][a-zA-Z0-9_]*)(\()',
  376. GESHI_REPLACE => '\2',
  377. GESHI_MODIFIERS => '',
  378. GESHI_BEFORE => '\1',
  379. GESHI_AFTER => '\3'
  380. ),
  381. // Functions
  382. 3 => array(
  383. GESHI_SEARCH => '([a-z]\w*|\'\w*\')(\s*\()',
  384. GESHI_REPLACE => '\1',
  385. GESHI_MODIFIERS => '',
  386. GESHI_BEFORE => '',
  387. GESHI_AFTER => '\2'
  388. ),
  389. // Macros
  390. 4 => array(
  391. GESHI_SEARCH => '(\?)([a-zA-Z0-9_]+)',
  392. GESHI_REPLACE => '\2',
  393. GESHI_MODIFIERS => '',
  394. GESHI_BEFORE => '\1',
  395. GESHI_AFTER => ''
  396. ),
  397. // Variables - With hack to avoid interfering wish GeSHi internals
  398. 5 => array(
  399. GESHI_SEARCH => '([([{,<+*-\/=\s!]|&lt;)(?!(?:PIPE|SEMI|DOT|NUM|REG3XP\d*)\W)([A-Z_]\w*)(?!\w)',
  400. GESHI_REPLACE => '\2',
  401. GESHI_MODIFIERS => '',
  402. GESHI_BEFORE => '\1',
  403. GESHI_AFTER => ''
  404. ),
  405. // ASCII�codes
  406. 6 => '(\$[a-zA-Z0-9_])',
  407. // Records
  408. 7 => array(
  409. GESHI_SEARCH => '(#)([a-z][a-zA-Z0-9_]*)(\.|\{)',
  410. GESHI_REPLACE => '\2',
  411. GESHI_MODIFIERS => '',
  412. GESHI_BEFORE => '\1',
  413. GESHI_AFTER => '\3'
  414. ),
  415. // Numbers with a different radix
  416. 8 => '(?<=>)(#[a-zA-Z0-9]*)'
  417. ),
  418. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  419. 'SCRIPT_DELIMITERS' => array(),
  420. 'HIGHLIGHT_STRICT_BLOCK' => array(),
  421. 'TAB_WIDTH' => 4,
  422. 'PARSER_CONTROL' => array(
  423. 'KEYWORDS' => array(
  424. 3 => array(
  425. 'DISALLOWED_BEFORE' => '(?<![\w])',
  426. 'DISALLOWED_AFTER' => ''//'(?=\s*\()'
  427. ),
  428. 5 => array(
  429. 'DISALLOWED_BEFORE' => '(?<=\'|)',
  430. 'DISALLOWED_AFTER' => '(?=(\'|):)'
  431. ),
  432. 6 => array(
  433. 'DISALLOWED_BEFORE' => '(?<=\/|-)',
  434. 'DISALLOWED_AFTER' => ''
  435. )
  436. )
  437. ),
  438. );
  439. ?>