" Filename extensions: *.p (collides with Pascal),
" *.i (collides with assembler)
" *.w (collides with cweb)
" Maintainer: Philip Uren <philuSPAX@ieee.org> Remove SPAX spam block
" Contributors: Chris Ruprecht <chris@ruprecht.org>
" Philip Uren <philu@computer.org>
" Mikhail Kuperblum <mikhail@whasup.com>
" John Florian <jflorian@voyager.net>
" Version: 11
" Last Change: May 11 2012
" For version 5.x: Clear all syntax item
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
if version >= 600
setlocal iskeyword=@,48-57,_,-,!,#,$,%
else
set iskeyword=@,48-57,_,-,!,#,$,%
endif
" 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 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 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=+\~'\|\~\~+
syn region ProgressString matchgroup=ProgressQuote start=+'+ end=+'+ skip=+\~'\|\~\~+
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
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 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 last-socket last-tab-i[tem] lc le leading left left-align[ed] left-trim length line list-events list-item-pairs list-items
syn keyword ProgressOperator multiple-key multitasking-interval must-exist must-understand name namespace-prefix namespace-uri native ne needs-appserver-prompt
syn keyword ProgressOperator separator-fgc[olor] separators server server-connection-bo[und] server-connection-bound-re[quest] server-connection-co[ntext]
syn keyword ProgressOperator set-sort-arrow set-wait[-state] short show-in-task[bar] side-label-h[andle] side-lab[els] silent simple single single-character size
syn keyword ProgressOperator write-cdata write-characters write-comment write-data-element write-empty-element write-entity-ref write-external-dtd
syn keyword ProgressOperator write-fragment write-message write-processing-instruction write-status write-xml write-xmlschema x x-document x-noderef x-of
syn keyword ProgressOperator xml-data-type xml-node-name xml-node-type xml-schema-pat[h] xml-suppress-namespace-processing y y-of year year-offset yes-no