diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-10-21 03:02:54 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-10-21 03:02:54 +0200 |
commit | 3a0d8090b1356833e1c80d22f36086c835604f42 (patch) | |
tree | 4e13cce7e070c209ea46201e12d849f45114d5fe /runtime/syntax/rexx.vim | |
parent | 67a4f6cfb4fe0f8e8cc576a4f4196573ccc5e3fb (diff) | |
download | vim-git-3a0d8090b1356833e1c80d22f36086c835604f42.tar.gz |
Updated runtime files.
Diffstat (limited to 'runtime/syntax/rexx.vim')
-rw-r--r-- | runtime/syntax/rexx.vim | 87 |
1 files changed, 60 insertions, 27 deletions
diff --git a/runtime/syntax/rexx.vim b/runtime/syntax/rexx.vim index b4d07323d..ef698a535 100644 --- a/runtime/syntax/rexx.vim +++ b/runtime/syntax/rexx.vim @@ -1,14 +1,8 @@ " Vim syntax file " Language: Rexx " Maintainer: Thomas Geulig <geulig@nentec.de> -" Last Change: 2005 Dez 9, added some <http://www.ooRexx.org>-coloring, -" line comments, do *over*, messages, directives, -" highlighting classes, methods, routines and requires -" 2007 Oct 17, added support for new ooRexx 3.2 features -" Rony G. Flatscher <rony.flatscher@wu-wien.ac.at> -" +" 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 <dwsharp@hotmail.com> and Rony G. Flatscher " <Rony.Flatscher@wu-wien.ac.at> for comments and additions @@ -54,7 +48,7 @@ syn match rexxKeyword contained "\<use\>\s*\(strict\s*\)\?\<arg\>" syn match rexxRegularCallSignal contained "\<\(call\|signal\)\s\(\s*on\>\|\s*off\>\)\@!\(\k\+\ze\|\ze(\)\(\s*\|;\|$\|(\)" syn region rexxLabel contained start="\<\(call\|signal\)\>\s*\zs\(\k*\|(\)" end="\ze\(\s*\|;\|$\|(\)" containedin=rexxRegularCallSignal -syn match rexxExceptionHandling contained "\<\(call\|signal\)\>\s\+\<\(on\|off\)\>.*\(;\|$\)" +syn match rexxExceptionHandling contained "\<\(call\|signal\)\>\s\+\<\(on\|off\)\>.*\(;\|$\)" contains=rexxComment " hilite label given after keyword "name" syn match rexxLabel "name\s\+\zs\k\+\ze" containedin=rexxExceptionHandling @@ -74,13 +68,14 @@ syn match rexxConditional "\<\(then\|else\|when\|otherwise\)\(\s*\|;\|\_$\|\)\>" syn match rexxLoopKeywords "\<\(to\|by\|for\|until\|while\|over\)\>" containedin=doLoopSelectLabelRegion " must be after Conditional phrases! -syn match doLoopSelectLabelRegion "\<\(do\|loop\|select\)\>\s\+\(label\s\+\)\?\(\s\+\k\+\s\+\zs\<over\>\)\?\k*\(\s\+forever\)\?\(\s\|;\|$\)" +syn match doLoopSelectLabelRegion "\<\(do\|loop\|select\)\>\s\+\(label\s\+\)\?\(\s\+\k\+\s\+\zs\<over\>\)\?\k*\(\s\+forever\)\?\(\s\|;\|$\)" contains=doLoopSelectLabelRegion,rexxStartValueAssignment,rexxLoopKeywords " color label's name syn match rexxLabel2 "\<\(do\|loop\|select\)\>\s\+label\s\+\zs\k*\ze" containedin=doLoopSelectLabelRegion " make sure control variable is normal -syn match rexxControlVariable "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\s\+\<over\>" containedin=doLoopSelectLabelRegion +" TODO: re-activate ? +"rgf syn match rexxControlVariable "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\s\+\<over\>" containedin=doLoopSelectLabelRegion " make sure control variable assignment is normal syn match rexxStartValueAssignment "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\(=.*\)\?\s\+\<to\>" containedin=doLoopSelectLabelRegion @@ -96,7 +91,8 @@ syn match rexxGuard "\(^\|;\|:\)\s*\<guard\>\s\+\<\(on\|off\)\>" syn match rexxTrace "\(^\|;\|:\)\s*\<trace\>\s\+\<\K\k*\>" " Raise statement -syn match rexxRaise "\(^\|;\|:\)\s\+\<raise\>\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise2 +" syn match rexxRaise "\(^\|;\|:\)\s\+\<raise\>\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise2 +syn match rexxRaise "\(^\|;\|:\)\s*\<raise\>\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise2 syn match rexxRaise2 "\<\(additional\|array\|description\|exit\|propagate\|return\)\>" containedin=rexxRaise " Forward statement @@ -142,19 +138,36 @@ syn keyword rexxSpecialVariable sigl rc result self super syn keyword rexxSpecialVariable .environment .error .input .local .methods .output .rs .stderr .stdin .stdout .stdque " Constants -syn keyword rexxConst .true .false .nil .endOfLine .line +syn keyword rexxConst .true .false .nil .endOfLine .line .context + +" Rexx numbers +" int like number +syn match rexxNumber '\d\+' contained +syn match rexxNumber '[-+]\s*\d\+' contained + +" Floating point number with decimal +syn match rexxNumber '\d\+\.\d*' contained +syn match rexxNumber '[-+]\s*\d\+\.\d*' contained + +" Floating point like number with E +syn match rexxNumber '[-+]\s*\d*[eE][\-+]\d\+' contained +syn match rexxNumber '\d*[eE][\-+]\d\+' contained + +" Floating point like number with E and decimal point (+,-) +syn match rexxNumber '[-+]\s*\d*\.\d*[eE][\-+]\d\+' contained +syn match rexxNumber '\d*\.\d*[eE][\-+]\d\+' contained -syn match rexxNumber "\(-\|+\)\?\s*\zs\<\(\d\+\.\?\|\d*\.\d\+\(E\(+\|-\)\d\{2,2}\)\?\)\?\>" " ooRexx builtin classes (as of version 3.2.0, fall 2007), first define dot to be o.k. in keywords syn keyword rexxBuiltinClass .Alarm .ArgUtil .Array .Bag .CaselessColumnComparator syn keyword rexxBuiltinClass .CaselessComparator .CaselessDescendingComparator .CircularQueue syn keyword rexxBuiltinClass .Class .Collection .ColumnComparator .Comparable .Comparator -syn keyword rexxBuiltinClass .DateTime .DescendingComparator .Directory .InputOutputStream +syn keyword rexxBuiltinClass .DateTime .DescendingComparator .Directory .File .InputOutputStream syn keyword rexxBuiltinClass .InputStream .InvertingComparator .List .MapCollection syn keyword rexxBuiltinClass .Message .Method .Monitor .MutableBuffer .Object -syn keyword rexxBuiltinClass .OrderedCollection .OutputStream .Properties .Queue -syn keyword rexxBuiltinClass .Relation .RexxQueue .Set .SetCollection .Stem .Stream +syn keyword rexxBuiltinClass .OrderedCollection .OutputStream .Package .Properties .Queue +syn keyword rexxBuiltinClass .RegularExpression .Relation .RexxContext .RexxQueue .Routine +syn keyword rexxBuiltinClass .Set .SetCollection .Stem .Stream syn keyword rexxBuiltinClass .StreamSupplier .String .Supplier .Table .TimeSpan " Windows-only classes @@ -163,7 +176,8 @@ syn keyword rexxBuiltinClass .CategoryDialog .CheckBox .CheckList .ComboBox .Dia syn keyword rexxBuiltinClass .DialogExtensions .DlgArea .DlgAreaU .DynamicDialog syn keyword rexxBuiltinClass .EditControl .InputBox .IntegerBox .ListBox .ListChoice syn keyword rexxBuiltinClass .ListControl .MenuObject .MessageExtensions .MultiInputBox -syn keyword rexxBuiltinClass .MultiListChoice .PasswordBox .PlainBaseDialog .PlainUserDialog +syn keyword rexxBuiltinClass .MultiListChoice .OLEObject .OLEVariant +syn keyword rexxBuiltinClass .PasswordBox .PlainBaseDialog .PlainUserDialog syn keyword rexxBuiltinClass .ProgressBar .ProgressIndicator .PropertySheet .RadioButton syn keyword rexxBuiltinClass .RcDialog .ResDialog .ScrollBar .SingleSelection .SliderControl syn keyword rexxBuiltinClass .StateIndicator .StaticControl .TabControl .TimedMessage @@ -171,22 +185,34 @@ syn keyword rexxBuiltinClass .TreeControl .UserDialog .VirtualKeyCodes .WindowBa syn keyword rexxBuiltinClass .WindowExtensions .WindowObject .WindowsClassesBase .WindowsClipboard syn keyword rexxBuiltinClass .WindowsEventLog .WindowsManager .WindowsProgramManager .WindowsRegistry +" BSF4ooRexx classes +syn keyword rexxBuiltinClass .BSF .bsf.dialog .bsf_proxy +syn keyword rexxBuiltinClass .UNO .UNO_ENUM .UNO_CONSTANTS .UNO_PROPERTIES + " ooRexx directives, ---rgf location important, otherwise directives in top of file not matched! syn region rexxClassDirective start="::\s*class\s*"ms=e+1 end="\ze\(\s\|;\|$\)" syn region rexxMethodDirective start="::\s*method\s*"ms=e+1 end="\ze\(\s\|;\|$\)" syn region rexxRequiresDirective start="::\s*requires\s*"ms=e+1 end="\ze\(\s\|;\|$\)" syn region rexxRoutineDirective start="::\s*routine\s*"ms=e+1 end="\ze\(\s\|;\|$\)" syn region rexxAttributeDirective start="::\s*attribute\s*"ms=e+1 end="\ze\(\s\|;\|$\)" +" rgf, 2012-09-09 +syn region rexxOptionsDirective start="::\s*options\s*"ms=e+1 end="\ze\(\s\|;\|$\)" +syn region rexxConstantDirective start="::\s*constant\s*"ms=e+1 end="\ze\(\s\|;\|$\)" + +syn region rexxDirective start="\(^\|;\)\s*::\s*\w\+" end="\($\|;\)" contains=rexxString,rexxNumber,rexxComment,rexxLineComment,rexxClassDirective,rexxMethodDirective,rexxRoutineDirective,rexxRequiresDirective,rexxAttributeDirective,rexxOptionsDirective,rexxConstantDirective keepend + +syn match rexxOptionsDirective2 "\<\(digits\|form\|fuzz\|trace\)\>" containedin = rexxOptionsDirective3 +syn region rexxOptionsDirective3 start="\(^\|;\)\s*::\s*options\s"ms=e+1 end="\($\|;\)" contains=rexxString,rexxNumber,rexxVariable,rexxComment,rexxLineComment containedin = rexxDirective -syn region rexxDirective start="\(^\|;\)\s*::\s*\w\+" end="\($\|;\)" contains=rexxString,rexxComment,rexxLineComment,rexxClassDirective,rexxMethodDirective,rexxRoutineDirective,rexxRequiresDirective,rexxAttributeDirective keepend syn region rexxVariable start="\zs\<\(\.\)\@!\K\k\+\>\ze\s*\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)" end="\(\_$\|.\)"me=e-1 -syn match rexxVariable "\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)\s*\zs\K\k*\ze" +syn match rexxVariable "\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)\s*\zs\K\k*\ze" " rgf, 2007-07-22: unfortunately, the entire region is colored (not only the " patterns), hence useless (vim 7.0)! (syntax-docs hint that that should work) " attempt: just colorize the parenthesis in matching colors, keep content " transparent to keep the formatting already done to it! +" TODO: test on 7.3 " syn region par1 matchgroup=par1 start="(" matchgroup=par1 end=")" transparent contains=par2 " syn region par2 matchgroup=par2 start="(" matchgroup=par2 end=")" transparent contains=par3 contained " syn region par3 matchgroup=par3 start="(" matchgroup=par3 end=")" transparent contains=par4 contained @@ -200,11 +226,11 @@ syn match rexxVariable "\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)\s*\zs\K\k*\ze " syn region par4 matchgroup=par4 start="(" end=")" contains=par5 contained " syn region par5 matchgroup=par5 start="(" end=")" contains=par1 contained -hi par1 ctermfg=red guifg=red -hi par2 ctermfg=blue guifg=blue -hi par3 ctermfg=darkgreen guifg=darkgreen -hi par4 ctermfg=darkyellow guifg=darkyellow -hi par5 ctermfg=darkgrey guifg=darkgrey +hi par1 ctermfg=red guifg=red "guibg=grey +hi par2 ctermfg=blue guifg=blue "guibg=grey +hi par3 ctermfg=darkgreen guifg=darkgreen "guibg=grey +hi par4 ctermfg=darkyellow guifg=darkyellow "guibg=grey +hi par5 ctermfg=darkgrey guifg=darkgrey "guibg=grey " line continuation (trailing comma or single dash) syn sync linecont "\(,\|-\ze-\@!\)\ze\s*\(--.*\|\/\*.*\)*$" @@ -214,7 +240,7 @@ syn sync linecont "\(,\|-\ze-\@!\)\ze\s*\(--.*\|\/\*.*\)*$" " endif " exec "syn sync ccomment rexxComment minlines=" . rexx_minlines -" always scan from start, PCs are powerful enough for that in 2007 ! +" always scan from start, PCs have long become to be powerful enough for that exec "syn sync fromstart" " Define the default highlighting. @@ -236,7 +262,7 @@ if version >= 508 || !exists("did_rexx_syn_inits") HiLink endIterateLeaveLabelRegion rexxKeyword HiLink rexxLoopKeywords rexxKeyword " Todo - HiLink rexxNumber Normal + HiLink rexxNumber Normal "DiffChange " HiLink rexxIdentifier DiffChange HiLink rexxRegularCallSignal Statement @@ -249,7 +275,7 @@ if version >= 508 || !exists("did_rexx_syn_inits") HiLink rexxCommentError rexxError HiLink rexxError Error HiLink rexxKeyword Statement - HiLink rexxKeywordStatements Statement + HiLink rexxKeywordStatements Statement HiLink rexxFunction Function HiLink rexxString String @@ -271,6 +297,13 @@ if version >= 508 || !exists("did_rexx_syn_inits") HiLink rexxRequiresDirective Include HiLink rexxRoutineDirective rexxFunction +" rgf, 2012-09-09 + HiLink rexxOptionsDirective rexxFunction + HiLink rexxOptionsDirective2 rexxOptionsDirective + HiLink rexxOptionsDirective3 Normal " rexxOptionsDirective + + HiLink rexxConstantDirective rexxFunction + HiLink rexxConst Constant HiLink rexxTypeSpecifier Type HiLink rexxBuiltinClass rexxTypeSpecifier |