1 | 1 | simandl | <?php |
2 | | | /************************************************************************************* |
3 | | | * dos.php |
4 | | | * ------- |
5 | | | * Author: Alessandro Staltari (staltari@geocities.com) |
6 | | | * Copyright: (c) 2005 Alessandro Staltari (http://www.geocities.com/SiliconValley/Vista/8155/) |
7 | 3 | simandl | * Release Version: 1.0.8.3 |
8 | 1 | simandl | * 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(1 => "/^\s*@?REM.*$/mi"), |
68 | | | 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, |
69 | | | 'QUOTEMARKS' => array(), |
70 | | | 'ESCAPE_CHAR' => '', |
71 | | | 'KEYWORDS' => array( |
72 | | | /* Flow control keywords */ |
73 | | | 1 => array( |
74 | | | 'if', 'else', 'goto', 'shift', |
75 | | | 'for', 'in', 'do', |
76 | | | 'call', 'exit' |
77 | | | ), |
78 | | | /* IF statement keywords */ |
79 | | | 2 => array( |
80 | | | 'not', 'exist', 'errorlevel', |
81 | | | 'defined', |
82 | | | 'equ', 'neq', 'lss', 'leq', 'gtr', 'geq' |
83 | | | ), |
84 | | | /* Internal commands */ |
85 | | | 3 => array( |
86 | | | 'cd', 'md', 'rd', 'chdir', 'mkdir', 'rmdir', 'dir', |
87 | | | 'del', 'copy', 'move', 'ren', 'rename', |
88 | | | 'echo', |
89 | | | 'setlocal', 'endlocal', 'set', |
90 | | | 'pause', |
91 | | | 'pushd', 'popd', 'title', 'verify' |
92 | | | ), |
93 | | | /* Special files */ |
94 | | | 4 => array( |
95 | | | 'prn', 'nul', 'lpt3', 'lpt2', 'lpt1', 'con', |
96 | | | 'com4', 'com3', 'com2', 'com1', 'aux' |
97 | | | ) |
98 | | | ), |
99 | | | 'SYMBOLS' => array( |
100 | | | '(', ')', '@', '%' |
101 | | | ), |
102 | | | 'CASE_SENSITIVE' => array( |
103 | | | GESHI_COMMENTS => false, |
104 | | | 1 => false, |
105 | | | 2 => false, |
106 | | | 3 => false, |
107 | | | 4 => false |
108 | | | ), |
109 | | | 'STYLES' => array( |
110 | | | 'KEYWORDS' => array( |
111 | | | 1 => 'color: #00b100; font-weight: bold;', |
112 | | | 2 => 'color: #000000; font-weight: bold;', |
113 | | | 3 => 'color: #b1b100; font-weight: bold;', |
114 | | | 4 => 'color: #0000ff; font-weight: bold;' |
115 | | | ), |
116 | | | 'COMMENTS' => array( |
117 | | | 1 => 'color: #808080; font-style: italic;' |
118 | | | ), |
119 | | | 'ESCAPE_CHAR' => array( |
120 | | | |
121 | | | ), |
122 | | | 'BRACKETS' => array( |
123 | | | |
124 | | | ), |
125 | | | 'STRINGS' => array( |
126 | | | |
127 | | | ), |
128 | | | 'NUMBERS' => array( |
129 | | | |
130 | | | ), |
131 | | | 'METHODS' => array( |
132 | | | ), |
133 | | | 'SYMBOLS' => array( |
134 | | | |
135 | | | 1 => 'color: #33cc33;' |
136 | | | ), |
137 | | | 'SCRIPT' => array( |
138 | | | ), |
139 | | | 'REGEXPS' => array( |
140 | | | |
141 | | | 1 => 'color: #448844;', |
142 | | | 2 => 'color: #448888;' |
143 | | | ) |
144 | | | ), |
145 | | | 'OOLANG' => false, |
146 | | | 'OBJECT_SPLITTERS' => array( |
147 | | | ), |
148 | | | 'URLS' => array( |
149 | | | 1 => 'http://www.ss64.com/nt/{FNAMEL}.html', |
150 | | | 2 => 'http://www.ss64.com/nt/{FNAMEL}.html', |
151 | | | 3 => 'http://www.ss64.com/nt/{FNAMEL}.html', |
152 | | | 4 => 'http://www.ss64.com/nt/{FNAMEL}.html' |
153 | | | ), |
154 | | | 'REGEXPS' => array( |
155 | | | /* Label */ |
156 | | | |
157 | | | /* GESHI_SEARCH => '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((?<!\n)[^\s\n]*)',*/ |
158 | | | GESHI_SEARCH => '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((?<!\n)[^\n]*)', |
159 | | | GESHI_REPLACE => '\\2', |
160 | | | GESHI_MODIFIERS => 'si', |
161 | | | GESHI_BEFORE => '\\1', |
162 | | | GESHI_AFTER => '' |
163 | | | ), |
164 | | | /* Variable assignement */ |
165 | | | 1 => array( |
166 | | | /* GESHI_SEARCH => '(SET[\s]+(?si:\/A[\s]+|\/P[\s]+|))([^=\s\n]+)([\s]*=)',*/ |
167 | | | GESHI_SEARCH => '(SET[\s]+(?si:\/A[\s]+|\/P[\s]+|))([^=\n]+)([\s]*=)', |
168 | | | GESHI_REPLACE => '\\2', |
169 | | | GESHI_MODIFIERS => 'si', |
170 | | | GESHI_BEFORE => '\\1', |
171 | | | GESHI_AFTER => '\\3' |
172 | | | ), |
173 | | | /* Arguments or variable evaluation */ |
174 | | | 2 => array( |
175 | | | /* GESHI_SEARCH => '(%)([\d*]|[^%\s]*(?=%))((?<!%\d)%|)',*/ |
176 | | | GESHI_SEARCH => '(%(?:%(?=[a-z0-9]))?)([\d*]|(?:~[adfnpstxz]*(?:$\w+:)?)?[a-z0-9](?!\w)|[^%\n]*(?=%))((?<!%\d)%|)', |
177 | | | GESHI_REPLACE => '\\2', |
178 | | | GESHI_MODIFIERS => 'si', |
179 | | | GESHI_BEFORE => '\\1', |
180 | | | GESHI_AFTER => '\\3' |
181 | | | ) |
182 | | | ), |
183 | | | 'STRICT_MODE_APPLIES' => GESHI_NEVER, |
184 | | | 'SCRIPT_DELIMITERS' => array( |
185 | | | ), |
186 | | | 'HIGHLIGHT_STRICT_BLOCK' => array( |
187 | | | ), |
188 | | | 'TAB_WIDTH' => 4, |
189 | | | 'PARSER_CONTROL' => array( |
190 | | | 'KEYWORDS' => array( |
191 | | | 4 => array( |
192 | | | 'DISALLOWED_BEFORE' => '(?<!\w)' |
193 | | | ) |
194 | | | ) |
195 | | | ) |
196 | | | ); |
197 | | | |
198 | | | ?> |