summaryrefslogtreecommitdiffstats
path: root/paste/include/geshi/dos.php
blob: bec3de12997fd3c858565d42f3e61b6781d7b814 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?php
/*************************************************************************************
 * dos.php
 * -------
 * Author: Alessandro Staltari (staltari@geocities.com)
 * Copyright: (c) 2005 Alessandro Staltari (http://www.geocities.com/SiliconValley/Vista/8155/)
 * Release Version: 1.0.8.4
 * Date Started: 2005/07/05
 *
 * DOS language file for GeSHi.
 *
 * CHANGES
 * -------
 * 2008/05/23 (1.0.7.22)
 *   -  Added description of extra language features (SF#1970248)
 * 2005/07/05 (1.0.0)
 *  -  First Release
 *
 * TODO (updated 2005/07/05)
 * -------------------------
 *
 * - Highlight pipes and redirection (do we really need this?)
 * - Add missing keywords.
 * - Find a good hyperlink for keywords.
 * - Improve styles.
 *
 * KNOWN ISSUES (updated 2005/07/07)
 * ---------------------------------
 *
 * - Doesn't even try to handle spaces in variables name or labels (I can't
 *   find a reliable way to establish if a sting is a name or not, in some
 *   cases it depends on the contex or enviroment status).
 * - Doesn't handle %%[letter] pseudo variable used inside FOR constructs
 *   (it should be done only into its scope: how to handle variable it?).
 * - Doesn't handle %~[something] pseudo arguments.
 * - If the same keyword is placed at the end of the line and the
 *   beginning of the next, the second occourrence is not highlighted
 *   (this should be a GeSHi bug, not related to the language definition).
 * - I can't avoid to have keyword highlighted even when they are not used
 *   as keywords but, for example, as arguments to the echo command.
 *
 *************************************************************************************
 *
 *     This file is part of GeSHi.
 *
 *   GeSHi is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   GeSHi is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with GeSHi; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 ************************************************************************************/

$language_data = array (
    'LANG_NAME' => 'DOS',
    'COMMENT_SINGLE' => array(),
    'COMMENT_MULTI' => array(),
    //DOS comment lines
    'COMMENT_REGEXP' => array(1 => "/^\s*@?REM.*$/mi"),
    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
    'QUOTEMARKS' => array(),
    'ESCAPE_CHAR' => '',
    'KEYWORDS' => array(
        /* Flow control keywords */
        1 => array(
            'if', 'else', 'goto', 'shift',
            'for', 'in', 'do',
            'call', 'exit'
            ),
        /* IF statement keywords */
        2 => array(
            'not', 'exist', 'errorlevel',
            'defined',
            'equ', 'neq', 'lss', 'leq', 'gtr', 'geq'
            ),
        /* Internal commands */
        3 => array(
            'cd', 'md', 'rd', 'chdir', 'mkdir', 'rmdir', 'dir',
            'del', 'copy', 'move', 'ren', 'rename',
            'echo',
            'setlocal', 'endlocal', 'set',
            'pause',
            'pushd', 'popd', 'title', 'verify'
            ),
        /* Special files */
        4 => array(
            'prn', 'nul', 'lpt3', 'lpt2', 'lpt1', 'con',
            'com4', 'com3', 'com2', 'com1', 'aux'
            )
        ),
    'SYMBOLS' => array(
        '(', ')', '@', '%'
        ),
    'CASE_SENSITIVE' => array(
        GESHI_COMMENTS => false,
        1 => false,
        2 => false,
        3 => false,
        4 => false
        ),
    'STYLES' => array(
        'KEYWORDS' => array(
            1 => 'color: #00b100; font-weight: bold;',
            2 => 'color: #000000; font-weight: bold;',
            3 => 'color: #b1b100; font-weight: bold;',
            4 => 'color: #0000ff; font-weight: bold;'
            ),
        'COMMENTS' => array(
            1 => 'color: #808080; font-style: italic;'
            ),
        'ESCAPE_CHAR' => array(
            0 => 'color: #ff0000; font-weight: bold;'
            ),
        'BRACKETS' => array(
            0 => 'color: #66cc66;'
            ),
        'STRINGS' => array(
            0 => 'color: #ff0000;'
            ),
        'NUMBERS' => array(
            0 => 'color: #cc66cc;'
            ),
        'METHODS' => array(
            ),
        'SYMBOLS' => array(
            0 => 'color: #33cc33;',
            1 => 'color: #33cc33;'
            ),
        'SCRIPT' => array(
            ),
        'REGEXPS' => array(
            0 => 'color: #b100b1; font-weight: bold;',
            1 => 'color: #448844;',
            2 => 'color: #448888;'
            )
        ),
    'OOLANG' => false,
    'OBJECT_SPLITTERS' => array(
        ),
    'URLS' => array(
        1 => 'http://www.ss64.com/nt/{FNAMEL}.html',
        2 => 'http://www.ss64.com/nt/{FNAMEL}.html',
        3 => 'http://www.ss64.com/nt/{FNAMEL}.html',
        4 => 'http://www.ss64.com/nt/{FNAMEL}.html'
        ),
    'REGEXPS' => array(
        /* Label */
        0 => array(
/*            GESHI_SEARCH => '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((?<!\n)[^\s\n]*)',*/
            GESHI_SEARCH => '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((?<!\n)[^\n]*)',
            GESHI_REPLACE => '\\2',
            GESHI_MODIFIERS => 'si',
            GESHI_BEFORE => '\\1',
            GESHI_AFTER => ''
        ),
        /* Variable assignement */
        1 => array(
/*            GESHI_SEARCH => '(SET[\s]+(?si:\/A[\s]+|\/P[\s]+|))([^=\s\n]+)([\s]*=)',*/
            GESHI_SEARCH => '(SET[\s]+(?si:\/A[\s]+|\/P[\s]+|))([^=\n]+)([\s]*=)',
            GESHI_REPLACE => '\\2',
            GESHI_MODIFIERS => 'si',
            GESHI_BEFORE => '\\1',
            GESHI_AFTER => '\\3'
            ),
        /* Arguments or variable evaluation */
        2 => array(
/*            GESHI_SEARCH => '(%)([\d*]|[^%\s]*(?=%))((?<!%\d)%|)',*/
            GESHI_SEARCH => '(%(?:%(?=[a-z0-9]))?)([\d*]|(?:~[adfnpstxz]*(?:$\w+:)?)?[a-z0-9](?!\w)|[^%\n]*(?=%))((?<!%\d)%|)',
            GESHI_REPLACE => '\\2',
            GESHI_MODIFIERS => 'si',
            GESHI_BEFORE => '\\1',
            GESHI_AFTER => '\\3'
            )
        ),
    'STRICT_MODE_APPLIES' => GESHI_NEVER,
    'SCRIPT_DELIMITERS' => array(
        ),
    'HIGHLIGHT_STRICT_BLOCK' => array(
        ),
    'TAB_WIDTH' => 4,
    'PARSER_CONTROL' => array(
        'KEYWORDS' => array(
            4 => array(
                'DISALLOWED_BEFORE' => '(?<!\w)'
                )
            )
        )
);

?>