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.

272 lines
12KB

  1. <?php
  2. /*************************************************************************************
  3. * d.php
  4. * -----
  5. * Author: Thomas Kuehne (thomas@kuehne.cn)
  6. * Copyright: (c) 2005 Thomas Kuehne (http://thomas.kuehne.cn/)
  7. * Release Version: 1.0.8.10
  8. * Date Started: 2005/04/22
  9. *
  10. * D language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2005/04/22 (0.0.2)
  15. * - added _d_* and sizeof/ptrdiff_t
  16. * 2005/04/20 (0.0.1)
  17. * - First release
  18. *
  19. * TODO (updated 2005/04/22)
  20. * -------------------------
  21. * * nested comments
  22. * * correct handling of r"" and ``
  23. * * correct handling of ... and ..
  24. *
  25. *************************************************************************************
  26. *
  27. * This file is part of GeSHi.
  28. *
  29. * GeSHi is free software; you can redistribute it and/or modify
  30. * it under the terms of the GNU General Public License as published by
  31. * the Free Software Foundation; either version 2 of the License, or
  32. * (at your option) any later version.
  33. *
  34. * GeSHi is distributed in the hope that it will be useful,
  35. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  36. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  37. * GNU General Public License for more details.
  38. *
  39. * You should have received a copy of the GNU General Public License
  40. * along with GeSHi; if not, write to the Free Software
  41. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  42. *
  43. ************************************************************************************/
  44. $language_data = array (
  45. 'LANG_NAME' => 'D',
  46. 'COMMENT_SINGLE' => array(2 => '///', 1 => '//'),
  47. 'COMMENT_MULTI' => array('/*' => '*/'),
  48. 'COMMENT_REGEXP' => array(
  49. // doxygen comments
  50. 3 => '#/\*\*(?![\*\/]).*\*/#sU',
  51. // raw strings
  52. 4 => '#r"[^"]*"#s',
  53. // Script Style interpreter comment
  54. 5 => "/\A#!(?=\\/).*?$/m"
  55. ),
  56. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  57. 'QUOTEMARKS' => array('"', "'"),
  58. 'ESCAPE_CHAR' => '',
  59. 'ESCAPE_REGEXP' => array(
  60. //Simple Single Char Escapes
  61. 1 => "#\\\\[abfnrtv\\'\"?\n\\\\]#i",
  62. //Hexadecimal Char Specs
  63. 2 => "#\\\\x[\da-fA-F]{2}#",
  64. //Hexadecimal Char Specs
  65. 3 => "#\\\\u[\da-fA-F]{4}#",
  66. //Hexadecimal Char Specs
  67. 4 => "#\\\\U[\da-fA-F]{8}#",
  68. //Octal Char Specs
  69. 5 => "#\\\\[0-7]{1,3}#",
  70. //Named entity escapes
  71. /*6 => "#\\\\&(?:quot|amp|lt|gt|OElig|oelig|Scaron|scaron|Yuml|circ|tilde|".
  72. "ensp|emsp|thinsp|zwnj|zwj|lrm|rlm|ndash|mdash|lsquo|rsquo|sbquo|".
  73. "ldquo|rdquo|bdquo|dagger|Dagger|permil|lsaquo|rsaquo|euro|nbsp|".
  74. "iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|".
  75. "shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|".
  76. "sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|".
  77. "Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|".
  78. "Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|".
  79. "times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|".
  80. "aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|".
  81. "euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|".
  82. "otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|".
  83. "yuml|fnof|Alpha|Beta|Gamma|Delta|Epsilon|Zeta|Eta|Theta|Iota|".
  84. "Kappa|Lambda|Mu|Nu|Xi|Omicron|Pi|Rho|Sigma|Tau|Upsilon|Phi|Chi|".
  85. "Psi|Omega|alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|".
  86. "kappa|lambda|mu|nu|xi|omicron|pi|rho|sigmaf|sigma|tau|upsilon|".
  87. "phi|chi|psi|omega|thetasym|upsih|piv|bull|hellip|prime|Prime|".
  88. "oline|frasl|weierp|image|real|trade|alefsym|larr|uarr|rarr|darr|".
  89. "harr|crarr|lArr|uArr|rArr|dArr|hArr|forall|part|exist|empty|".
  90. "nabla|isin|notin|ni|prod|sum|minus|lowast|radic|prop|infin|ang|".
  91. "and|or|cap|cup|int|there4|sim|cong|asymp|ne|equiv|le|ge|sub|sup|".
  92. "nsub|sube|supe|oplus|otimes|perp|sdot|lceil|rceil|lfloor|rfloor|".
  93. "lang|rang|loz|spades|clubs|hearts|diams);#",*/
  94. // optimized:
  95. 6 => "#\\\\&(?:A(?:Elig|acute|circ|grave|lpha|ring|tilde|uml)|Beta|".
  96. "C(?:cedil|hi)|D(?:agger|elta)|E(?:TH|acute|circ|grave|psilon|ta|uml)|".
  97. "Gamma|I(?:acute|circ|grave|ota|uml)|Kappa|Lambda|Mu|N(?:tilde|u)|".
  98. "O(?:Elig|acute|circ|grave|m(?:ega|icron)|slash|tilde|uml)|".
  99. "P(?:hi|i|rime|si)|Rho|S(?:caron|igma)|T(?:HORN|au|heta)|".
  100. "U(?:acute|circ|grave|psilon|uml)|Xi|Y(?:acute|uml)|Zeta|".
  101. "a(?:acute|c(?:irc|ute)|elig|grave|l(?:efsym|pha)|mp|n[dg]|ring|".
  102. "symp|tilde|uml)|b(?:dquo|eta|rvbar|ull)|c(?:ap|cedil|e(?:dil|nt)|".
  103. "hi|irc|lubs|o(?:ng|py)|rarr|u(?:p|rren))|d(?:Arr|a(?:gger|rr)|".
  104. "e(?:g|lta)|i(?:ams|vide))|e(?:acute|circ|grave|m(?:pty|sp)|nsp|".
  105. "psilon|quiv|t[ah]|u(?:ml|ro)|xist)|f(?:nof|orall|ra(?:c(?:1[24]|34)|sl))|".
  106. "g(?:amma|e|t)|h(?:Arr|arr|e(?:arts|llip))|i(?:acute|circ|excl|grave|mage|".
  107. "n(?:fin|t)|ota|quest|sin|uml)|kappa|l(?:Arr|a(?:mbda|ng|quo|rr)|ceil|".
  108. "dquo|e|floor|o(?:wast|z)|rm|s(?:aquo|quo)|t)|m(?:acr|dash|".
  109. "i(?:cro|ddot|nus)|u)|n(?:abla|bsp|dash|e|i|ot(?:in)?|sub|tilde|u)|".
  110. "o(?:acute|circ|elig|grave|line|m(?:ega|icron)|plus|r(?:d[fm])?|".
  111. "slash|ti(?:lde|mes)|uml)|p(?:ar[at]|er(?:mil|p)|hi|iv?|lusmn|ound|".
  112. "r(?:ime|o[dp])|si)|quot|r(?:Arr|a(?:dic|ng|quo|rr)|ceil|dquo|e(?:al|g)|".
  113. "floor|ho|lm|s(?:aquo|quo))|s(?:bquo|caron|dot|ect|hy|i(?:gmaf?|m)|".
  114. "pades|u(?:be?|m|p[123e]?)|zlig)|t(?:au|h(?:e(?:re4|ta(?:sym)?)|insp|".
  115. "orn)|i(?:lde|mes)|rade)|u(?:Arr|a(?:cute|rr)|circ|grave|ml|".
  116. "psi(?:h|lon)|uml)|weierp|xi|y(?:acute|en|uml)|z(?:eta|w(?:j|nj)));#",
  117. ),
  118. 'HARDQUOTE' => array('`', '`'),
  119. 'HARDESCAPE' => array(),
  120. 'NUMBERS' =>
  121. GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_INT_CSTYLE | GESHI_NUMBER_BIN_PREFIX_0B |
  122. GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_NONSCI |
  123. GESHI_NUMBER_FLT_NONSCI_F | GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO,
  124. 'KEYWORDS' => array(
  125. 1 => array(
  126. 'break', 'case', 'continue', 'do', 'else',
  127. 'for', 'foreach', 'goto', 'if', 'return',
  128. 'switch', 'while'
  129. ),
  130. 2 => array(
  131. 'alias', 'asm', 'assert', 'body', 'cast',
  132. 'catch', 'default', 'delegate', 'delete',
  133. 'extern', 'false', 'finally', 'function',
  134. 'import', 'in', 'inout', 'interface',
  135. 'invariant', 'is', 'mixin', 'module', 'new',
  136. 'null', 'out', 'pragma', 'ref', 'super', 'this',
  137. 'throw', 'true', 'try', 'typedef', 'typeid',
  138. 'typeof', 'union', 'with'
  139. ),
  140. 3 => array(
  141. 'ArrayBoundsError', 'AssertError',
  142. 'ClassInfo', 'Error', 'Exception',
  143. 'Interface', 'ModuleInfo', 'Object',
  144. 'OutOfMemoryException', 'SwitchError',
  145. 'TypeInfo', '_d_arrayappend',
  146. '_d_arrayappendb', '_d_arrayappendc',
  147. '_d_arrayappendcb', '_d_arraycast',
  148. '_d_arraycast_frombit', '_d_arraycat',
  149. '_d_arraycatb', '_d_arraycatn',
  150. '_d_arraycopy', '_d_arraycopybit',
  151. '_d_arraysetbit', '_d_arraysetbit2',
  152. '_d_arraysetlength', '_d_arraysetlengthb',
  153. '_d_callfinalizer',
  154. '_d_create_exception_object',
  155. '_d_criticalenter', '_d_criticalexit',
  156. '_d_delarray', '_d_delclass',
  157. '_d_delinterface', '_d_delmemory',
  158. '_d_dynamic_cast', '_d_exception',
  159. '_d_exception_filter', '_d_framehandler',
  160. '_d_interface_cast', '_d_interface_vtbl',
  161. '_d_invariant', '_d_isbaseof',
  162. '_d_isbaseof2', '_d_local_unwind',
  163. '_d_monitorenter', '_d_monitorexit',
  164. '_d_monitorrelease', '_d_monitor_epilog',
  165. '_d_monitor_handler', '_d_monitor_prolog',
  166. '_d_new', '_d_newarrayi', '_d_newbitarray',
  167. '_d_newclass', '_d_obj_cmp', '_d_obj_eq',
  168. '_d_OutOfMemory', '_d_switch_dstring',
  169. '_d_switch_string', '_d_switch_ustring',
  170. '_d_throw',
  171. ),
  172. 4 => array(
  173. 'abstract', 'align', 'auto', 'bit', 'bool',
  174. 'byte', 'cdouble', 'cent', 'cfloat', 'char',
  175. 'class', 'const', 'creal', 'dchar', 'debug',
  176. 'deprecated', 'double', 'enum', 'export',
  177. 'final', 'float', 'idouble', 'ifloat', 'int',
  178. 'ireal', 'long', 'override', 'package',
  179. 'private', 'protected', 'ptrdiff_t',
  180. 'public', 'real', 'short', 'size_t',
  181. 'static', 'struct', 'synchronized',
  182. 'template', 'ubyte', 'ucent', 'uint',
  183. 'ulong', 'unittest', 'ushort', 'version',
  184. 'void', 'volatile', 'wchar'
  185. )
  186. ),
  187. 'SYMBOLS' => array(
  188. '(', ')', '[', ']', '{', '}', '?', '!', ';', ':', ',', '...', '..',
  189. '+', '-', '*', '/', '%', '&', '|', '^', '<', '>', '=', '~',
  190. ),
  191. 'CASE_SENSITIVE' => array(
  192. GESHI_COMMENTS => false,
  193. 1 => true,
  194. 2 => true,
  195. 3 => true,
  196. 4 => true
  197. ),
  198. 'STYLES' => array(
  199. 'KEYWORDS' => array(
  200. 1 => 'color: #b1b100;',
  201. 2 => 'color: #000000; font-weight: bold;',
  202. 3 => 'color: #aaaadd; font-weight: bold;',
  203. 4 => 'color: #993333;'
  204. ),
  205. 'COMMENTS' => array(
  206. 1 => 'color: #808080; font-style: italic;',
  207. 2 => 'color: #009933; font-style: italic;',
  208. 3 => 'color: #009933; font-style: italic;',
  209. 4 => 'color: #ff0000;',
  210. 5 => 'color: #0040ff;',
  211. 'MULTI' => 'color: #808080; font-style: italic;'
  212. ),
  213. 'ESCAPE_CHAR' => array(
  214. 0 => 'color: #000099; font-weight: bold;',
  215. 1 => 'color: #000099; font-weight: bold;',
  216. 2 => 'color: #660099; font-weight: bold;',
  217. 3 => 'color: #660099; font-weight: bold;',
  218. 4 => 'color: #660099; font-weight: bold;',
  219. 5 => 'color: #006699; font-weight: bold;',
  220. 6 => 'color: #666699; font-weight: bold; font-style: italic;',
  221. 'HARD' => '',
  222. ),
  223. 'BRACKETS' => array(
  224. 0 => 'color: #66cc66;'
  225. ),
  226. 'STRINGS' => array(
  227. 0 => 'color: #ff0000;',
  228. 'HARD' => 'color: #ff0000;'
  229. ),
  230. 'NUMBERS' => array(
  231. 0 => 'color: #0000dd;',
  232. GESHI_NUMBER_BIN_PREFIX_0B => 'color: #208080;',
  233. GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
  234. GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
  235. GESHI_NUMBER_FLT_SCI_SHORT => 'color:#800080;',
  236. GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
  237. GESHI_NUMBER_FLT_NONSCI_F => 'color:#800080;',
  238. GESHI_NUMBER_FLT_NONSCI => 'color:#800080;'
  239. ),
  240. 'METHODS' => array(
  241. 1 => 'color: #006600;',
  242. 2 => 'color: #006600;'
  243. ),
  244. 'SYMBOLS' => array(
  245. 0 => 'color: #66cc66;'
  246. ),
  247. 'SCRIPT' => array(
  248. ),
  249. 'REGEXPS' => array(
  250. )
  251. ),
  252. 'URLS' => array(
  253. 1 => '',
  254. 2 => '',
  255. 3 => '',
  256. 4 => ''
  257. ),
  258. 'OOLANG' => true,
  259. 'OBJECT_SPLITTERS' => array(
  260. 1 => '.',
  261. ),
  262. 'REGEXPS' => array(
  263. ),
  264. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  265. 'SCRIPT_DELIMITERS' => array(
  266. ),
  267. 'HIGHLIGHT_STRICT_BLOCK' => array(
  268. )
  269. );
  270. ?>