File: syntax

package info (click to toggle)
le 1.14.3-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,176 kB
  • ctags: 3,324
  • sloc: cpp: 18,354; ansic: 12,912; sh: 3,622; makefile: 83
file content (275 lines) | stat: -rw-r--r-- 6,833 bytes parent folder | download | duplicates (2)
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# -*- LE-syntax -*-
# Syntax patterns for LE editor. (c) 1997-2008 Alexander V. Lukyanov
# This file is distributed under GNU GPL license.
# Please send corrections and improvements to <lav@yars.free.net>
#
# $Id: syntax,v 1.53 2009/07/10 07:53:12 lav Exp $
#
# This file describes how to highlight syntax. The following format
# used:
# /PATTERN - selects file names for which next lines apply
# c[i]COLOR[,MASK]=REGEXP - use COLOR (1-3) to highlight subexpressions
# of REGEXP; MASK is bitmask selecting which subexpressions are to
# highlight, 0 (default) means the whole patterm.
# C escapes can be used in REGEXP. It can also be split into several lines
# by trailing \ on the line, spaces after such a split are ignored.
# The optional `i' means to ignore case.

# c1 usually marks keywords
# c2 usually marks important syntax elements
# c3 usually marks comments or text strings
# c4 usually marks preprocessor directives
# c5
# c6

# i=file includes specified file from PKGDATADIR/syntax.d/file
#	(useful for large descriptions or common patterns)
# s[i](file)[MASK]=REGEXP uses patterns in the file to color matched substring(s)

# maximum height of constructs (above and below the screen)
h20

# This file mode
//-\*- *LE-syntax *-\*-
c3=^#.*$
c1,1=^(h|ci?|i)[0-9]?(?:,[0-9]+)?=
c2,1=^(?:h|ci?|i)[0-9]?(?:,[0-9]+)?(=)
c1,1=^(si?)\\([^\n]+\\)[0-9]*=
c2,7=^si?(\\()[^\n]+(\\))[0-9]*(=)
c2=^/

# C language mode (lav)
/*.c|/-\*- *c *-\*-
i=c-comment
i=cpp
i=c-literal
c1,2=([^[:alnum:]_]|^)(asm|else|if|switch|case|while|for|goto|break\
 |continue|char|short|int|long|unsigned|signed|auto\
 |const|default|do|double|enum|extern|float|register\
 |return|sizeof|static|struct|typedef|union|void|volatile\
)([^[:alnum:]_]|$)
c2=\\[|\\]|\\(|\\)|{|}|,

# C++ mode (lav)
/*.cc|*.C|*.cpp|*.h|*.hh|*.hpp|*.H|/-\*- *c\+\+ *-\*-
i=c++-comment
i=cpp
i=c-literal
c1,2=([^[:alnum:]_]|^)(asm|else|if|switch|case|while|for|goto|break\
 |continue|char|short|int|long|unsigned|signed|auto\
 |const|default|do|double|enum|extern|float|register\
 |return|sizeof|static|struct|typedef|union|void|volatile\
 |try|catch|class|new|delete|private|public|protected|this|virtual\
 |inline|bool|true|false|operator|overload|template|friend|namespace|using\
 |typeid|dynamic_cast|const_cast|static_cast|reinterpret_cast|typename|explicit\
)([^[:alnum:]_]|$)
c2=\\[|\\]|\\(|\\)|{|}|,

# named.conf mode (lav)
/named.conf|/-\*- *(named|bind) *-\*-
i=named-conf

/logrotate.conf|/-\*- *logrotate *-\*-
i=logrotate-conf

# nroff mode (lav)
/*.[1-9]|/-\*- *nroff *-\*-
c3=^\.\\\\".*$
c2=^\.[[:alpha:]]*
c1,1=\\\\fB((\\\\[^f]|[^\\])*[^\\]?)(\\\\f|$)
c3,1=\\\\fI((\\\\[^f]|[^\\])*[^\\]?)(\\\\f|$)
c1,1=^\.B[IR]? (.*)$
c3,1=^\.I (.*)$

/*.e
i=eiffel

/*.adb|*.ads|*.adc|*.gpr
i=ada

/*.S|*.s
i=as

/*.py
i=python

/*.sa
i=sather

/*.sh|/^#![ \t]*/.*/(ba|z|k)?sh|-\*- *sh *-\*-
i=shell

/*.java|/-\*- *java *-\*-
i=java

/*.js|/-\*- *javascript *-\*-
i=javascript

# po (i18n) mode (lav)
/*.po|*.pot
c1=^#, .*
c2="|\\\\n|%[+- #]*[0-9*]*\\.?[0-9*]*l?[l]?[diouxXfeEgGcs]
c3=^#.*$

/*.lout
i=lout

/*.awk
i=awk

/*.gma|*.gema|/^#![ \t]*/.*/\gema
i=gema

/*.p[lm]|/^#![ \t]*/.*/\perl|-\*- *perl *-\*-
i=perl

/*.sql|*.buf|/-\*- *[sS][qQ][lL] *-\*-
i=sql

/*.mib|*.smi
i=snmp-mib

/*.texi|-\*- *texinfo *-\*-
i=texinfo

/*.tex
i=tex

/*.php.*|*.php|/<\?php
s(php)1=<\?(?:php)?((?:.|\n)*?)\?>
s(html)1=(?:\`|\?>)((?:.|\n)*?)(?:<\?|\')
i=html
i=php

/*.html|*.htm|*.shtml|/-\*- *html *-\*-|^<![Dd][Oo][Cc][Tt][Yy][Pp][Ee] [Hh][Tt][Mm][Ll]|^<[Hh][Tt][Mm][Ll]>
i=html

/*.tcl|/^#![ \t]*/.*/tcl|-\*- *tcl *-\*-
i=tcl

