1 | <?php
|
---|
2 | /*************************************************************************************
|
---|
3 | * dos.php
|
---|
4 | * -------
|
---|
5 | * Author: Alessandro Staltari ([email protected])
|
---|
6 | * Copyright: (c) 2005 Alessandro Staltari (http://www.geocities.com/SiliconValley/Vista/8155/)
|
---|
7 | * Release Version: 1.0.8.8
|
---|
8 | * Date Started: 2005/07/05
|
---|
9 | *
|
---|
10 | * DOS language file for GeSHi.
|
---|
11 | *
|
---|
12 | * CHANGES
|
---|
13 | * -------
|
---|
14 | * 2008/05/23 (1.0.7.22)
|
---|
15 | * - Added description of extra language features (SF#1970248)
|
---|
16 | * 2005/07/05 (1.0.0)
|
---|
17 | * - First Release
|
---|
18 | *
|
---|
19 | * TODO (updated 2005/07/05)
|
---|
20 | * -------------------------
|
---|
21 | *
|
---|
22 | * - Highlight pipes and redirection (do we really need this?)
|
---|
23 | * - Add missing keywords.
|
---|
24 | * - Find a good hyperlink for keywords.
|
---|
25 | * - Improve styles.
|
---|
26 | *
|
---|
27 | * KNOWN ISSUES (updated 2005/07/07)
|
---|
28 | * ---------------------------------
|
---|
29 | *
|
---|
30 | * - Doesn't even try to handle spaces in variables name or labels (I can't
|
---|
31 | * find a reliable way to establish if a sting is a name or not, in some
|
---|
32 | * cases it depends on the contex or enviroment status).
|
---|
33 | * - Doesn't handle %%[letter] pseudo variable used inside FOR constructs
|
---|
34 | * (it should be done only into its scope: how to handle variable it?).
|
---|
35 | * - Doesn't handle %~[something] pseudo arguments.
|
---|
36 | * - If the same keyword is placed at the end of the line and the
|
---|
37 | * beginning of the next, the second occourrence is not highlighted
|
---|
38 | * (this should be a GeSHi bug, not related to the language definition).
|
---|
39 | * - I can't avoid to have keyword highlighted even when they are not used
|
---|
40 | * as keywords but, for example, as arguments to the echo command.
|
---|
41 | *
|
---|
42 | *************************************************************************************
|
---|
43 | *
|
---|
44 | * This file is part of GeSHi.
|
---|
45 | *
|
---|
46 | * GeSHi is free software; you can redistribute it and/or modify
|
---|
47 | * it under the terms of the GNU General Public License as published by
|
---|
48 | * the Free Software Foundation; either version 2 of the License, or
|
---|
49 | * (at your option) any later version.
|
---|
50 | *
|
---|
51 | * GeSHi is distributed in the hope that it will be useful,
|
---|
52 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
53 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
54 | * GNU General Public License for more details.
|
---|
55 | *
|
---|
56 | * You should have received a copy of the GNU General Public License
|
---|
57 | * along with GeSHi; if not, write to the Free Software
|
---|
58 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
59 | *
|
---|
60 | ************************************************************************************/
|
---|
61 |
|
---|
62 | $language_data = array (
|
---|
63 | 'LANG_NAME' => 'DOS',
|
---|
64 | 'COMMENT_SINGLE' => array(),
|
---|
65 | 'COMMENT_MULTI' => array(),
|
---|
66 | //DOS comment lines
|
---|
67 | 'COMMENT_REGEXP' => array(
|
---|
68 | 1 => "/^\s*@?REM\b.*$/mi",
|
---|
69 | 2 => "/^\s*::.*$/m"
|
---|
70 | ),
|
---|
71 | 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
|
---|
72 | 'QUOTEMARKS' => array(),
|
---|
73 | 'ESCAPE_CHAR' => '',
|
---|
74 | 'KEYWORDS' => array(
|
---|
75 | /* Flow control keywords */
|
---|
76 | 1 => array(
|
---|
77 | 'if', 'else', 'goto', 'shift',
|
---|
78 | 'for', 'in', 'do',
|
---|
79 | 'call', 'exit'
|
---|
80 | ),
|
---|
81 | /* IF statement keywords */
|
---|
82 | 2 => array(
|
---|
83 | 'not', 'exist', 'errorlevel',
|
---|
84 | 'defined',
|
---|
85 | 'equ', 'neq', 'lss', 'leq', 'gtr', 'geq'
|
---|
86 | ),
|
---|
87 | /* Internal commands */
|
---|
88 | 3 => array(
|
---|
89 | 'cd', 'md', 'rd', 'chdir', 'mkdir', 'rmdir', 'dir',
|
---|
90 | 'del', 'copy', 'move', 'ren', 'rename',
|
---|
91 | 'echo',
|
---|
92 | 'setlocal', 'endlocal', 'set',
|
---|
93 | 'pause',
|
---|
94 | 'pushd', 'popd', 'title', 'verify'
|
---|
95 | ),
|
---|
96 | /* Special files */
|
---|
97 | 4 => array(
|
---|
98 | 'prn', 'nul', 'lpt3', 'lpt2', 'lpt1', 'con',
|
---|
99 | 'com4', 'com3', 'com2', 'com1', 'aux'
|
---|
100 | )
|
---|
101 | ),
|
---|
102 | 'SYMBOLS' => array(
|
---|
103 | '(', ')', '@', '%'
|
---|
104 | ),
|
---|
105 | 'CASE_SENSITIVE' => array(
|
---|
106 | GESHI_COMMENTS => false,
|
---|
107 | 1 => false,
|
---|
108 | 2 => false,
|
---|
109 | 3 => false,
|
---|
110 | 4 => false
|
---|
111 | ),
|
---|
112 | 'STYLES' => array(
|
---|
113 | 'KEYWORDS' => array(
|
---|
114 | 1 => 'color: #00b100; font-weight: bold;',
|
---|
115 | 2 => 'color: #000000; font-weight: bold;',
|
---|
116 | 3 => 'color: #b1b100; font-weight: bold;',
|
---|
117 | 4 => 'color: #0000ff; font-weight: bold;'
|
---|
118 | ),
|
---|
119 | 'COMMENTS' => array(
|
---|
120 | 1 => 'color: #808080; font-style: italic;',
|
---|
121 | 2 => 'color: #b100b1; font-style: italic;',
|
---|
122 | ),
|
---|
123 | 'ESCAPE_CHAR' => array(
|
---|
124 | 0 => 'color: #ff0000; font-weight: bold;'
|
---|
125 | ),
|
---|
126 | 'BRACKETS' => array(
|
---|
127 | 0 => 'color: #66cc66;'
|
---|
128 | ),
|
---|
129 | 'STRINGS' => array(
|
---|
130 | 0 => 'color: #ff0000;'
|
---|
131 | ),
|
---|
132 | 'NUMBERS' => array(
|
---|
133 | 0 => 'color: #cc66cc;'
|
---|
134 | ),
|
---|
135 | 'METHODS' => array(
|
---|
136 | ),
|
---|
137 | 'SYMBOLS' => array(
|
---|
138 | 0 => 'color: #33cc33;',
|
---|
139 | 1 => 'color: #33cc33;'
|
---|
140 | ),
|
---|
141 | 'SCRIPT' => array(
|
---|
142 | ),
|
---|
143 | 'REGEXPS' => array(
|
---|
144 | 0 => 'color: #b100b1; font-weight: bold;',
|
---|
145 | 1 => 'color: #448844;',
|
---|
146 | 2 => 'color: #448888;'
|
---|
147 | )
|
---|
148 | ),
|
---|
149 | 'OOLANG' => false,
|
---|
150 | 'OBJECT_SPLITTERS' => array(
|
---|
151 | ),
|
---|
152 | 'URLS' => array(
|
---|
153 | 1 => 'http://www.ss64.com/nt/{FNAMEL}.html',
|
---|
154 | 2 => 'http://www.ss64.com/nt/{FNAMEL}.html',
|
---|
155 | 3 => 'http://www.ss64.com/nt/{FNAMEL}.html',
|
---|
156 | 4 => 'http://www.ss64.com/nt/{FNAMEL}.html'
|
---|
157 | ),
|
---|
158 | 'REGEXPS' => array(
|
---|
159 | /* Label */
|
---|
160 | 0 => array(
|
---|
161 | /* GESHI_SEARCH => '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((?<!\n)[^\s\n]*)',*/
|
---|
162 | GESHI_SEARCH => '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((?<!\n)[^\n]*)',
|
---|
163 | GESHI_REPLACE => '\\2',
|
---|
164 | GESHI_MODIFIERS => 'si',
|
---|
165 | GESHI_BEFORE => '\\1',
|
---|
166 | GESHI_AFTER => ''
|
---|
167 | ),
|
---|
168 | /* Variable assignement */
|
---|
169 | 1 => array(
|
---|
170 | /* GESHI_SEARCH => '(SET[\s]+(?si:\/A[\s]+|\/P[\s]+|))([^=\s\n]+)([\s]*=)',*/
|
---|
171 | GESHI_SEARCH => '(SET[\s]+(?si:\/A[\s]+|\/P[\s]+|))([^=\n]+)([\s]*=)',
|
---|
172 | GESHI_REPLACE => '\\2',
|
---|
173 | GESHI_MODIFIERS => 'si',
|
---|
174 | GESHI_BEFORE => '\\1',
|
---|
175 | GESHI_AFTER => '\\3'
|
---|
176 | ),
|
---|
177 | /* Arguments or variable evaluation */
|
---|
178 | 2 => array(
|
---|
179 | /* GESHI_SEARCH => '(%)([\d*]|[^%\s]*(?=%))((?<!%\d)%|)',*/
|
---|
180 | GESHI_SEARCH => '(%(?:%(?=[a-z0-9]))?)([\d*]|(?:~[adfnpstxz]*(?:$\w+:)?)?[a-z0-9](?!\w)|[^%\n]*(?=%))((?<!%\d)%|)',
|
---|
181 | GESHI_REPLACE => '\\2',
|
---|
182 | GESHI_MODIFIERS => 'si',
|
---|
183 | GESHI_BEFORE => '\\1',
|
---|
184 | GESHI_AFTER => '\\3'
|
---|
185 | )
|
---|
186 | ),
|
---|
187 | 'STRICT_MODE_APPLIES' => GESHI_NEVER,
|
---|
188 | 'SCRIPT_DELIMITERS' => array(
|
---|
189 | ),
|
---|
190 | 'HIGHLIGHT_STRICT_BLOCK' => array(
|
---|
191 | ),
|
---|
192 | 'TAB_WIDTH' => 4,
|
---|
193 | 'PARSER_CONTROL' => array(
|
---|
194 | 'KEYWORDS' => array(
|
---|
195 | 4 => array(
|
---|
196 | 'DISALLOWED_BEFORE' => '(?<!\w)'
|
---|
197 | )
|
---|
198 | )
|
---|
199 | )
|
---|
200 | );
|
---|
201 |
|
---|
202 | ?> |
---|