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.

178 lines
6.8KB

  1. <?php
  2. /*************************************************************************************
  3. * lua.php
  4. * -------
  5. * Author: Roberto Rossi (rsoftware@altervista.org)
  6. * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2004/07/10
  9. *
  10. * LUA language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2005/08/26 (1.0.2)
  15. * - Added support for objects and methods
  16. * - Removed unusable keywords
  17. * 2004/11/27 (1.0.1)
  18. * - Added support for multiple object splitters
  19. * 2004/10/27 (1.0.0)
  20. * - First Release
  21. *
  22. * TODO (updated 2004/11/27)
  23. * -------------------------
  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' => 'Lua',
  46. 'COMMENT_SINGLE' => array(1 => "--"),
  47. 'COMMENT_MULTI' => array('--[[' => ']]'),
  48. 'COMMENT_REGEXP' => array(2 => '/\[(=*)\[.*?\]\1\]/s'),
  49. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  50. 'QUOTEMARKS' => array("'", '"'),
  51. 'ESCAPE_CHAR' => '',
  52. 'ESCAPE_REGEXP' => array(
  53. //Simple Single Char Escapes
  54. 1 => "#\\\\[\\\\abfnrtv\'\"]#i",
  55. //Octal Char Specs
  56. 2 => "#\\\\\\d{1,3}#"
  57. ),
  58. 'NUMBERS' =>
  59. GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_INT_CSTYLE | GESHI_NUMBER_HEX_PREFIX |
  60. GESHI_NUMBER_FLT_NONSCI | GESHI_NUMBER_FLT_NONSCI_F |
  61. GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO,
  62. 'KEYWORDS' => array(
  63. 1 => array(
  64. 'break','do','else','elseif','end','for','function','if',
  65. 'local','repeat','return','then','until','while'
  66. ),
  67. 2 => array(
  68. 'and','in','not','or'
  69. ),
  70. 3 => array(
  71. '_VERSION','assert','collectgarbage','dofile','error','gcinfo','loadfile','loadstring',
  72. 'print','tonumber','tostring','type','unpack',
  73. '_ALERT','_ERRORMESSAGE','_INPUT','_PROMPT','_OUTPUT',
  74. '_STDERR','_STDIN','_STDOUT','call','dostring','foreach','foreachi','getn','globals','newtype',
  75. 'rawget','rawset','require','sort','tinsert','tremove',
  76. 'abs','acos','asin','atan','atan2','ceil','cos','deg','exp',
  77. 'floor','format','frexp','gsub','ldexp','log','log10','max','min','mod','rad','random','randomseed',
  78. 'sin','sqrt','strbyte','strchar','strfind','strlen','strlower','strrep','strsub','strupper','tan',
  79. 'openfile','closefile','readfrom','writeto','appendto',
  80. 'remove','rename','flush','seek','tmpfile','tmpname','read','write',
  81. 'clock','date','difftime','execute','exit','getenv','setlocale','time',
  82. '_G','getfenv','getmetatable','ipairs','loadlib','next','pairs','pcall',
  83. 'rawegal','setfenv','setmetatable','xpcall',
  84. 'string.byte','string.char','string.dump','string.find','string.len',
  85. 'string.lower','string.rep','string.sub','string.upper','string.format','string.gfind','string.gsub',
  86. 'table.concat','table.foreach','table.foreachi','table.getn','table.sort','table.insert','table.remove','table.setn',
  87. 'math.abs','math.acos','math.asin','math.atan','math.atan2','math.ceil','math.cos','math.deg','math.exp',
  88. 'math.floor','math.frexp','math.ldexp','math.log','math.log10','math.max','math.min','math.mod',
  89. 'math.pi','math.rad','math.random','math.randomseed','math.sin','math.sqrt','math.tan',
  90. 'coroutine.create','coroutine.resume','coroutine.status',
  91. 'coroutine.wrap','coroutine.yield',
  92. 'io.close','io.flush','io.input','io.lines','io.open','io.output','io.read','io.tmpfile','io.type','io.write',
  93. 'io.stdin','io.stdout','io.stderr',
  94. 'os.clock','os.date','os.difftime','os.execute','os.exit','os.getenv','os.remove','os.rename',
  95. 'os.setlocale','os.time','os.tmpname',
  96. 'string','table','math','coroutine','io','os','debug'
  97. ),
  98. 4 => array(
  99. 'nil', 'false', 'true'
  100. ),
  101. 5 => array(
  102. 'Nil', 'Boolean', 'Number', 'String', 'Userdata', 'Thread', 'Table'
  103. )
  104. ),
  105. 'SYMBOLS' => array(
  106. '+', '-', '*', '/', '%', '^', '#',
  107. '==', '~=', '<=', '>=', '<', '>', '=',
  108. '(', ')', '{', '}', '[', ']',
  109. ';', ':', ',', '.', '..', '...'
  110. ),
  111. 'CASE_SENSITIVE' => array(
  112. GESHI_COMMENTS => false,
  113. 1 => true,
  114. 2 => true,
  115. 3 => true,
  116. 4 => true,
  117. 5 => true
  118. ),
  119. 'STYLES' => array(
  120. 'KEYWORDS' => array(
  121. 1 => 'color: #aa9900; font-weight: bold;',
  122. 2 => 'color: #aa9900; font-weight: bold;',
  123. 3 => 'color: #0000aa;',
  124. 4 => 'color: #aa9900;',
  125. 5 => 'color: #aa9900;'
  126. ),
  127. 'COMMENTS' => array(
  128. 1 => 'color: #808080; font-style: italic;',
  129. 2 => 'color: #ff0000;',
  130. 'MULTI' => 'color: #808080; font-style: italic;'
  131. ),
  132. 'ESCAPE_CHAR' => array(
  133. 0 => 'color: #000099; font-weight: bold;',
  134. 1 => 'color: #000099; font-weight: bold;',
  135. 2 => 'color: #000099; font-weight: bold;'
  136. ),
  137. 'BRACKETS' => array(
  138. 0 => 'color: #66cc66;'
  139. ),
  140. 'STRINGS' => array(
  141. 0 => 'color: #ff6666;'
  142. ),
  143. 'NUMBERS' => array(
  144. 0 => 'color: #cc66cc;'
  145. ),
  146. 'METHODS' => array(
  147. 0 => 'color: #aa9900;'
  148. ),
  149. 'SYMBOLS' => array(
  150. 0 => 'color: #66cc66;'
  151. ),
  152. 'REGEXPS' => array(
  153. ),
  154. 'SCRIPT' => array(
  155. )
  156. ),
  157. 'URLS' => array(
  158. 1 => '',
  159. 2 => '',
  160. 3 => '',
  161. 4 => '',
  162. 5 => ''
  163. ),
  164. 'OOLANG' => false,
  165. 'OBJECT_SPLITTERS' => array(
  166. ),
  167. 'REGEXPS' => array(
  168. ),
  169. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  170. 'SCRIPT_DELIMITERS' => array(
  171. ),
  172. 'HIGHLIGHT_STRICT_BLOCK' => array(
  173. )
  174. );
  175. ?>