Ticket #1475: warningis fix
[midnight-commander.git] / syntax / js.syntax
blobf880425cc79b780616b8cb31ad7da38c9940a03e
2 # JavaScript syntax highlighting
3 # for MC Editor/CoolEdit
5 # Author: Vlad Romanenko <VladRomanenko@ukr.net>
6 # Based on c.syntax
8 # TODO:
9 # Highlight JS regexpressions /../
10 # More built-in functions
12 # 2002-09-17  Vlad Romanenko <VladRomanenko@ukr.net>
13 #       * More C and Java consistency by Pavel Roskin <proski@gnu.org>.
14 #       * Advanced number highlighting.
16 # 2002-09-16  Vlad Romanenko <VladRomanenko@ukr.net>
17 #       * Initial public release.
20 context default
22         #=========================
23         # Keywords
24         keyword whole arguments         yellow
25         keyword whole break             yellow
26         keyword whole caller            yellow
27         keyword whole case              yellow
28         keyword whole catch             yellow
29         keyword whole constructor       yellow
30         keyword whole continue          yellow
31         keyword whole else              yellow
32         keyword whole default           yellow
33         keyword whole delete            yellow
34         keyword whole for               yellow
35         keyword whole function          yellow
36         keyword whole if                yellow
37         keyword whole in                yellow
38         keyword whole instanceof        yellow
39         keyword whole new               yellow
40         keyword whole prototype         yellow
41         keyword whole return            yellow
42         keyword whole switch            yellow
43         keyword whole this              yellow
44         keyword whole throw             yellow
45         keyword whole try               yellow
46         keyword whole typeof            yellow
47         keyword whole var               yellow
48         keyword whole while             yellow
49         keyword whole with              yellow
51         #=========================
52         # Objects
53         keyword whole ActiveXObject     yellow
54         keyword whole Array             yellow
55         keyword whole Boolean           yellow
56         keyword whole Date              yellow
57         keyword whole Dictionary        yellow
58         keyword whole Enumerator        yellow
59         keyword whole FileSystemObject  yellow
60         keyword whole Function          yellow
61         keyword whole Global            yellow
62         keyword whole Image             yellow
63         keyword whole Math              yellow
64         keyword whole Number            yellow
65         keyword whole Object            yellow
66         keyword whole TextStream        yellow
67         keyword whole RegExp            yellow
68         keyword whole VBArray           yellow
70         #=========================
71         # Most common functions
72         keyword whole alert             yellow
73         keyword whole escape            yellow
74         keyword whole eval              yellow
75         keyword whole indexOf           yellow
76         keyword whole isNaN             yellow
77         keyword whole toString          yellow
78         keyword whole unescape          yellow
79         keyword whole valueOf           yellow
81         #=========================
82         # Constants
83         keyword whole false             brightgreen
84         keyword whole null              brightgreen
85         keyword whole true              brightgreen
86         keyword whole undefined         yellow
88         #=========================
89         # Comments
90         keyword /\*                     brown
91         keyword \*/                     brown
92         keyword //                      brown
94         #=========================
95         # Numbers
96         wholechars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.
98         keyword whole 0\{xX\}\{0123456789abcdefABCDEF\}\[0123456789abcdefABCDEF\]       brightgreen
99         keyword whole \{0123456789\}\[0123456789\]      brightgreen
100         keyword whole \[0123456789\]\.\{0123456789\}\[0123456789\]      brightgreen
101         keyword whole \{0123456789\}\[0123456789\]\.\[0123456789\]      brightgreen
102         keyword whole \{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\]    brightgreen
103         keyword whole \{0123456789\}\[0123456789\]\{eE\}\{\-\+\}\{0123456789\}\[0123456789\]    brightgreen
104         keyword whole \{0123456789\}\[0123456789\]\.\{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\]      brightgreen
105         keyword whole \{0123456789\}\[0123456789\]\.\{0123456789\}\[0123456789\]\{eE\}\{\-\+\}\{0123456789\}\[0123456789\]      brightgreen
107         #=========================
108         # Special symbols
109         keyword \.      yellow
110         keyword \*      yellow
111         keyword \+      yellow
112         keyword -       yellow
113         keyword /       yellow
114         keyword %       yellow
115         keyword =       yellow
116         keyword !       yellow
117         keyword &       yellow
118         keyword |       yellow
119         keyword ^       yellow
120         keyword ~       yellow
121         keyword >       yellow
122         keyword <       yellow
124         #=========================
125         # Separators
126         keyword {       brightcyan
127         keyword }       brightcyan
128         keyword (       brightcyan
129         keyword )       brightcyan
130         keyword [       brightcyan
131         keyword ]       brightcyan
132         keyword ,       brightcyan
133         keyword ?       brightcyan
134         keyword :       brightcyan
135         keyword ;       brightmagenta
138 #=============================
139 # Comments
141 context exclusive /\* \*/ brown
142         spellcheck
143         keyword whole BUG       brightred
144         keyword whole FixMe     brightred
145         keyword whole FIXME     brightred
146         keyword whole Note      brightred
147         keyword whole NOTE      brightred
148         keyword whole ToDo      brightred
149         keyword whole TODO      brightred
150         keyword !!\[!\]         brightred
151         keyword ??\[?\]         brightred
154 context exclusive // \n brown
155         spellcheck
156         keyword whole BUG       brightred
157         keyword whole FixMe     brightred
158         keyword whole FIXME     brightred
159         keyword whole Note      brightred
160         keyword whole NOTE      brightred
161         keyword whole ToDo      brightred
162         keyword whole TODO      brightred
163         keyword !!\[!\]         brightred
164         keyword ??\[?\]         brightred
167 #=============================
168 # Strings
170 context " " green
171         spellcheck
172         keyword \\\{\\'"abtnvfr\}       brightgreen
173         keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
175         keyword '       brightgreen
177 context ' ' green
178         spellcheck
179         keyword \\\{\\'"abtnvfr\}       brightgreen
180         keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
182         keyword "       brightgreen