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