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.

345 lines
12KB

  1. <?php
  2. /*************************************************************************************
  3. * logtalk.php
  4. * -----------
  5. *
  6. * Author: Paulo Moura (pmoura@logtalk.org)
  7. * Copyright: (c) 2009-2011 Paulo Moura (http://logtalk.org/)
  8. * Release Version: 1.0.8.11
  9. * Date Started: 2009/10/24
  10. *
  11. * Logtalk language file for GeSHi.
  12. *
  13. * CHANGES
  14. * -------
  15. * 2011/01/18 (1.1.4)
  16. * - Added syntax coloring of ignore/1
  17. * 2010/11/28 (1.1.3)
  18. * - Added syntax coloring of conforms_to_protocol/2-3
  19. * 2010/09/14 (1.1.2)
  20. * - Added syntax coloring of coinductive/1
  21. * 2010/06/23 (1.1.1)
  22. * - Added syntax coloring of e/0 and pi/0
  23. * - Added syntax coloring of ground/1, numbervars/3, keysort/2, and sort/2
  24. * 2010/05/15 (1.1.0)
  25. * - Added syntax coloring of callable/1 and compare/3
  26. * 2009/10/28 (1.0.0)
  27. * - First Release
  28. *
  29. *************************************************************************************
  30. *
  31. * This file is part of GeSHi.
  32. *
  33. * GeSHi is free software; you can redistribute it and/or modify
  34. * it under the terms of the GNU General Public License as published by
  35. * the Free Software Foundation; either version 2 of the License, or
  36. * (at your option) any later version.
  37. *
  38. * GeSHi is distributed in the hope that it will be useful,
  39. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  40. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  41. * GNU General Public License for more details.
  42. *
  43. * You should have received a copy of the GNU General Public License
  44. * along with GeSHi; if not, write to the Free Software
  45. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  46. *
  47. ************************************************************************************/
  48. $language_data = array(
  49. 'LANG_NAME' => 'Logtalk',
  50. 'COMMENT_SINGLE' => array(1 => '%'),
  51. 'COMMENT_MULTI' => array('/*' => '*/'),
  52. 'COMMENT_REGEXP' => array(2 => "/0'./sim"),
  53. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  54. 'QUOTEMARKS' => array("'"),
  55. 'HARDQUOTE' => array('"', '"'),
  56. 'HARDESCAPE' => array(),
  57. 'ESCAPE_CHAR' => '',
  58. 'ESCAPE_REGEXP' => array(
  59. //Simple Single Char Escapes
  60. 1 => "#\\\\[\\\\abfnrtv\'\"?\n]#i",
  61. //Hexadecimal Char Specs
  62. 2 => "#\\\\x[\da-fA-F]+\\\\#",
  63. //Octal Char Specs
  64. 3 => "#\\\\[0-7]+\\\\#"
  65. ),
  66. 'NUMBERS' =>
  67. GESHI_NUMBER_INT_BASIC |
  68. GESHI_NUMBER_BIN_PREFIX_0B |
  69. GESHI_NUMBER_OCT_PREFIX_0O |
  70. GESHI_NUMBER_HEX_PREFIX |
  71. GESHI_NUMBER_FLT_NONSCI |
  72. GESHI_NUMBER_FLT_SCI_ZERO,
  73. 'KEYWORDS' => array(
  74. // Directives (with arguments)
  75. 1 => array(
  76. // file directives
  77. 'encoding', 'ensure_loaded',
  78. // flag directives
  79. 'set_logtalk_flag', 'set_prolog_flag',
  80. // entity opening directives
  81. 'category', 'object', 'protocol',
  82. // predicate scope directives
  83. 'private', 'protected', 'public',
  84. // conditional compilation directives
  85. 'elif', 'if',
  86. // entity directives
  87. 'calls', 'initialization', 'op', 'uses',
  88. // predicate directives
  89. 'alias', 'coinductive', 'discontiguous', 'dynamic', 'mode', 'info', 'meta_predicate', 'multifile', 'synchronized',
  90. // module directives
  91. 'export', 'module', 'reexport', 'use_module'
  92. ),
  93. // Directives (no arguments)
  94. 2 => array(
  95. // entity directives
  96. 'dynamic',
  97. // multi-threading directives
  98. 'synchronized', 'threaded',
  99. // entity closing directives
  100. 'end_category', 'end_object', 'end_protocol',
  101. // conditional compilation directives
  102. 'else', 'endif'
  103. ),
  104. // Entity relations
  105. 3 => array(
  106. 'complements', 'extends', 'imports', 'implements','instantiates', 'specializes'
  107. ),
  108. // Built-in predicates (with arguments)
  109. 4 => array(
  110. // event handlers
  111. 'after', 'before',
  112. // execution-context methods
  113. 'parameter', 'self', 'sender', 'this',
  114. // predicate reflection
  115. 'current_predicate', 'predicate_property',
  116. // DCGs and term expansion
  117. 'expand_goal', 'expand_term', 'goal_expansion', 'phrase', 'term_expansion',
  118. // entity
  119. 'abolish_category', 'abolish_object', 'abolish_protocol',
  120. 'create_category', 'create_object', 'create_protocol',
  121. 'current_category', 'current_object', 'current_protocol',
  122. 'category_property', 'object_property', 'protocol_property',
  123. // entity relations
  124. 'complements_object', 'conforms_to_protocol',
  125. 'extends_category', 'extends_object', 'extends_protocol',
  126. 'implements_protocol', 'imports_category',
  127. 'instantiates_class', 'specializes_class',
  128. // events
  129. 'abolish_events', 'current_event', 'define_events',
  130. // flags
  131. 'current_logtalk_flag', 'set_logtalk_flag',
  132. 'current_prolog_flag', 'set_prolog_flag',
  133. // compiling, loading, and library path
  134. 'logtalk_compile', 'logtalk_library_path', 'logtalk_load',
  135. // database
  136. 'abolish', 'asserta', 'assertz', 'clause', 'retract', 'retractall',
  137. // control
  138. 'call', 'catch', 'ignore', 'once', 'throw',
  139. // all solutions predicates
  140. 'bagof', 'findall', 'forall', 'setof',
  141. // multi-threading meta-predicates
  142. 'threaded',
  143. 'threaded_call', 'threaded_once', 'threaded_ignore', 'threaded_exit', 'threaded_peek',
  144. 'threaded_wait', 'threaded_notify',
  145. // term unification
  146. 'unify_with_occurs_check',
  147. // atomic term processing
  148. 'atom_chars', 'atom_codes', 'atom_concat', 'atom_length',
  149. 'number_chars', 'number_codes',
  150. 'char_code',
  151. // term creation and decomposition
  152. 'arg', 'copy_term', 'functor', 'numbervars',
  153. // term testing
  154. 'atom', 'atomic', 'callable', 'compound', 'float', 'ground', 'integer', 'nonvar', 'number', 'sub_atom', 'var',
  155. // term comparison
  156. 'compare',
  157. // stream selection and control
  158. 'current_input', 'current_output', 'set_input', 'set_output',
  159. 'open', 'close', 'flush_output', 'stream_property',
  160. 'at_end_of_stream', 'set_stream_position',
  161. // character and byte input/output predicates
  162. 'get_byte', 'get_char', 'get_code',
  163. 'peek_byte', 'peek_char', 'peek_code',
  164. 'put_byte', 'put_char', 'put_code',
  165. 'nl',
  166. // term input/output predicates
  167. 'current_op', 'op',
  168. 'write', 'writeq', 'write_canonical', 'write_term',
  169. 'read', 'read_term',
  170. 'char_conversion', 'current_char_conversion',
  171. // hooks
  172. 'halt',
  173. // sorting
  174. 'keysort', 'sort'
  175. ),
  176. // Built-in predicates (no arguments)
  177. 5 => array(
  178. // control
  179. 'fail', 'repeat', 'true',
  180. // character and byte input/output predicates
  181. 'nl',
  182. // implementation defined hooks functions
  183. 'halt',
  184. // arithemtic evaluation
  185. 'is',
  186. // stream selection and control
  187. 'at_end_of_stream', 'flush_output'
  188. ),
  189. // Evaluable functors (with arguments)
  190. 6 => array(
  191. 'float_integer_part', 'float_fractional_part',
  192. 'rem', 'mod', 'abs', 'sign', 'floor', 'truncate', 'round', 'ceiling',
  193. 'cos', 'atan', 'exp', 'log', 'sin', 'sqrt'
  194. ),
  195. // Evaluable functors (no arguments)
  196. 7 => array(
  197. 'e', 'pi', 'mod', 'rem'
  198. ),
  199. ),
  200. 'SYMBOLS' => array(
  201. 0 => array(
  202. // external call
  203. '{', '}'
  204. ),
  205. 1 => array(
  206. // arithemtic comparison
  207. '=:=', '=\=', '<', '=<', '>=', '>',
  208. // term comparison
  209. '<<', '>>', '/\\', '\\/', '\\',
  210. // bitwise functors
  211. '==', '\==', '@<', '@=<', '@>=', '@>',
  212. // evaluable functors
  213. '+', '-', '*', '/', '**',
  214. // logic and control
  215. '!', '\\+', ';',
  216. // message sending operators
  217. '::', '^^', ':',
  218. // grammar rule and conditional functors
  219. '-->', '->',
  220. // mode operators
  221. '@', '?',
  222. // term to list predicate
  223. '=..',
  224. // unification
  225. '=', '\\='
  226. ),
  227. 2 => array(
  228. // clause and directive functors
  229. ':-'
  230. )
  231. ),
  232. 'CASE_SENSITIVE' => array(
  233. GESHI_COMMENTS => false,
  234. 1 => true,
  235. 2 => true,
  236. 3 => true,
  237. 4 => true,
  238. 5 => true,
  239. 6 => true,
  240. 7 => true
  241. ),
  242. 'STYLES' => array(
  243. 'KEYWORDS' => array(
  244. 1 => 'color: #2e4dc9;',
  245. 2 => 'color: #2e4dc9;',
  246. 3 => 'color: #2e4dc9;',
  247. 4 => 'color: #9d4f37;',
  248. 5 => 'color: #9d4f37;',
  249. 6 => 'color: #9d4f37;',
  250. 7 => 'color: #9d4f37;'
  251. ),
  252. 'NUMBERS' => array(
  253. 0 => 'color: #430000;'
  254. ),
  255. 'COMMENTS' => array(
  256. 1 => 'color: #60a0b0; font-style: italic;',
  257. 2 => 'color: #430000;',
  258. 'MULTI' => 'color: #60a0b0; font-style: italic;'
  259. ),
  260. 'ESCAPE_CHAR' => array(
  261. 0 => 'color: #9f0000; font-weight: bold;',
  262. 1 => 'color: #9f0000; font-weight: bold;',
  263. 2 => 'color: #9f0000; font-weight: bold;',
  264. 3 => 'color: #9f0000; font-weight: bold;',
  265. 'HARD' => '',
  266. ),
  267. 'SYMBOLS' => array(
  268. 0 => 'color: #666666;font-weight: bold;',
  269. 1 => 'color: #666666;font-weight: bold;',
  270. 2 => 'color: #000000;'
  271. ),
  272. 'BRACKETS' => array(
  273. 0 => 'color: #000000;'
  274. ),
  275. 'STRINGS' => array(
  276. 0 => 'color: #9f0000;',
  277. 'HARD' => 'color: #9f0000;'
  278. ),
  279. 'METHODS' => array(
  280. ),
  281. 'REGEXPS' => array(
  282. 0 => 'color: #848484;'
  283. ),
  284. 'SCRIPT' => array()
  285. ),
  286. 'URLS' => array(
  287. 1 => '',
  288. 2 => '',
  289. 3 => '',
  290. 4 => '',
  291. 5 => '',
  292. 6 => '',
  293. 7 => ''
  294. ),
  295. 'OOLANG' => false,
  296. 'OBJECT_SPLITTERS' => array(
  297. 1 => '::'
  298. ),
  299. 'REGEXPS' => array(
  300. // variables
  301. 0 => '\b(?!(?:PIPE|SEMI|REG3XP\d*)[^a-zA-Z0-9_])[A-Z_][a-zA-Z0-9_]*(?![a-zA-Z0-9_])'
  302. ),
  303. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  304. 'SCRIPT_DELIMITERS' => array(),
  305. 'HIGHLIGHT_STRICT_BLOCK' => array(),
  306. 'TAB_WIDTH' => 4,
  307. 'PARSER_CONTROL' => array(
  308. 'ENABLE_FLAGS' => array(
  309. 'BRACKETS' => GESHI_NEVER
  310. ),
  311. 'KEYWORDS' => array(
  312. 1 => array(
  313. 'DISALLOWED_BEFORE' => '(?<=:-\s)',
  314. 'DISALLOWED_AFTER' => '(?=\()'
  315. ),
  316. 2 => array(
  317. 'DISALLOWED_BEFORE' => '(?<=:-\s)',
  318. 'DISALLOWED_AFTER' => '(?=\.)'
  319. ),
  320. 3 => array(
  321. 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#>|^&\'"])',
  322. 'DISALLOWED_AFTER' => '(?=\()'
  323. ),
  324. 4 => array(
  325. 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#>|^&\'"])',
  326. 'DISALLOWED_AFTER' => '(?=\()'
  327. ),
  328. 5 => array(
  329. 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#>|^&\'"])',
  330. 'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-&\'"])'
  331. ),
  332. 6 => array(
  333. 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#;>|^&\'"])',
  334. 'DISALLOWED_AFTER' => '(?=\()'
  335. ),
  336. 7 => array(
  337. 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#;>|^&\'"])',
  338. 'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-&\'"])'
  339. )
  340. )
  341. ),
  342. );
  343. ?>