" Vim syntax file
" Language: Rexx
" Maintainer: Thomas Geulig
" Last Change: 2012 Sep 14, added support for new ooRexx 4.0 features
" URL: http://www.geulig.de/vim/rexx.vim
" Special Thanks to Dan Sharp and Rony G. Flatscher
" for comments and additions
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syn case ignore
" add to valid identifier chars
setlocal iskeyword+=.
setlocal iskeyword+=!
setlocal iskeyword+=?
" ---rgf, position important: must be before comments etc. !
syn match rexxOperator "[=|\/\\\+\*\[\],;:<>&\~%\-]"
" rgf syn match rexxIdentifier "\<[a-zA-Z\!\?_]\([a-zA-Z0-9._?!]\)*\>"
syn match rexxIdentifier "\<\K\k*\>"
syn match rexxEnvironmentSymbol "\<\.\k\+\>"
" A Keyword is the first symbol in a clause. A clause begins at the start
" of a line or after a semicolon. THEN, ELSE, OTHERWISE, and colons are always
" followed by an implied semicolon.
syn match rexxClause "\(^\|;\|:\|then \|else \|when \|otherwise \)\s*\S*" contains=ALLBUT,rexxParse2,rexxRaise2,rexxForward2
" Considered keywords when used together in a phrase and begin a clause
syn match rexxParse "\\|version\)\>" containedin=rexxClause contains=rexxParse2
syn match rexxParse2 "\" containedin=rexxParse
syn match rexxKeyword contained "\"
syn match rexxKeyword contained "\<\(address\|trace\)\( value\)\?\>"
syn match rexxKeyword contained "\"
syn match rexxKeyword contained "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\(\s\+forever\)\?\>"
syn match rexxKeyword contained "\