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.

csharp.php 8.9KB

11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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.10
  9. * Date Started: 2004/06/04
  10. *
  11. * C# language file for GeSHi.
  12. *
  13. * CHANGES
  14. * -------
  15. * 2009/04/03 (1.0.8.6)
  16. * - Added missing keywords identified by Rosetta Code users.
  17. * 2008/05/25 (1.0.7.22)
  18. * - Added highlighting of using and namespace directives as non-OOP
  19. * 2005/01/05 (1.0.1)
  20. * - Used hardquote support for @"..." strings (Cliff Stanford)
  21. * 2004/11/27 (1.0.0)
  22. * - Initial release
  23. *
  24. * TODO (updated 2004/11/27)
  25. * -------------------------
  26. *
  27. *************************************************************************************
  28. *
  29. * This file is part of GeSHi.
  30. *
  31. * GeSHi is free software; you can redistribute it and/or modify
  32. * it under the terms of the GNU General Public License as published by
  33. * the Free Software Foundation; either version 2 of the License, or
  34. * (at your option) any later version.
  35. *
  36. * GeSHi is distributed in the hope that it will be useful,
  37. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  38. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  39. * GNU General Public License for more details.
  40. *
  41. * You should have received a copy of the GNU General Public License
  42. * along with GeSHi; if not, write to the Free Software
  43. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  44. *
  45. ************************************************************************************/
  46. $language_data = array (
  47. 'LANG_NAME' => 'C#',
  48. 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
  49. 'COMMENT_MULTI' => array('/*' => '*/'),
  50. 'COMMENT_REGEXP' => array(
  51. //Using and Namespace directives (basic support)
  52. //Please note that the alias syntax for using is not supported
  53. 3 => '/(?:(?<=using[\\n\\s])|(?<=namespace[\\n\\s]))[\\n\\s]*([a-zA-Z0-9_]+\\.)*[a-zA-Z0-9_]+[\n\s]*(?=[;=])/i'),
  54. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  55. 'QUOTEMARKS' => array("'", '"'),
  56. 'HARDQUOTE' => array('@"', '"'),
  57. 'HARDESCAPE' => array('"'),
  58. 'HARDCHAR' => '"',
  59. 'ESCAPE_CHAR' => '\\',
  60. 'KEYWORDS' => array(
  61. 1 => array(
  62. 'as', 'auto', 'base', 'break', 'case', 'catch', 'const', 'continue',
  63. 'default', 'do', 'else', 'event', 'explicit', 'extern', 'false',
  64. 'finally', 'fixed', 'for', 'foreach', 'from', 'goto', 'if',
  65. 'implicit', 'in', 'internal', 'lock', 'namespace', 'null',
  66. 'operator', 'out', 'override', 'params', 'partial', 'private',
  67. 'protected', 'public', 'readonly', 'ref', 'return', 'sealed',
  68. 'select', 'stackalloc', 'static', 'switch', 'this', 'throw', 'true',
  69. 'try', 'unsafe', 'using', 'virtual', 'where', 'while', 'yield'
  70. ),
  71. 2 => array(
  72. '#elif', '#endif', '#endregion', '#else', '#error', '#define', '#if',
  73. '#line', '#region', '#undef', '#warning'
  74. ),
  75. 3 => array(
  76. 'checked', 'is', 'new', 'sizeof', 'typeof', 'unchecked'
  77. ),
  78. 4 => array(
  79. 'bool', 'byte', 'char', 'class', 'decimal', 'delegate', 'double',
  80. 'enum', 'float', 'int', 'interface', 'long', 'object', 'sbyte',
  81. 'short', 'string', 'struct', 'uint', 'ulong', 'ushort', 'void'
  82. ),
  83. 5 => array(
  84. 'Microsoft.Win32',
  85. 'System',
  86. 'System.CodeDOM',
  87. 'System.CodeDOM.Compiler',
  88. 'System.Collections',
  89. 'System.Collections.Bases',
  90. 'System.ComponentModel',
  91. 'System.ComponentModel.Design',
  92. 'System.ComponentModel.Design.CodeModel',
  93. 'System.Configuration',
  94. 'System.Configuration.Assemblies',
  95. 'System.Configuration.Core',
  96. 'System.Configuration.Install',
  97. 'System.Configuration.Interceptors',
  98. 'System.Configuration.Schema',
  99. 'System.Configuration.Web',
  100. 'System.Core',
  101. 'System.Data',
  102. 'System.Data.ADO',
  103. 'System.Data.Design',
  104. 'System.Data.Internal',
  105. 'System.Data.SQL',
  106. 'System.Data.SQLTypes',
  107. 'System.Data.XML',
  108. 'System.Data.XML.DOM',
  109. 'System.Data.XML.XPath',
  110. 'System.Data.XML.XSLT',
  111. 'System.Diagnostics',
  112. 'System.Diagnostics.SymbolStore',
  113. 'System.DirectoryServices',
  114. 'System.Drawing',
  115. 'System.Drawing.Design',
  116. 'System.Drawing.Drawing2D',
  117. 'System.Drawing.Imaging',
  118. 'System.Drawing.Printing',
  119. 'System.Drawing.Text',
  120. 'System.Globalization',
  121. 'System.IO',
  122. 'System.IO.IsolatedStorage',
  123. 'System.Messaging',
  124. 'System.Net',
  125. 'System.Net.Sockets',
  126. 'System.NewXml',
  127. 'System.NewXml.XPath',
  128. 'System.NewXml.Xsl',
  129. 'System.Reflection',
  130. 'System.Reflection.Emit',
  131. 'System.Resources',
  132. 'System.Runtime.InteropServices',
  133. 'System.Runtime.InteropServices.Expando',
  134. 'System.Runtime.Remoting',
  135. 'System.Runtime.Serialization',
  136. 'System.Runtime.Serialization.Formatters',
  137. 'System.Runtime.Serialization.Formatters.Binary',
  138. 'System.Security',
  139. 'System.Security.Cryptography',
  140. 'System.Security.Cryptography.X509Certificates',
  141. 'System.Security.Permissions',
  142. 'System.Security.Policy',
  143. 'System.Security.Principal',
  144. 'System.ServiceProcess',
  145. 'System.Text',
  146. 'System.Text.RegularExpressions',
  147. 'System.Threading',
  148. 'System.Timers',
  149. 'System.Web',
  150. 'System.Web.Caching',
  151. 'System.Web.Configuration',
  152. 'System.Web.Security',
  153. 'System.Web.Services',
  154. 'System.Web.Services.Description',
  155. 'System.Web.Services.Discovery',
  156. 'System.Web.Services.Protocols',
  157. 'System.Web.UI',
  158. 'System.Web.UI.Design',
  159. 'System.Web.UI.Design.WebControls',
  160. 'System.Web.UI.Design.WebControls.ListControls',
  161. 'System.Web.UI.HtmlControls',
  162. 'System.Web.UI.WebControls',
  163. 'System.WinForms',
  164. 'System.WinForms.ComponentModel',
  165. 'System.WinForms.Design',
  166. 'System.Xml',
  167. 'System.Xml.Serialization',
  168. 'System.Xml.Serialization.Code',
  169. 'System.Xml.Serialization.Schema'
  170. ),
  171. ),
  172. 'SYMBOLS' => array(
  173. '+', '-', '*', '?', '=', '/', '%', '&', '>', '<', '^', '!', ':', ';',
  174. '(', ')', '{', '}', '[', ']', '|', '.'
  175. ),
  176. 'CASE_SENSITIVE' => array(
  177. GESHI_COMMENTS => false,
  178. 1 => false,
  179. 2 => false,
  180. 3 => false,
  181. 4 => false,
  182. 5 => false,
  183. ),
  184. 'STYLES' => array(
  185. 'KEYWORDS' => array(
  186. 1 => 'color: #0600FF; font-weight: bold;',
  187. 2 => 'color: #FF8000; font-weight: bold;',
  188. 3 => 'color: #008000;',
  189. 4 => 'color: #6666cc; font-weight: bold;',
  190. 5 => 'color: #000000;'
  191. ),
  192. 'COMMENTS' => array(
  193. 1 => 'color: #008080; font-style: italic;',
  194. 2 => 'color: #008080;',
  195. 3 => 'color: #008080;',
  196. 'MULTI' => 'color: #008080; font-style: italic;'
  197. ),
  198. 'ESCAPE_CHAR' => array(
  199. 0 => 'color: #008080; font-weight: bold;',
  200. 'HARD' => 'color: #008080; font-weight: bold;'
  201. ),
  202. 'BRACKETS' => array(
  203. 0 => 'color: #008000;'
  204. ),
  205. 'STRINGS' => array(
  206. 0 => 'color: #666666;',
  207. 'HARD' => 'color: #666666;'
  208. ),
  209. 'NUMBERS' => array(
  210. 0 => 'color: #FF0000;'
  211. ),
  212. 'METHODS' => array(
  213. 1 => 'color: #0000FF;',
  214. 2 => 'color: #0000FF;'
  215. ),
  216. 'SYMBOLS' => array(
  217. 0 => 'color: #008000;'
  218. ),
  219. 'REGEXPS' => array(
  220. ),
  221. 'SCRIPT' => array(
  222. )
  223. ),
  224. 'URLS' => array(
  225. 1 => '',
  226. 2 => '',
  227. 3 => 'http://www.google.com/search?q={FNAMEL}+msdn.microsoft.com',
  228. 4 => '',
  229. 5 => ''
  230. ),
  231. 'OOLANG' => true,
  232. 'OBJECT_SPLITTERS' => array(
  233. 1 => '.',
  234. 2 => '::'
  235. ),
  236. 'REGEXPS' => array(
  237. ),
  238. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  239. 'SCRIPT_DELIMITERS' => array(
  240. ),
  241. 'HIGHLIGHT_STRICT_BLOCK' => array(
  242. ),
  243. 'TAB_WIDTH' => 4,
  244. 'PARSER_CONTROL' => array(
  245. 'KEYWORDS' => array(
  246. 'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\#>|^])",
  247. 'DISALLOWED_AFTER' => "(?![a-zA-Z0-9_%\\-])"
  248. )
  249. )
  250. );
  251. ?>