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