aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/progress.vim
blob: 9ff506960e20c32f6db44523fa9083d88f1e18e8 (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
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
" Vim syntax file
" Language:		Progress 4GL
" Filename extensions:	*.p (collides with Pascal),
"			*.i (collides with assembler)
"			*.w (collides with cweb)
" Maintainer:		Philip Uren		<philuSPAXY@ieee.org> Remove SPAXY spam block
" Contributors:         Matthew Stickney	<mtstickneySPAXY@gmail.com>
" 			Chris Ruprecht		<chrisSPAXY@ruprecht.org>
"			Mikhail Kuperblum	<mikhailSPAXY@whasup.com>
"			John Florian		<jflorianSPAXY@voyager.net>
" Version:              13
" Last Change:		Nov 11 2012

" quit when a syntax file was already loaded
if exists("b:current_syntax")
	finish
endif

let s:cpo_save = &cpo
set cpo&vim

setlocal iskeyword=@,48-57,_,-,!,#,$,%

" The Progress editor doesn't cope with tabs very well.
set expandtab

syn case ignore

" Progress Blocks of code and mismatched "end." errors.
syn match   ProgressEndError		"\<end\>"
syn region ProgressDoBlock transparent matchgroup=ProgressDo start="\<do\>" matchgroup=ProgressDo end="\<end\>" contains=ALLBUT,ProgressProcedure,ProgressFunction
syn region ProgressForBlock transparent matchgroup=ProgressFor start="\<for\>" matchgroup=ProgressFor end="\<end\>" contains=ALLBUT,ProgressProcedure,ProgressFunction
syn region ProgressRepeatBlock transparent matchgroup=ProgressRepeat start="\<repeat\>" matchgroup=ProgressRepeat end="\<end\>" contains=ALLBUT,ProgressProcedure,ProgressFunction
syn region ProgressCaseBlock transparent matchgroup=ProgressCase start="\<case\>" matchgroup=ProgressCase end="\<end\scase\>\|\<end\>" contains=ALLBUT,ProgressProcedure,ProgressFunction

" These are Progress reserved words,
" and they could go in ProgressReserved,
" but I found it more helpful to highlight them in a different color.
syn keyword ProgressConditional	if else then when otherwise
syn keyword ProgressFor				each where

" Make those TODO and debugging notes stand out!
syn keyword ProgressTodo			contained	TODO BUG FIX
syn keyword ProgressDebug			contained	DEBUG
syn keyword ProgressDebug			debugger

" If you like to highlight the whole line of
" the start and end of procedures
" to make the whole block of code stand out:
syn match ProgressProcedure		"^\s*procedure.*"
syn match ProgressProcedure		"^\s*end\s\s*procedure.*"
syn match ProgressFunction		"^\s*function.*"
syn match ProgressFunction		"^\s*end\s\s*function.*"
" ... otherwise use this:
" syn keyword ProgressFunction	procedure function

syn keyword ProgressReserved	accum[ulate] active-form active-window add alias all alter ambig[uous] analyz[e] and any apply as asc[ending]
syn keyword ProgressReserved	assign asynchronous at attr[-space] audit-control audit-policy authorization auto-ret[urn] avail[able] back[ground]
syn keyword ProgressReserved	before-h[ide] begins bell between big-endian blank break buffer-comp[are] buffer-copy by by-pointer by-variant-point[er] call
syn keyword ProgressReserved	can-do can-find case case-sen[sitive] cast center[ed] check chr clear clipboard codebase-locator colon color column-lab[el]
syn keyword ProgressReserved	col[umns] com-self compiler connected control copy-lob count-of cpstream create current current-changed current-lang[uage]
syn keyword ProgressReserved	current-window current_date curs[or] database dataservers dataset dataset-handle db-remote-host dbcodepage dbcollation dbname
syn keyword ProgressReserved	dbparam dbrest[rictions] dbtaskid dbtype dbvers[ion] dde deblank debug-list debugger decimals declare default
syn keyword ProgressReserved	default-noxl[ate] default-window def[ine] delete delimiter desc[ending] dict[ionary] disable discon[nect] disp[lay] distinct do dos
syn keyword ProgressReserved	down drop dynamic-cast dynamic-func[tion] dynamic-new each editing else enable encode end entry error-stat[us] escape
syn keyword ProgressReserved	etime event-procedure except exclusive[-lock] exclusive-web[-user] exists export false fetch field[s] file-info[rmation]
syn keyword ProgressReserved	fill find find-case-sensitive find-global find-next-occurrence find-prev-occurrence find-select find-wrap-around first
syn keyword ProgressReserved	first-of focus font for form[at] fram[e] frame-col frame-db frame-down frame-field frame-file frame-inde[x] frame-line
syn keyword ProgressReserved	frame-name frame-row frame-val[ue] from from-c[hars] from-p[ixels] function-call-type gateway[s] get-attr-call-type get-byte
syn keyword ProgressReserved	get-codepage[s] get-coll[ations] get-column get-error-column get-error-row get-file-name get-file-offse[t] get-key-val[ue]
syn keyword ProgressReserved	get-message-type get-row getbyte global go-on go-pend[ing] grant graphic-e[dge] group having header help hide host-byte-order if
syn keyword ProgressReserved	import in index indicator input input-o[utput] insert into is is-attr[-space] join kblabel key-code key-func[tion] key-label
syn keyword ProgressReserved	keycode keyfunc[tion] keylabel keys keyword label last last-even[t] last-key last-of lastkey ldbname leave library like
syn keyword ProgressReserved	like-sequential line-count[er] listi[ng] little-endian locked log-manager lookup machine-class map member message message-lines mouse
syn keyword ProgressReserved	mpe new next next-prompt no no-attr[-space] no-error no-f[ill] no-help no-hide no-label[s] no-lobs no-lock no-map
syn keyword ProgressReserved	no-mes[sage] no-pause no-prefe[tch] no-return-val[ue] no-undo no-val[idate] no-wait not now null num-ali[ases] num-dbs num-entries
syn keyword ProgressReserved	of off old on open opsys option or os-append os-command os-copy os-create-dir os-delete os-dir os-drive[s] os-error
syn keyword ProgressReserved	os-rename otherwise output overlay page page-bot[tom] page-num[ber] page-top param[eter] password-field pause pdbname
syn keyword ProgressReserved	persist[ent] pixels preproc[ess] privileges proc-ha[ndle] proc-st[atus] procedure-call-type process profiler program-name progress
syn keyword ProgressReserved	prompt[-for] promsgs propath provers[ion] publish put put-byte put-key-val[ue] putbyte query query-tuning quit r-index
syn keyword ProgressReserved	rcode-info[rmation] read-available read-exact-num readkey recid record-len[gth] rect[angle] release repeat reposition retain retry return
syn keyword ProgressReserved	return-val[ue] revert revoke row-created row-deleted row-modified row-unmodified run save sax-comple[te] sax-parser-error
syn keyword ProgressReserved	sax-running sax-uninitialized sax-write-begin sax-write-complete sax-write-content sax-write-element sax-write-error
syn keyword ProgressReserved	sax-write-idle sax-write-tag schema screen screen-io screen-lines scroll sdbname search search-self search-target security-policy
syn keyword ProgressReserved	seek select self session set set-attr-call-type setuser[id] share[-lock] shared show-stat[s] skip some source-procedure
syn keyword ProgressReserved	space status stream stream-handle stream-io string-xref subscribe super system-dialog table table-handle target-procedure
syn keyword ProgressReserved	term[inal] text text-cursor text-seg[-grow] then this-object this-procedure time title to today top-only trans[action] trigger
syn keyword ProgressReserved	triggers trim true underl[ine] undo unform[atted] union unique unix unless-hidden unsubscribe up update use-index use-revvideo
syn keyword ProgressReserved	use-underline user[id] using value values view view-as wait-for web-con[text] when where while window window-delayed-min[imize]
syn keyword ProgressReserved	window-maxim[ized] window-minim[ized] window-normal with work-tab[le] workfile write xcode xcode-session-key xref xref-xml yes

" Strings. Handles embedded quotes.
" Note that, for some reason, Progress doesn't use the backslash, "\"
" as the escape character; it uses tilde, "~".
syn region ProgressString matchgroup=ProgressQuote start=+"+ end=+"+ skip=+\~'\|\~\~\|\~"+ contains=@Spell
syn region ProgressString matchgroup=ProgressQuote start=+'+ end=+'+ skip=+\~'\|\~\~\|\~"+ contains=@Spell

syn match  ProgressIdentifier		"\<[a-zA-Z_][a-zA-Z0-9_]*\>()"

" syn match  ProgressDelimiter		"()"

syn match  ProgressMatrixDelimiter	"[][]"
" If you prefer you can highlight the range:
"syn match  ProgressMatrixDelimiter	"[\d\+\.\.\d\+]"

syn match  ProgressNumber		"\<\-\=\d\+\(u\=l\=\|lu\|f\)\>"
syn match  ProgressByte			"\$[0-9a-fA-F]\+"

" More values: Logicals, and Progress's unknown value, ?.
syn match   ProgressNumber				"?"
syn keyword ProgressNumber		true false yes no

" If you don't like tabs:
syn match ProgressShowTab "\t"

" If you don't like white space on the end of lines, uncomment this:
" syn match   ProgressSpaceError "\s\+$"

syn region ProgressComment		start="/\*"  end="\*/" contains=ProgressComment,ProgressTodo,ProgressDebug,@Spell
syn region ProgressInclude		start="^[ 	]*[{]" end="[}]" contains=ProgressPreProc,ProgressOperator,ProgressString,ProgressComment
syn region ProgressPreProc		start="&" end="\>" contained

" This next line works reasonably well.
" syn match ProgressOperator        "[!;|)(:.><+*=-]"
"
" Progress allows a '-' to be part of an identifier.  To be considered
" the subtraction/negation operation operator it needs a non-word
" character on either side.  Also valid are cases where the minus
" operation appears at the beginning or end of a line.
" This next line trips up on "no-undo" etc.
" syn match ProgressOperator    "[!;|)(:.><+*=]\|\W-\W\|^-\W\|\W-$"
syn match ProgressOperator      "[!;|)(:.><+*=]\|\s-\s\|^-\s\|\s-$"

syn keyword ProgressOperator	<= <> >=
syn keyword ProgressOperator	abs[olute] accelerator accept-changes accept-row-changes across active actor add-buffer add-calc-col[umn]
syn keyword ProgressOperator	add-columns-from add-events-proc[edure] add-fields-from add-first add-header-entry add-index-field add-interval add-last
syn keyword ProgressOperator	add-like-col[umn] add-like-field add-like-index add-new-field add-new-index add-rel[ation] add-schema-location add-source-buffer
syn keyword ProgressOperator	add-super-proc[edure] adm-data advise after-buffer after-rowid after-table alert-box allow-column-searching allow-replication alternate-key
syn keyword ProgressOperator	always-on-top ansi-only anywhere append append-child appl-alert[-boxes] appl-context-id application apply-callback appserver-info
syn keyword ProgressOperator	appserver-password appserver-userid array-m[essage] ask-overwrite assembly async-request-count async-request-handle attach-data-source
syn keyword ProgressOperator	attached-pairlist attach attribute-names audit-enabled audit-event-context authentication-failed auto-comp[letion] auto-delete
syn keyword ProgressOperator	auto-delete-xml auto-end-key auto-endkey auto-go auto-ind[ent] auto-resize auto-synchronize auto-val[idate] auto-z[ap] automatic
syn keyword ProgressOperator	available-formats ave[rage] avg backward[s] base-ade base-key basic-logging batch[-mode] batch-size before-buffer before-rowid
syn keyword ProgressOperator	before-table begin-event-group bgc[olor] binary bind bind-where blob block-iteration-display border-b[ottom-chars]
syn keyword ProgressOperator	border-bottom-p[ixels] border-l[eft-chars] border-left-p[ixels] border-r[ight-chars] border-right-p[ixels] border-t[op-chars]
syn keyword ProgressOperator	border-top-p[ixels] both bottom box box-select[able] browse buffer buffer-chars buffer-create buffer-delete buffer-field buffer-handle
syn keyword ProgressOperator	buffer-lines buffer-n[ame] buffer-releas[e] buffer-validate buffer-value button[s] by-reference by-value byte bytes-read
syn keyword ProgressOperator	bytes-written cache cache-size call-name call-type can-crea[te] can-dele[te] can-query can-read can-set can-writ[e] cancel-break
syn keyword ProgressOperator	cancel-button cancel-requests cancelled caps careful-paint catch cdecl chained char[acter] character_length charset checked
syn keyword ProgressOperator	child-buffer child-num choose class class-type clear-appl-context clear-log clear-select[ion] clear-sort-arrow[s]
syn keyword ProgressOperator	client-connection-id client-principal client-tty client-type client-workstation clob clone-node close close-log code codepage
syn keyword ProgressOperator	codepage-convert col-of collate colon-align[ed] color-table column-bgc[olor] column-codepage column-dcolor column-fgc[olor]
syn keyword ProgressOperator	column-font column-movable column-of column-pfc[olor] column-read-only column-resizable column-sc[rolling] com-handle combo-box
syn keyword ProgressOperator	command compare[s] compile complete config-name connect constructor contents context context-help context-help-file
syn keyword ProgressOperator	context-help-id context-pop[up] control-box control-fram[e] convert convert-to-offs[et] copy-dataset copy-sax-attributes
syn keyword ProgressOperator	copy-temp-table count cpcase cpcoll cpint[ernal] cplog cpprint cprcodein cprcodeout cpterm crc-val[ue] create-like
syn keyword ProgressOperator	create-like-sequential create-node create-node-namespace create-result-list-entry create-test-file current-column current-env[ironment]
syn keyword ProgressOperator	current-iteration current-query current-result-row current-row-modified current-value cursor-char cursor-line cursor-offset data-b[ind]
syn keyword ProgressOperator	data-entry-ret[urn] data-rel[ation] data-source data-source-complete-map data-source-modified data-source-rowid data-t[ype] date
syn keyword ProgressOperator	date-f[ormat] day db-references dcolor dde-error dde-i[d] dde-item dde-name dde-topic debu[g] debug-alert
syn keyword ProgressOperator	declare-namespace decrypt default-buffer-handle default-but[ton] default-commit default-ex[tension] default-string
syn keyword ProgressOperator	default-value define-user-event-manager defined delete-char delete-current-row delete-header-entry delete-line delete-node
syn keyword ProgressOperator	delete-result-list-entry delete-selected-row delete-selected-rows descript[ion] deselect-focused-row deselect-rows deselect-selected-row
syn keyword ProgressOperator	destructor detach-data-source dialog-box dir directory disable-auto-zap disable-connections disable-dump-triggers
syn keyword ProgressOperator	disable-load-triggers disabled display-message display-timezone display-t[ype] domain-description domain-name domain-type double
syn keyword ProgressOperator	drag-enabled drop-down drop-down-list drop-target dump dump-logging-now dynamic dynamic-current-value dynamic-next-value echo
syn keyword ProgressOperator	edge[-chars] edge-p[ixels] edit-can-paste edit-can-undo edit-clear edit-copy edit-cut edit-paste edit-undo editor empty
syn keyword ProgressOperator	empty-dataset empty-temp-table enable-connections enabled encoding encrypt encrypt-audit-mac-key encryption-salt end-document
syn keyword ProgressOperator	end-element end-event-group end-file-drop end-key end-user-prompt endkey entered entry-types-list eq error error-col[umn]
syn keyword ProgressOperator	error-object-detail error-row error-stack-trace error-string event-group-id event-procedure-context event-t[ype] events exclusive-id
syn keyword ProgressOperator	execute execution-log exp expand expandable expire explicit export-principal extended extent external extract
syn keyword ProgressOperator	fetch-selected-row fgc[olor] file file-create-d[ate] file-create-t[ime] file-mod-d[ate] file-mod-t[ime] file-name file-off[set]
syn keyword ProgressOperator	file-size file-type filename fill-in fill-mode fill-where-string filled filters final finally find-by-rowid find-current
syn keyword ProgressOperator	find-first find-last find-unique finder first-async[-request] first-buffer first-child first-column first-data-source
syn keyword ProgressOperator	first-dataset first-form first-object first-proc[edure] first-query first-serv[er] first-server-socket first-socket
syn keyword ProgressOperator	first-tab-i[tem] fit-last-column fix-codepage fixed-only flat-button float focused-row focused-row-selected font-table force-file
syn keyword ProgressOperator	fore[ground] foreign-key-hidden form-input form-long-input formatte[d] forward-only forward[s] fragmen[t] frame-spa[cing] frame-x
syn keyword ProgressOperator	frame-y frequency from-cur[rent] full-height[-chars] full-height-p[ixels] full-pathn[ame] full-width[-chars]
syn keyword ProgressOperator	full-width-p[ixels] function ge generate-pbe-key generate-pbe-salt generate-random-key generate-uuid get get-attribute get-attribute-node
syn keyword ProgressOperator	get-binary-data get-bits get-blue[-value] get-browse-col[umn] get-buffer-handle get-byte-order get-bytes get-bytes-available
syn keyword ProgressOperator	get-callback-proc-context get-callback-proc-name get-cgi-list get-cgi-long-value get-cgi-value get-changes get-child get-child-rel[ation