Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
rexx.vim319 linesDownload Raw Back to syntax
1" Vim syntax file2" Language:	Rexx3" Maintainer:	Thomas Geulig <geulig@nentec.de>4" Last Change:  2012 Sep 14, added support for new ooRexx 4.0 features5" URL:		http://www.geulig.de/vim/rexx.vim6" Special Thanks to Dan Sharp <dwsharp@hotmail.com> and Rony G. Flatscher7" <Rony.Flatscher@wu-wien.ac.at> for comments and additions8 9" quit when a syntax file was already loaded10if exists("b:current_syntax")11  finish12endif13 14syn case ignore15 16" add to valid identifier chars17setlocal iskeyword+=.18setlocal iskeyword+=!19setlocal iskeyword+=?20 21" ---rgf, position important: must be before comments etc. !22syn match rexxOperator "[=|\/\\\+\*\[\],;:<>&\~%\-]"23 24" rgf syn match rexxIdentifier        "\<[a-zA-Z\!\?_]\([a-zA-Z0-9._?!]\)*\>"25syn match rexxIdentifier        "\<\K\k*\>"26syn match rexxEnvironmentSymbol "\<\.\k\+\>"27 28" A Keyword is the first symbol in a clause.  A clause begins at the start29" of a line or after a semicolon.  THEN, ELSE, OTHERWISE, and colons are always30" followed by an implied semicolon.31syn match rexxClause "\(^\|;\|:\|then \|else \|when \|otherwise \)\s*\S*" contains=ALLBUT,rexxParse2,rexxRaise2,rexxForward232 33" Considered keywords when used together in a phrase and begin a clause34syn match rexxParse "\<parse\s*\(\(upper\|lower\|caseless\)\s*\)\?\(arg\|linein\|pull\|source\|var\|\<value\>\|version\)\>" containedin=rexxClause contains=rexxParse235syn match rexxParse2 "\<with\>" containedin=rexxParse36 37syn match rexxKeyword contained "\<numeric \(digits\|form \(scientific\|engineering\|value\)\|fuzz\)\>"38syn match rexxKeyword contained "\<\(address\|trace\)\( value\)\?\>"39syn match rexxKeyword contained "\<procedure\(\s*expose\)\?\>"40 41syn match rexxKeyword contained "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\(\s\+forever\)\?\>"42syn match rexxKeyword contained "\<use\>\s*\(strict\s*\)\?\<arg\>"43 44" Another keyword phrase, separated to aid highlighting in rexxFunction45syn match rexxRegularCallSignal contained "\<\(call\|signal\)\s\(\s*on\>\|\s*off\>\)\@!\(\k\+\ze\|\ze(\)\(\s*\|;\|$\|(\)"46syn region rexxLabel contained start="\<\(call\|signal\)\>\s*\zs\(\k*\|(\)" end="\ze\(\s*\|;\|$\|(\)" containedin=rexxRegularCallSignal47 48syn match rexxExceptionHandling contained "\<\(call\|signal\)\>\s\+\<\(on\|off\)\>.*\(;\|$\)" contains=rexxComment49 50" hilite label given after keyword "name"51syn match rexxLabel "name\s\+\zs\k\+\ze" containedin=rexxExceptionHandling52" hilite condition name (serves as label)53syn match rexxLabel "\<\(call\|signal\)\>\s\+\<\(on\|off\)\>\s*\zs\k\+\ze\s*\(;\|$\)" containedin=rexxExceptionHandling54" user exception handling, hilite user defined name55syn region rexxLabel contained start="user\s\+\zs\k" end="\ze\(\s\|;\|$\)" containedin=rexxExceptionHandling56 57" Considered keywords when they begin a clause58syn match rexxKeywordStatements "\<\(arg\|catch\|do\|drop\|end\|exit\|expose\|finally\|forward\|if\|interpret\|iterate\|leave\|loop\|nop\)\>"59syn match rexxKeywordStatements "\<\(options\|pull\|push\|queue\|raise\|reply\|return\|say\|select\|trace\)\>"60 61" Conditional keywords starting a new statement62syn match rexxConditional "\<\(then\|else\|when\|otherwise\)\(\s*\|;\|\_$\|\)\>" contains=rexxKeywordStatements63 64" Conditional phrases65syn match rexxLoopKeywords "\<\(to\|by\|for\|until\|while\|over\)\>" containedin=doLoopSelectLabelRegion66 67" must be after Conditional phrases!68syn match doLoopSelectLabelRegion "\<\(do\|loop\|select\)\>\s\+\(label\s\+\)\?\(\s\+\k\+\s\+\zs\<over\>\)\?\k*\(\s\+forever\)\?\(\s\|;\|$\)" contains=doLoopSelectLabelRegion,rexxStartValueAssignment,rexxLoopKeywords69 70" color label's name71syn match rexxLabel2 "\<\(do\|loop\|select\)\>\s\+label\s\+\zs\k*\ze" containedin=doLoopSelectLabelRegion72 73" make sure control variable is normal74" TODO: re-activate ?75"rgf syn match rexxControlVariable        "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\s\+\<over\>" containedin=doLoopSelectLabelRegion76 77" make sure control variable assignment is normal78syn match rexxStartValueAssignment       "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\(=.*\)\?\s\+\<to\>" containedin=doLoopSelectLabelRegion79 80" highlight label name81syn match endIterateLeaveLabelRegion "\<\(end\|leave\|iterate\)\>\(\s\+\K\k*\)" contains=rexxLabel282syn match rexxLabel2 "\<\(end\|leave\|iterate\)\>\s\+\zs\k*\ze" containedin=endIterateLeaveLabelRegion83 84" Guard statement85syn match rexxGuard "\(^\|;\|:\)\s*\<guard\>\s\+\<\(on\|off\)\>"86 87" Trace statement88syn match rexxTrace "\(^\|;\|:\)\s*\<trace\>\s\+\<\K\k*\>"89 90" Raise statement91" syn match rexxRaise "\(^\|;\|:\)\s\+\<raise\>\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise292syn match rexxRaise "\(^\|;\|:\)\s*\<raise\>\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise293syn match rexxRaise2 "\<\(additional\|array\|description\|exit\|propagate\|return\)\>" containedin=rexxRaise94 95" Forward statement96syn match rexxForward  "\(^\|;\|:\)\<forward\>\s*" contains=rexxForward297syn match rexxForward2 "\<\(arguments\|array\|continue\|message\|class\|to\)\>" contained98 99" Functions/Procedures100syn match rexxFunction 	"\<\<[a-zA-Z\!\?_]\k*\>("me=e-1101syn match rexxFunction "[()]"102 103" String constants104syn region rexxString	start=+"+ skip=+""+ end=+"\(x\|b\)\?+ oneline105syn region rexxString	start=+'+ skip=+''+ end=+'\(x\|b\)\?+ oneline106 107syn region rexxParen transparent start='(' end=')' contains=ALLBUT,rexxParenError,rexxTodo,rexxLabel,rexxKeyword108" Catch errors caused by wrong parenthesis109syn match rexxParenError	 ")"110syn match rexxInParen		"[\\[\\]{}]"111 112" Comments113syn region	rexxComment	start="/\*"	end="\*/" contains=rexxTodo,rexxComment114syn match	rexxCommentError "\*/"115syn region	rexxLineComment	start="--"	end="\_$" oneline116 117" Highlight User Labels118" check for labels between comments, labels stated in a statement in the middle of a line119syn match rexxLabel		 "\(\_^\|;\)\s*\(\/\*.*\*\/\)*\s*\k\+\s*\(\/\*.*\*\/\)*\s*:"me=e-1 contains=rexxTodo,rexxComment120 121syn keyword rexxTodo contained	TODO FIXME XXX122 123" ooRexx messages124syn region rexxMessageOperator start="\(\~\|\~\~\)" end="\(\S\|\s\)"me=e-1125syn match rexxMessage "\(\~\|\~\~\)\s*\<\.*[a-zA-Z]\([a-zA-Z0-9._?!]\)*\>" contains=rexxMessageOperator126 127" line continuations, take care of (line-)comments after it128syn match rexxLineContinue ",\ze\s*\(--.*\|\/\*.*\)*$"129 130" the following is necessary, otherwise three consecutive dashes will cause it to highlight the first one131syn match rexxLineContinue "-\ze-\@!\s*\(--.*\|\s*\/\*.*\)\?$"132 133" Special Variables134syn keyword rexxSpecialVariable  sigl rc result self super135syn keyword rexxSpecialVariable  .environment .error .input .local .methods .output .rs .stderr .stdin .stdout .stdque136 137" Constants138syn keyword rexxConst .true .false .nil .endOfLine .line .context139 140" Rexx numbers141" int like number142syn match rexxNumber '\d\+' contained143syn match rexxNumber '[-+]\s*\d\+' contained144 145" Floating point number with decimal146syn match rexxNumber '\d\+\.\d*' contained147syn match rexxNumber '[-+]\s*\d\+\.\d*' contained148 149" Floating point like number with E150syn match rexxNumber '[-+]\s*\d*[eE][\-+]\d\+' contained151syn match rexxNumber '\d*[eE][\-+]\d\+' contained152 153" Floating point like number with E and decimal point (+,-)154syn match rexxNumber '[-+]\s*\d*\.\d*[eE][\-+]\d\+' contained155syn match rexxNumber '\d*\.\d*[eE][\-+]\d\+' contained156 157 158" ooRexx builtin classes (as of version 3.2.0, fall 2007), first define dot to be o.k. in keywords159syn keyword rexxBuiltinClass .Alarm .ArgUtil .Array .Bag .CaselessColumnComparator160syn keyword rexxBuiltinClass .CaselessComparator .CaselessDescendingComparator .CircularQueue161syn keyword rexxBuiltinClass .Class .Collection .ColumnComparator .Comparable .Comparator162syn keyword rexxBuiltinClass .DateTime .DescendingComparator .Directory .File .InputOutputStream163syn keyword rexxBuiltinClass .InputStream .InvertingComparator .List .MapCollection164syn keyword rexxBuiltinClass .Message .Method .Monitor .MutableBuffer .Object165syn keyword rexxBuiltinClass .OrderedCollection .OutputStream .Package .Properties .Queue166syn keyword rexxBuiltinClass .RegularExpression .Relation .RexxContext .RexxQueue .Routine167syn keyword rexxBuiltinClass .Set .SetCollection .Stem .Stream168syn keyword rexxBuiltinClass .StreamSupplier .String .Supplier .Table .TimeSpan169 170" Windows-only classes171syn keyword rexxBuiltinClass .AdvancedControls .AnimatedButton .BaseDialog .ButtonControl172syn keyword rexxBuiltinClass .CategoryDialog .CheckBox .CheckList .ComboBox .DialogControl173syn keyword rexxBuiltinClass .DialogExtensions .DlgArea .DlgAreaU .DynamicDialog174syn keyword rexxBuiltinClass .EditControl .InputBox .IntegerBox .ListBox .ListChoice175syn keyword rexxBuiltinClass .ListControl .MenuObject .MessageExtensions .MultiInputBox176syn keyword rexxBuiltinClass .MultiListChoice .OLEObject .OLEVariant177syn keyword rexxBuiltinClass .PasswordBox .PlainBaseDialog .PlainUserDialog178syn keyword rexxBuiltinClass .ProgressBar .ProgressIndicator .PropertySheet .RadioButton179syn keyword rexxBuiltinClass .RcDialog .ResDialog .ScrollBar .SingleSelection .SliderControl180syn keyword rexxBuiltinClass .StateIndicator .StaticControl .TabControl .TimedMessage181syn keyword rexxBuiltinClass .TreeControl .UserDialog .VirtualKeyCodes .WindowBase182syn keyword rexxBuiltinClass .WindowExtensions .WindowObject .WindowsClassesBase .WindowsClipboard183syn keyword rexxBuiltinClass .WindowsEventLog .WindowsManager .WindowsProgramManager .WindowsRegistry184 185" BSF4ooRexx classes186syn keyword rexxBuiltinClass .BSF .bsf.dialog .bsf_proxy187syn keyword rexxBuiltinClass .UNO .UNO_ENUM .UNO_CONSTANTS .UNO_PROPERTIES188 189" ooRexx directives, ---rgf location important, otherwise directives in top of file not matched!190syn region rexxClassDirective     start="::\s*class\s*"ms=e+1    end="\ze\(\s\|;\|$\)"191syn region rexxMethodDirective    start="::\s*method\s*"ms=e+1   end="\ze\(\s\|;\|$\)"192syn region rexxRequiresDirective  start="::\s*requires\s*"ms=e+1 end="\ze\(\s\|;\|$\)"193syn region rexxRoutineDirective   start="::\s*routine\s*"ms=e+1  end="\ze\(\s\|;\|$\)"194syn region rexxAttributeDirective start="::\s*attribute\s*"ms=e+1  end="\ze\(\s\|;\|$\)"195" rgf, 2012-09-09196syn region rexxOptionsDirective   start="::\s*options\s*"ms=e+1  end="\ze\(\s\|;\|$\)"197syn region rexxConstantDirective  start="::\s*constant\s*"ms=e+1  end="\ze\(\s\|;\|$\)"198 199syn region rexxDirective start="\(^\|;\)\s*::\s*\w\+"  end="\($\|;\)" contains=rexxString,rexxNumber,rexxComment,rexxLineComment,rexxClassDirective,rexxMethodDirective,rexxRoutineDirective,rexxRequiresDirective,rexxAttributeDirective,rexxOptionsDirective,rexxConstantDirective keepend200 201syn match rexxOptionsDirective2 "\<\(digits\|form\|fuzz\|trace\)\>" containedin = rexxOptionsDirective3202syn region rexxOptionsDirective3 start="\(^\|;\)\s*::\s*options\s"ms=e+1  end="\($\|;\)" contains=rexxString,rexxNumber,rexxVariable,rexxComment,rexxLineComment containedin = rexxDirective203 204 205syn region rexxVariable start="\zs\<\(\.\)\@!\K\k\+\>\ze\s*\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)" end="\(\_$\|.\)"me=e-1206syn match rexxVariable "\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)\s*\zs\K\k*\ze"207 208" rgf, 2007-07-22: unfortunately, the entire region is colored (not only the209" patterns), hence useless (vim 7.0)! (syntax-docs hint that that should work)210" attempt: just colorize the parenthesis in matching colors, keep content211"          transparent to keep the formatting already done to it!212" TODO: test on 7.3213" syn region par1 matchgroup=par1 start="(" matchgroup=par1 end=")" transparent contains=par2214" syn region par2 matchgroup=par2 start="(" matchgroup=par2 end=")" transparent contains=par3 contained215" syn region par3 matchgroup=par3 start="(" matchgroup=par3 end=")" transparent contains=par4 contained216" syn region par4 matchgroup=par4 start="(" matchgroup=par4 end=")" transparent contains=par5 contained217" syn region par5 matchgroup=par5 start="(" matchgroup=par5 end=")" transparent contains=par1 contained218 219" this will colorize the entire region, removing any colorizing already done!220" syn region par1 matchgroup=par1 start="(" end=")" contains=par2221" syn region par2 matchgroup=par2 start="(" end=")" contains=par3 contained222" syn region par3 matchgroup=par3 start="(" end=")" contains=par4 contained223" syn region par4 matchgroup=par4 start="(" end=")" contains=par5 contained224" syn region par5 matchgroup=par5 start="(" end=")" contains=par1 contained225 226hi par1 ctermfg=red 		guifg=red          "guibg=grey227hi par2 ctermfg=blue 		guifg=blue         "guibg=grey228hi par3 ctermfg=darkgreen 	guifg=darkgreen    "guibg=grey229hi par4 ctermfg=darkyellow	guifg=darkyellow   "guibg=grey230hi par5 ctermfg=darkgrey 	guifg=darkgrey     "guibg=grey231 232" line continuation (trailing comma or single dash)233syn sync linecont "\(,\|-\ze-\@!\)\ze\s*\(--.*\|\/\*.*\)*$"234 235" if !exists("rexx_minlines")236"   let rexx_minlines = 500237" endif238" exec "syn sync ccomment rexxComment minlines=" . rexx_minlines239 240" always scan from start, PCs have long become to be powerful enough for that241exec "syn sync fromstart"242 243" Define the default highlighting.244" Only when an item doesn't have highlighting yet245 246" make binary and hex strings stand out247hi rexxStringConstant term=bold,underline ctermfg=5 cterm=bold guifg=darkMagenta gui=bold248 249hi def link rexxLabel2		Function250hi def link doLoopSelectLabelRegion	rexxKeyword251hi def link endIterateLeaveLabelRegion	rexxKeyword252hi def link rexxLoopKeywords	rexxKeyword " Todo253 254hi def link rexxNumber		Normal "DiffChange255"  hi def link rexxIdentifier		DiffChange256 257hi def link rexxRegularCallSignal	Statement258hi def link rexxExceptionHandling	Statement259 260hi def link rexxLabel		Function261hi def link rexxCharacter		Character262hi def link rexxParenError		rexxError263hi def link rexxInParen		rexxError264hi def link rexxCommentError	rexxError265hi def link rexxError		Error266hi def link rexxKeyword		Statement267hi def link rexxKeywordStatements	Statement268 269hi def link rexxFunction		Function270hi def link rexxString		String271hi def link rexxComment		Comment272hi def link rexxTodo		Todo273hi def link rexxSpecialVariable	Special274hi def link rexxConditional	rexxKeyword275 276hi def link rexxOperator		Operator277hi def link rexxMessageOperator	rexxOperator278hi def link rexxLineComment	Comment279 280hi def link rexxLineContinue	WildMenu281 282hi def link rexxDirective		rexxKeyword283hi def link rexxClassDirective	Type284hi def link rexxMethodDirective	rexxFunction285hi def link rexxAttributeDirective	rexxFunction286hi def link rexxRequiresDirective	Include287hi def link rexxRoutineDirective	rexxFunction288 289" rgf, 2012-09-09290hi def link rexxOptionsDirective	rexxFunction291hi def link rexxOptionsDirective2  rexxOptionsDirective292hi def link rexxOptionsDirective3  Normal " rexxOptionsDirective293 294hi def link rexxConstantDirective	rexxFunction295 296hi def link rexxConst		Constant297hi def link rexxTypeSpecifier	Type298hi def link rexxBuiltinClass	rexxTypeSpecifier299 300hi def link rexxEnvironmentSymbol  rexxConst301hi def link rexxMessage		rexxFunction302 303hi def link rexxParse              rexxKeyword304hi def link rexxParse2             rexxParse305 306hi def link rexxGuard              rexxKeyword307hi def link rexxTrace              rexxKeyword308 309hi def link rexxRaise              rexxKeyword310hi def link rexxRaise2             rexxRaise311 312hi def link rexxForward            rexxKeyword313hi def link rexxForward2           rexxForward314 315 316let b:current_syntax = "rexx"317 318"vim: ts=8319 
codekingpro/portable-devtools · Team Ai