/*.mf|*.mp
i=metafont

# Patch mode, by Serge Vakulenko <vak@cronyx.ru>
/*.pch|*.diff|*.patch|/^diff
c2=^\+\+.*$
c2=^--.*$
c2=^@@.*$
c3=^\+.*$
c1=^-.*$

# Generic configuration files, by Serge Vakulenko <vak@cronyx.ru>
/*.conf|*.cf|*.cfg|*.ini
c3=[#;].*$
c2=:|\$|->|=
c2,1=^(\[)[^\]]+\]
c2,1=^\[[^\]]+(\])
c1,1=^\[([^\]]+)\]

/[Mm]akefile|[Mm]akefile.*|*.mk|/^#![ \t]*/.*/make|-\*-.*makefile[^\w]
i=make-file

/*.v|/-\*- *verilog *-\*-
i=verilog

# Debian control file mode, by Raphael Geissert <atomo64@gmail.com>
#/control|/^Source:
//^Source:
c3=^#.*$
ci2,1=^[[:alnum:]-]+(:)
c2=\$|=|<|>|\||,
c2=^ \.
c1,1=^(Source|Package|Version|Section|Priority|Maintainer|Homepage|Description\
 |Standards-Version|(Build-)?Depends(-Indep)?|Architecture|Provides|Replaces\
 |Recommends|Suggests|(Build-)?Conflicts(-Indep)?|Enhances|Uploaders|Vcs-Browser\
 |Essential|Installed-Size|Binary|Format|Files|Closes|Changes|Urgency\
 |Distribution|Date|Changed-By|Checksums-Sha(1|256))
ci1=^Vcs-[[:alnum:]]+
c1,1=^(X[BCS]+-[[:alnum:]-]+)(:)

# Debian changelog mode, by Raphael Geissert <atomo64@gmail.com>
// ([^ ]+) .+; +urgency=
c3=^[ \t]+--.+
c2,1=urgency=([[:alnum:]]+)
ci2,1=[ \t]+([[:alnum:]]+);[ \t]+urgency=
c2,1=^[[:alnum:].-]+ +\((.+)\)
c1,1=^([[:alnum:].-]+) +\(.+\)
ci1=closes:[ \t]*(bug)?#?[ \t]?[0-9]+(,[ \t]*\
 (bug)?\#?[ \t]?[0-9]+)*
c1=LP:[ \t]+#[0-9]+
c2,1=(\[).+\]
c2,1=\[.+(\])
c3,1=\[(.+)\]
c1=^[ \t]+[*+-][^-]
c3="[^"]+?"
c3,1=\W('[^']+?')\W

# simple, and imperfect, changelog mode, by Raphael Geissert <atomo64@gmail.com>
/ChangeLog|/^[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2,4\}[ \t]
c3=^[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2,4\}[ \t]+
c2,3=^[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2,4\}.*  ([[:alnum:]]+)$

# lsm mode, by Raphael Geissert <atomo64@gmail.com>
/*.lsm|/^Begin[34]
c3=^(Begin[34]|End)
ci2,1=^[[:alnum:]-]+(:)
#c1,1=^([^ \t]*):
c1,1=^(Title|Version|Entered-date|Description|Keywords|Author|Maintained-by\
 |(Primary|Alternate|Original)-site|Platforms|Copying-policy):
c2=[@()]

# really basic m4 and ac modes, by Raphael Geissert <atomo64@gmail.com>
/*.m4
c3=^[ \t]*#.*$
c2=:|\$|[+-:]?=|>|<|`|\||\[|\]|\(|\)|{|}|&
c1,2=(^|[^[:alnum:]_])(m4_[[:alnum:]_]+)
c3="|'

/*.ac
c3,2=(^|[^[:alnum:]_])dnl([^[:alnum:]_].*)?$
c1,2=(^|[^[:alnum:]_])(A[CM]_[[:alnum:]_]+)
c2=:|=|>|<|,|\||\[|\]|\(|\)|{|}|&
c3="|'
i=shell

# watch file mode, by Raphael Geissert <atomo64@gmail.com>
/watch|/version=[23]
c3=^[ \t]*#.*
c2=[ \t]*version=[0-9]
c1,1=^[ \t]*(opt(ion)?s)
c1=(downloadurl|[du]?version|filename)mangle
c1=active|passive|pasv
c2=,
c2,1=[^\\](\.)[^/]+[ \n\t]
c3=\(.+\)

# .gdbinit mode, by Raphael Geissert <atomo64@gmail.com>
/gdbinit|.*gdbinit
c1,1=^(define|end|document)([^[:alnum:]_]|$)
c2,3=^[[:alnum:]][^ \t]+[ \t]+([[:alnum:]_]+)$

# series (quilt) mode, by Raphael Geissert <atomo64@gmail.com>
/series
c3=^[ \t]*#.*

# .desktop files mode, by Raphael Geissert <atomo64@gmail.com>
/*.desktop|*eventsrc
c2,1=(\[).+\]
c2,1=\[.+(\])
c3,1=\[(.+)\]
c3=^[ \t]*#.*
c1,1=^((Generic)?Name|Comment|(Try)?Exec|Icon|X-[a-zA-Z0-9-]+|Type|Categories\
 |Version|NoDisplay|Hidden|(Only|Not)ShowIn|Path|Terminal|MimeType|URL\
 |Startup(Notify|WMClass)|\
 # eventsrc-specific:\
 |default_presentation\
)

/*.fvwm|*.fvwmrc|*.fvwm2rc
i=fvwm2

/*.pas
i=pascal

/*.t2t
i=txt2tags