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.

252 lines
11KB

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