Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Rexx |
| 3 | " Maintainer: Thomas Geulig <geulig@nentec.de> |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 4 | " Last Change: 2012 Sep 14, added support for new ooRexx 4.0 features |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 5 | " URL: http://www.geulig.de/vim/rexx.vim |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 6 | " Special Thanks to Dan Sharp <dwsharp@hotmail.com> and Rony G. Flatscher |
| 7 | " <Rony.Flatscher@wu-wien.ac.at> for comments and additions |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8 | |
| 9 | " For version 5.x: Clear all syntax items |
| 10 | " For version 6.x: Quit when a syntax file was already loaded |
| 11 | if version < 600 |
| 12 | syntax clear |
| 13 | elseif exists("b:current_syntax") |
| 14 | finish |
| 15 | endif |
| 16 | |
| 17 | syn case ignore |
| 18 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 19 | " add to valid identifier chars |
| 20 | setlocal iskeyword+=. |
| 21 | setlocal iskeyword+=! |
| 22 | setlocal iskeyword+=? |
| 23 | |
| 24 | " ---rgf, position important: must be before comments etc. ! |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 25 | syn match rexxOperator "[=|\/\\\+\*\[\],;:<>&\~%\-]" |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 26 | |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 27 | " rgf syn match rexxIdentifier "\<[a-zA-Z\!\?_]\([a-zA-Z0-9._?!]\)*\>" |
| 28 | syn match rexxIdentifier "\<\K\k*\>" |
| 29 | syn match rexxEnvironmentSymbol "\<\.\k\+\>" |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 30 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 31 | " A Keyword is the first symbol in a clause. A clause begins at the start |
| 32 | " of a line or after a semicolon. THEN, ELSE, OTHERWISE, and colons are always |
| 33 | " followed by an implied semicolon. |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 34 | syn match rexxClause "\(^\|;\|:\|then \|else \|when \|otherwise \)\s*\S*" contains=ALLBUT,rexxParse2,rexxRaise2,rexxForward2 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 35 | |
| 36 | " Considered keywords when used together in a phrase and begin a clause |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 37 | syn match rexxParse "\<parse\s*\(\(upper\|lower\|caseless\)\s*\)\?\(arg\|linein\|pull\|source\|var\|\<value\>\|version\)\>" containedin=rexxClause contains=rexxParse2 |
| 38 | syn match rexxParse2 "\<with\>" containedin=rexxParse |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 39 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 40 | syn match rexxKeyword contained "\<numeric \(digits\|form \(scientific\|engineering\|value\)\|fuzz\)\>" |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 41 | syn match rexxKeyword contained "\<\(address\|trace\)\( value\)\?\>" |
| 42 | syn match rexxKeyword contained "\<procedure\(\s*expose\)\?\>" |
| 43 | |
| 44 | syn match rexxKeyword contained "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\(\s\+forever\)\?\>" |
| 45 | syn match rexxKeyword contained "\<use\>\s*\(strict\s*\)\?\<arg\>" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 46 | |
| 47 | " Another keyword phrase, separated to aid highlighting in rexxFunction |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 48 | syn match rexxRegularCallSignal contained "\<\(call\|signal\)\s\(\s*on\>\|\s*off\>\)\@!\(\k\+\ze\|\ze(\)\(\s*\|;\|$\|(\)" |
| 49 | syn region rexxLabel contained start="\<\(call\|signal\)\>\s*\zs\(\k*\|(\)" end="\ze\(\s*\|;\|$\|(\)" containedin=rexxRegularCallSignal |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 50 | |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 51 | syn match rexxExceptionHandling contained "\<\(call\|signal\)\>\s\+\<\(on\|off\)\>.*\(;\|$\)" contains=rexxComment |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 52 | |
| 53 | " hilite label given after keyword "name" |
| 54 | syn match rexxLabel "name\s\+\zs\k\+\ze" containedin=rexxExceptionHandling |
| 55 | " hilite condition name (serves as label) |
| 56 | syn match rexxLabel "\<\(call\|signal\)\>\s\+\<\(on\|off\)\>\s*\zs\k\+\ze\s*\(;\|$\)" containedin=rexxExceptionHandling |
| 57 | " user exception handling, hilite user defined name |
| 58 | syn region rexxLabel contained start="user\s\+\zs\k" end="\ze\(\s\|;\|$\)" containedin=rexxExceptionHandling |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 59 | |
| 60 | " Considered keywords when they begin a clause |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 61 | syn match rexxKeywordStatements "\<\(arg\|catch\|do\|drop\|end\|exit\|expose\|finally\|forward\|if\|interpret\|iterate\|leave\|loop\|nop\)\>" |
| 62 | syn match rexxKeywordStatements "\<\(options\|pull\|push\|queue\|raise\|reply\|return\|say\|select\|trace\)\>" |
| 63 | |
| 64 | " Conditional keywords starting a new statement |
| 65 | syn match rexxConditional "\<\(then\|else\|when\|otherwise\)\(\s*\|;\|\_$\|\)\>" contains=rexxKeywordStatements |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 66 | |
| 67 | " Conditional phrases |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 68 | syn match rexxLoopKeywords "\<\(to\|by\|for\|until\|while\|over\)\>" containedin=doLoopSelectLabelRegion |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 69 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 70 | " must be after Conditional phrases! |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 71 | syn match doLoopSelectLabelRegion "\<\(do\|loop\|select\)\>\s\+\(label\s\+\)\?\(\s\+\k\+\s\+\zs\<over\>\)\?\k*\(\s\+forever\)\?\(\s\|;\|$\)" contains=doLoopSelectLabelRegion,rexxStartValueAssignment,rexxLoopKeywords |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 72 | |
| 73 | " color label's name |
| 74 | syn match rexxLabel2 "\<\(do\|loop\|select\)\>\s\+label\s\+\zs\k*\ze" containedin=doLoopSelectLabelRegion |
| 75 | |
| 76 | " make sure control variable is normal |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 77 | " TODO: re-activate ? |
| 78 | "rgf syn match rexxControlVariable "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\s\+\<over\>" containedin=doLoopSelectLabelRegion |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 79 | |
| 80 | " make sure control variable assignment is normal |
| 81 | syn match rexxStartValueAssignment "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\(=.*\)\?\s\+\<to\>" containedin=doLoopSelectLabelRegion |
| 82 | |
| 83 | " highlight label name |
| 84 | syn match endIterateLeaveLabelRegion "\<\(end\|leave\|iterate\)\>\(\s\+\K\k*\)" contains=rexxLabel2 |
| 85 | syn match rexxLabel2 "\<\(end\|leave\|iterate\)\>\s\+\zs\k*\ze" containedin=endIterateLeaveLabelRegion |
| 86 | |
| 87 | " Guard statement |
| 88 | syn match rexxGuard "\(^\|;\|:\)\s*\<guard\>\s\+\<\(on\|off\)\>" |
| 89 | |
| 90 | " Trace statement |
| 91 | syn match rexxTrace "\(^\|;\|:\)\s*\<trace\>\s\+\<\K\k*\>" |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 92 | |
| 93 | " Raise statement |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 94 | " syn match rexxRaise "\(^\|;\|:\)\s\+\<raise\>\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise2 |
| 95 | syn match rexxRaise "\(^\|;\|:\)\s*\<raise\>\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise2 |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 96 | syn match rexxRaise2 "\<\(additional\|array\|description\|exit\|propagate\|return\)\>" containedin=rexxRaise |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 97 | |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 98 | " Forward statement |
| 99 | syn match rexxForward "\(^\|;\|:\)\<forward\>\s*" contains=rexxForward2 |
| 100 | syn match rexxForward2 "\<\(arguments\|array\|continue\|message\|class\|to\)\>" contained |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 101 | |
| 102 | " Functions/Procedures |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 103 | syn match rexxFunction "\<\<[a-zA-Z\!\?_]\k*\>("me=e-1 |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 104 | syn match rexxFunction "[()]" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 105 | |
| 106 | " String constants |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 107 | syn region rexxString start=+"+ skip=+""+ end=+"\(x\|b\)\?+ oneline |
| 108 | syn region rexxString start=+'+ skip=+''+ end=+'\(x\|b\)\?+ oneline |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 109 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 110 | syn region rexxParen transparent start='(' end=')' contains=ALLBUT,rexxParenError,rexxTodo,rexxLabel,rexxKeyword |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 111 | " Catch errors caused by wrong parenthesis |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 112 | syn match rexxParenError ")" |
| 113 | syn match rexxInParen "[\\[\\]{}]" |
| 114 | |
| 115 | " Comments |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 116 | syn region rexxComment start="/\*" end="\*/" contains=rexxTodo,rexxComment |
| 117 | syn match rexxCommentError "\*/" |
| 118 | syn region rexxLineComment start="--" end="\_$" oneline |
| 119 | |
| 120 | " Highlight User Labels |
| 121 | " check for labels between comments, labels stated in a statement in the middle of a line |
| 122 | syn match rexxLabel "\(\_^\|;\)\s*\(\/\*.*\*\/\)*\s*\k\+\s*\(\/\*.*\*\/\)*\s*:"me=e-1 contains=rexxTodo,rexxComment |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 123 | |
| 124 | syn keyword rexxTodo contained TODO FIXME XXX |
| 125 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 126 | " ooRexx messages |
| 127 | syn region rexxMessageOperator start="\(\~\|\~\~\)" end="\(\S\|\s\)"me=e-1 |
| 128 | syn match rexxMessage "\(\~\|\~\~\)\s*\<\.*[a-zA-Z]\([a-zA-Z0-9._?!]\)*\>" contains=rexxMessageOperator |
| 129 | |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 130 | " line continuations, take care of (line-)comments after it |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 131 | syn match rexxLineContinue ",\ze\s*\(--.*\|\/\*.*\)*$" |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 132 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 133 | " the following is necessary, otherwise three consecutive dashes will cause it to highlight the first one |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 134 | syn match rexxLineContinue "-\ze-\@!\s*\(--.*\|\s*\/\*.*\)\?$" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 135 | |
| 136 | " Special Variables |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 137 | syn keyword rexxSpecialVariable sigl rc result self super |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 138 | syn keyword rexxSpecialVariable .environment .error .input .local .methods .output .rs .stderr .stdin .stdout .stdque |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 139 | |
| 140 | " Constants |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 141 | syn keyword rexxConst .true .false .nil .endOfLine .line .context |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 142 | |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 143 | " Rexx numbers |
| 144 | " int like number |
| 145 | syn match rexxNumber '\d\+' contained |
| 146 | syn match rexxNumber '[-+]\s*\d\+' contained |
| 147 | |
| 148 | " Floating point number with decimal |
| 149 | syn match rexxNumber '\d\+\.\d*' contained |
| 150 | syn match rexxNumber '[-+]\s*\d\+\.\d*' contained |
| 151 | |
| 152 | " Floating point like number with E |
| 153 | syn match rexxNumber '[-+]\s*\d*[eE][\-+]\d\+' contained |
| 154 | syn match rexxNumber '\d*[eE][\-+]\d\+' contained |
| 155 | |
| 156 | " Floating point like number with E and decimal point (+,-) |
| 157 | syn match rexxNumber '[-+]\s*\d*\.\d*[eE][\-+]\d\+' contained |
| 158 | syn match rexxNumber '\d*\.\d*[eE][\-+]\d\+' contained |
| 159 | |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 160 | |
| 161 | " ooRexx builtin classes (as of version 3.2.0, fall 2007), first define dot to be o.k. in keywords |
| 162 | syn keyword rexxBuiltinClass .Alarm .ArgUtil .Array .Bag .CaselessColumnComparator |
| 163 | syn keyword rexxBuiltinClass .CaselessComparator .CaselessDescendingComparator .CircularQueue |
| 164 | syn keyword rexxBuiltinClass .Class .Collection .ColumnComparator .Comparable .Comparator |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 165 | syn keyword rexxBuiltinClass .DateTime .DescendingComparator .Directory .File .InputOutputStream |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 166 | syn keyword rexxBuiltinClass .InputStream .InvertingComparator .List .MapCollection |
| 167 | syn keyword rexxBuiltinClass .Message .Method .Monitor .MutableBuffer .Object |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 168 | syn keyword rexxBuiltinClass .OrderedCollection .OutputStream .Package .Properties .Queue |
| 169 | syn keyword rexxBuiltinClass .RegularExpression .Relation .RexxContext .RexxQueue .Routine |
| 170 | syn keyword rexxBuiltinClass .Set .SetCollection .Stem .Stream |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 171 | syn keyword rexxBuiltinClass .StreamSupplier .String .Supplier .Table .TimeSpan |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 172 | |
| 173 | " Windows-only classes |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 174 | syn keyword rexxBuiltinClass .AdvancedControls .AnimatedButton .BaseDialog .ButtonControl |
| 175 | syn keyword rexxBuiltinClass .CategoryDialog .CheckBox .CheckList .ComboBox .DialogControl |
| 176 | syn keyword rexxBuiltinClass .DialogExtensions .DlgArea .DlgAreaU .DynamicDialog |
| 177 | syn keyword rexxBuiltinClass .EditControl .InputBox .IntegerBox .ListBox .ListChoice |
| 178 | syn keyword rexxBuiltinClass .ListControl .MenuObject .MessageExtensions .MultiInputBox |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 179 | syn keyword rexxBuiltinClass .MultiListChoice .OLEObject .OLEVariant |
| 180 | syn keyword rexxBuiltinClass .PasswordBox .PlainBaseDialog .PlainUserDialog |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 181 | syn keyword rexxBuiltinClass .ProgressBar .ProgressIndicator .PropertySheet .RadioButton |
| 182 | syn keyword rexxBuiltinClass .RcDialog .ResDialog .ScrollBar .SingleSelection .SliderControl |
| 183 | syn keyword rexxBuiltinClass .StateIndicator .StaticControl .TabControl .TimedMessage |
| 184 | syn keyword rexxBuiltinClass .TreeControl .UserDialog .VirtualKeyCodes .WindowBase |
| 185 | syn keyword rexxBuiltinClass .WindowExtensions .WindowObject .WindowsClassesBase .WindowsClipboard |
| 186 | syn keyword rexxBuiltinClass .WindowsEventLog .WindowsManager .WindowsProgramManager .WindowsRegistry |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 187 | |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 188 | " BSF4ooRexx classes |
| 189 | syn keyword rexxBuiltinClass .BSF .bsf.dialog .bsf_proxy |
| 190 | syn keyword rexxBuiltinClass .UNO .UNO_ENUM .UNO_CONSTANTS .UNO_PROPERTIES |
| 191 | |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 192 | " ooRexx directives, ---rgf location important, otherwise directives in top of file not matched! |
| 193 | syn region rexxClassDirective start="::\s*class\s*"ms=e+1 end="\ze\(\s\|;\|$\)" |
| 194 | syn region rexxMethodDirective start="::\s*method\s*"ms=e+1 end="\ze\(\s\|;\|$\)" |
| 195 | syn region rexxRequiresDirective start="::\s*requires\s*"ms=e+1 end="\ze\(\s\|;\|$\)" |
| 196 | syn region rexxRoutineDirective start="::\s*routine\s*"ms=e+1 end="\ze\(\s\|;\|$\)" |
| 197 | syn region rexxAttributeDirective start="::\s*attribute\s*"ms=e+1 end="\ze\(\s\|;\|$\)" |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 198 | " rgf, 2012-09-09 |
| 199 | syn region rexxOptionsDirective start="::\s*options\s*"ms=e+1 end="\ze\(\s\|;\|$\)" |
| 200 | syn region rexxConstantDirective start="::\s*constant\s*"ms=e+1 end="\ze\(\s\|;\|$\)" |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 201 | |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 202 | syn region rexxDirective start="\(^\|;\)\s*::\s*\w\+" end="\($\|;\)" contains=rexxString,rexxNumber,rexxComment,rexxLineComment,rexxClassDirective,rexxMethodDirective,rexxRoutineDirective,rexxRequiresDirective,rexxAttributeDirective,rexxOptionsDirective,rexxConstantDirective keepend |
| 203 | |
| 204 | syn match rexxOptionsDirective2 "\<\(digits\|form\|fuzz\|trace\)\>" containedin = rexxOptionsDirective3 |
| 205 | syn region rexxOptionsDirective3 start="\(^\|;\)\s*::\s*options\s"ms=e+1 end="\($\|;\)" contains=rexxString,rexxNumber,rexxVariable,rexxComment,rexxLineComment containedin = rexxDirective |
| 206 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 207 | |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 208 | syn region rexxVariable start="\zs\<\(\.\)\@!\K\k\+\>\ze\s*\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)" end="\(\_$\|.\)"me=e-1 |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 209 | syn match rexxVariable "\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)\s*\zs\K\k*\ze" |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 210 | |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 211 | " rgf, 2007-07-22: unfortunately, the entire region is colored (not only the |
| 212 | " patterns), hence useless (vim 7.0)! (syntax-docs hint that that should work) |
| 213 | " attempt: just colorize the parenthesis in matching colors, keep content |
| 214 | " transparent to keep the formatting already done to it! |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 215 | " TODO: test on 7.3 |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 216 | " syn region par1 matchgroup=par1 start="(" matchgroup=par1 end=")" transparent contains=par2 |
| 217 | " syn region par2 matchgroup=par2 start="(" matchgroup=par2 end=")" transparent contains=par3 contained |
| 218 | " syn region par3 matchgroup=par3 start="(" matchgroup=par3 end=")" transparent contains=par4 contained |
| 219 | " syn region par4 matchgroup=par4 start="(" matchgroup=par4 end=")" transparent contains=par5 contained |
| 220 | " syn region par5 matchgroup=par5 start="(" matchgroup=par5 end=")" transparent contains=par1 contained |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 221 | |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 222 | " this will colorize the entire region, removing any colorizing already done! |
| 223 | " syn region par1 matchgroup=par1 start="(" end=")" contains=par2 |
| 224 | " syn region par2 matchgroup=par2 start="(" end=")" contains=par3 contained |
| 225 | " syn region par3 matchgroup=par3 start="(" end=")" contains=par4 contained |
| 226 | " syn region par4 matchgroup=par4 start="(" end=")" contains=par5 contained |
| 227 | " syn region par5 matchgroup=par5 start="(" end=")" contains=par1 contained |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 228 | |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 229 | hi par1 ctermfg=red guifg=red "guibg=grey |
| 230 | hi par2 ctermfg=blue guifg=blue "guibg=grey |
| 231 | hi par3 ctermfg=darkgreen guifg=darkgreen "guibg=grey |
| 232 | hi par4 ctermfg=darkyellow guifg=darkyellow "guibg=grey |
| 233 | hi par5 ctermfg=darkgrey guifg=darkgrey "guibg=grey |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 234 | |
| 235 | " line continuation (trailing comma or single dash) |
| 236 | syn sync linecont "\(,\|-\ze-\@!\)\ze\s*\(--.*\|\/\*.*\)*$" |
| 237 | |
| 238 | " if !exists("rexx_minlines") |
| 239 | " let rexx_minlines = 500 |
| 240 | " endif |
| 241 | " exec "syn sync ccomment rexxComment minlines=" . rexx_minlines |
| 242 | |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 243 | " always scan from start, PCs have long become to be powerful enough for that |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 244 | exec "syn sync fromstart" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 245 | |
| 246 | " Define the default highlighting. |
| 247 | " For version 5.7 and earlier: only when not done already |
| 248 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 249 | if version >= 508 || !exists("did_rexx_syn_inits") |
| 250 | if version < 508 |
| 251 | let did_rexx_syn_inits = 1 |
| 252 | command -nargs=+ HiLink hi link <args> |
| 253 | else |
| 254 | command -nargs=+ HiLink hi def link <args> |
| 255 | endif |
| 256 | |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 257 | " make binary and hex strings stand out |
| 258 | hi rexxStringConstant term=bold,underline ctermfg=5 cterm=bold guifg=darkMagenta gui=bold |
| 259 | |
| 260 | HiLink rexxLabel2 Function |
| 261 | HiLink doLoopSelectLabelRegion rexxKeyword |
| 262 | HiLink endIterateLeaveLabelRegion rexxKeyword |
| 263 | HiLink rexxLoopKeywords rexxKeyword " Todo |
| 264 | |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 265 | HiLink rexxNumber Normal "DiffChange |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 266 | " HiLink rexxIdentifier DiffChange |
| 267 | |
| 268 | HiLink rexxRegularCallSignal Statement |
| 269 | HiLink rexxExceptionHandling Statement |
| 270 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 271 | HiLink rexxLabel Function |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 272 | HiLink rexxCharacter Character |
| 273 | HiLink rexxParenError rexxError |
| 274 | HiLink rexxInParen rexxError |
| 275 | HiLink rexxCommentError rexxError |
| 276 | HiLink rexxError Error |
| 277 | HiLink rexxKeyword Statement |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 278 | HiLink rexxKeywordStatements Statement |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 279 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 280 | HiLink rexxFunction Function |
| 281 | HiLink rexxString String |
| 282 | HiLink rexxComment Comment |
| 283 | HiLink rexxTodo Todo |
| 284 | HiLink rexxSpecialVariable Special |
| 285 | HiLink rexxConditional rexxKeyword |
| 286 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 287 | HiLink rexxOperator Operator |
| 288 | HiLink rexxMessageOperator rexxOperator |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 289 | HiLink rexxLineComment Comment |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 290 | |
| 291 | HiLink rexxLineContinue WildMenu |
| 292 | |
| 293 | HiLink rexxDirective rexxKeyword |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 294 | HiLink rexxClassDirective Type |
| 295 | HiLink rexxMethodDirective rexxFunction |
| 296 | HiLink rexxAttributeDirective rexxFunction |
| 297 | HiLink rexxRequiresDirective Include |
| 298 | HiLink rexxRoutineDirective rexxFunction |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 299 | |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 300 | " rgf, 2012-09-09 |
| 301 | HiLink rexxOptionsDirective rexxFunction |
| 302 | HiLink rexxOptionsDirective2 rexxOptionsDirective |
| 303 | HiLink rexxOptionsDirective3 Normal " rexxOptionsDirective |
| 304 | |
| 305 | HiLink rexxConstantDirective rexxFunction |
| 306 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 307 | HiLink rexxConst Constant |
| 308 | HiLink rexxTypeSpecifier Type |
| 309 | HiLink rexxBuiltinClass rexxTypeSpecifier |
| 310 | |
| 311 | HiLink rexxEnvironmentSymbol rexxConst |
| 312 | HiLink rexxMessage rexxFunction |
| 313 | |
| 314 | HiLink rexxParse rexxKeyword |
| 315 | HiLink rexxParse2 rexxParse |
| 316 | |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 317 | HiLink rexxGuard rexxKeyword |
| 318 | HiLink rexxTrace rexxKeyword |
| 319 | |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 320 | HiLink rexxRaise rexxKeyword |
| 321 | HiLink rexxRaise2 rexxRaise |
| 322 | |
| 323 | HiLink rexxForward rexxKeyword |
| 324 | HiLink rexxForward2 rexxForward |
| 325 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 326 | delcommand HiLink |
| 327 | endif |
| 328 | |
| 329 | let b:current_syntax = "rexx" |
| 330 | |
| 331 | "vim: ts=8 |