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.

256 lines
9.1KB

  1. <?php
  2. /*************************************************************************************
  3. * csharp.php
  4. * ----------
  5. * Author: Alan Juden (alan@judenware.org)
  6. * Revised by: Michael Mol (mikemol@gmail.com)
  7. * Copyright: (c) 2004 Alan Juden, Nigel McNie (http://qbnz.com/highlighter/)
  8. * Release Version: 1.0.8.11
  9. * Date Started: 2004/06/04
  10. *
  11. * C# language file for GeSHi.
  12. *
  13. * CHANGES
  14. * -------
  15. * 2012/06/18 (1.0.8.11)
  16. * - Added missing keywords (Christian Stelzmann)
  17. * 2009/04/03 (1.0.8.6)
  18. * - Added missing keywords identified by Rosetta Code users.
  19. * 2008/05/25 (1.0.7.22)
  20. * - Added highlighting of using and namespace directives as non-OOP
  21. * 2005/01/05 (1.0.1)
  22. * - Used hardquote support for @"..." strings (Cliff Stanford)
  23. * 2004/11/27 (1.0.0)
  24. * - Initial release
  25. *
  26. * TODO (updated 2004/11/27)
  27. * -------------------------
  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' => 'C#',
  50. 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
  51. 'COMMENT_MULTI' => array('/*' => '*/'),
  52. 'COMMENT_REGEXP' => array(
  53. //Using and Namespace directives (basic support)
  54. //Please note that the alias syntax for using is not supported
  55. 3 => '/(?:(?<=using[\\n\\s])|(?<=namespace[\\n\\s]))[\\n\\s]*([a-zA-Z0-9_]+\\.)*[a-zA-Z0-9_]+[\n\s]*(?=[;=])/i'),
  56. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  57. 'QUOTEMARKS' => array("'", '"'),
  58. 'HARDQUOTE' => array('@"', '"'),
  59. 'HARDESCAPE' => array('"'),
  60. 'HARDCHAR' => '"',
  61. 'ESCAPE_CHAR' => '\\',
  62. 'KEYWORDS' => array(
  63. 1 => array(
  64. 'abstract', 'add', 'as', 'base', 'break', 'by', 'case', 'catch', 'const', 'continue',
  65. 'default', 'do', 'else', 'event', 'explicit', 'extern', 'false',
  66. 'finally', 'fixed', 'for', 'foreach', 'from', 'get', 'goto', 'group', 'if',
  67. 'implicit', 'in', 'into', 'internal', 'join', 'lock', 'namespace', 'null',
  68. 'operator', 'out', 'override', 'params', 'partial', 'private',
  69. 'protected', 'public', 'readonly', 'remove', 'ref', 'return', 'sealed',
  70. 'select', 'set', 'stackalloc', 'static', 'switch', 'this', 'throw', 'true',
  71. 'try', 'unsafe', 'using', 'var', 'value', 'virtual', 'volatile', 'where',
  72. 'while', 'yield'
  73. ),
  74. 2 => array(
  75. '#elif', '#endif', '#endregion', '#else', '#error', '#define', '#if',
  76. '#line', '#region', '#undef', '#warning'
  77. ),
  78. 3 => array(
  79. 'checked', 'is', 'new', 'sizeof', 'typeof', 'unchecked'
  80. ),
  81. 4 => array(
  82. 'bool', 'byte', 'char', 'class', 'decimal', 'delegate', 'double',
  83. 'dynamic', 'enum', 'float', 'int', 'interface', 'long', 'object', 'sbyte',
  84. 'short', 'string', 'struct', 'uint', 'ulong', 'ushort', 'void'
  85. ),
  86. 5 => array(
  87. 'Microsoft.Win32',
  88. 'System',
  89. 'System.CodeDOM',
  90. 'System.CodeDOM.Compiler',
  91. 'System.Collections',
  92. 'System.Collections.Bases',
  93. 'System.ComponentModel',
  94. 'System.ComponentModel.Design',
  95. 'System.ComponentModel.Design.CodeModel',
  96. 'System.Configuration',
  97. 'System.Configuration.Assemblies',
  98. 'System.Configuration.Core',
  99. 'System.Configuration.Install',
  100. 'System.Configuration.Interceptors',
  101. 'System.Configuration.Schema',
  102. 'System.Configuration.Web',
  103. 'System.Core',
  104. 'System.Data',
  105. 'System.Data.ADO',
  106. 'System.Data.Design',
  107. 'System.Data.Internal',
  108. 'System.Data.SQL',
  109. 'System.Data.SQLTypes',
  110. 'System.Data.XML',
  111. 'System.Data.XML.DOM',
  112. 'System.Data.XML.XPath',
  113. 'System.Data.XML.XSLT',
  114. 'System.Diagnostics',
  115. 'System.Diagnostics.SymbolStore',
  116. 'System.DirectoryServices',
  117. 'System.Drawing',
  118. 'System.Drawing.Design',
  119. 'System.Drawing.Drawing2D',
  120. 'System.Drawing.Imaging',
  121. 'System.Drawing.Printing',
  122. 'System.Drawing.Text',
  123. 'System.Globalization',
  124. 'System.IO',
  125. 'System.IO.IsolatedStorage',
  126. 'System.Messaging',
  127. 'System.Net',
  128. 'System.Net.Sockets',
  129. 'System.NewXml',
  130. 'System.NewXml.XPath',
  131. 'System.NewXml.Xsl',
  132. 'System.Reflection',
  133. 'System.Reflection.Emit',
  134. 'System.Resources',
  135. 'System.Runtime.InteropServices',
  136. 'System.Runtime.InteropServices.Expando',
  137. 'System.Runtime.Remoting',
  138. 'System.Runtime.Serialization',
  139. 'System.Runtime.Serialization.Formatters',
  140. 'System.Runtime.Serialization.Formatters.Binary',
  141. 'System.Security',
  142. 'System.Security.Cryptography',
  143. 'System.Security.Cryptography.X509Certificates',
  144. 'System.Security.Permissions',
  145. 'System.Security.Policy',
  146. 'System.Security.Principal',
  147. 'System.ServiceProcess',
  148. 'System.Text',
  149. 'System.Text.RegularExpressions',
  150. 'System.Threading',
  151. 'System.Timers',
  152. 'System.Web',
  153. 'System.Web.Caching',
  154. 'System.Web.Configuration',
  155. 'System.Web.Security',
  156. 'System.Web.Services',
  157. 'System.Web.Services.Description',
  158. 'System.Web.Services.Discovery',
  159. 'System.Web.Services.Protocols',
  160. 'System.Web.UI',
  161. 'System.Web.UI.Design',
  162. 'System.Web.UI.Design.WebControls',
  163. 'System.Web.UI.Design.WebControls.ListControls',
  164. 'System.Web.UI.HtmlControls',
  165. 'System.Web.UI.WebControls',
  166. 'System.WinForms',
  167. 'System.WinForms.ComponentModel',
  168. 'System.WinForms.Design',
  169. 'System.Xml',
  170. 'System.Xml.Serialization',
  171. 'System.Xml.Serialization.Code',
  172. 'System.Xml.Serialization.Schema'
  173. ),
  174. ),
  175. 'SYMBOLS' => array(
  176. '+', '-', '*', '?', '=', '/', '%', '&', '>', '<', '^', '!', ':', ';',
  177. '(', ')', '{', '}', '[', ']', '|', '.'
  178. ),
  179. 'CASE_SENSITIVE' => array(
  180. GESHI_COMMENTS => false,
  181. 1 => false,
  182. 2 => false,
  183. 3 => false,
  184. 4 => false,
  185. 5 => false,
  186. ),
  187. 'STYLES' => array(
  188. 'KEYWORDS' => array(
  189. 1 => 'color: #0600FF; font-weight: bold;',
  190. 2 => 'color: #FF8000; font-weight: bold;',
  191. 3 => 'color: #008000;',
  192. 4 => 'color: #6666cc; font-weight: bold;',
  193. 5 => 'color: #000000;'
  194. ),
  195. 'COMMENTS' => array(
  196. 1 => 'color: #008080; font-style: italic;',
  197. 2 => 'color: #008080;',
  198. 3 => 'color: #008080;',
  199. 'MULTI' => 'color: #008080; font-style: italic;'
  200. ),
  201. 'ESCAPE_CHAR' => array(
  202. 0 => 'color: #008080; font-weight: bold;',
  203. 'HARD' => 'color: #008080; font-weight: bold;'
  204. ),
  205. 'BRACKETS' => array(
  206. 0 => 'color: #008000;'
  207. ),
  208. 'STRINGS' => array(
  209. 0 => 'color: #666666;',
  210. 'HARD' => 'color: #666666;'
  211. ),
  212. 'NUMBERS' => array(
  213. 0 => 'color: #FF0000;'
  214. ),
  215. 'METHODS' => array(
  216. 1 => 'color: #0000FF;',
  217. 2 => 'color: #0000FF;'
  218. ),
  219. 'SYMBOLS' => array(
  220. 0 => 'color: #008000;'
  221. ),
  222. 'REGEXPS' => array(
  223. ),
  224. 'SCRIPT' => array(
  225. )
  226. ),
  227. 'URLS' => array(
  228. 1 => '',
  229. 2 => '',
  230. 3 => 'http://www.google.com/search?q={FNAMEL}+msdn.microsoft.com',
  231. 4 => '',
  232. 5 => ''
  233. ),
  234. 'OOLANG' => true,
  235. 'OBJECT_SPLITTERS' => array(
  236. 1 => '.',
  237. 2 => '::'
  238. ),
  239. 'REGEXPS' => array(
  240. ),
  241. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  242. 'SCRIPT_DELIMITERS' => array(
  243. ),
  244. 'HIGHLIGHT_STRICT_BLOCK' => array(
  245. ),
  246. 'TAB_WIDTH' => 4,
  247. 'PARSER_CONTROL' => array(
  248. 'KEYWORDS' => array(
  249. 'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\#>|^])",
  250. 'DISALLOWED_AFTER' => "(?![a-zA-Z0-9_%\\-])"
  251. )
  252. )
  253. );
  254. ?>