codekingpro/portable-devtools
114k
1" Vim syntax file2"3" Language: NATURAL4" Version: 2.1.0.55" Maintainer: Marko von Oppen <marko@von-oppen.com>6" Last Changed: 2012-02-05 18:50:437" Support: http://www.von-oppen.com/8 9" quit when a syntax file was already loaded10if exists("b:current_syntax")11 finish12endif13setlocal iskeyword+=-,*,#,+,_,/14 15let s:cpo_save = &cpo16set cpo&vim17 18" NATURAL is case insensitive19syntax case ignore20 21" preprocessor22syn keyword naturalInclude include nextgroup=naturalObjName skipwhite23 24" define data25syn keyword naturalKeyword define data end-define26syn keyword naturalKeyword independent global parameter local redefine view27syn keyword naturalKeyword const[ant] init initial28 29" loops30syn keyword naturalLoop read end-read end-work find end-find histogram end-histogram31syn keyword naturalLoop end-all sort end-sort sorted descending ascending32syn keyword naturalRepeat repeat end-repeat while until for step end-for33syn keyword naturalKeyword in file with field starting from ending at thru by isn where34syn keyword naturalError on error end-error35syn keyword naturalKeyword accept reject end-enddata number unique retain as release36syn keyword naturalKeyword start end-start break end-break physical page top sequence37syn keyword naturalKeyword end-toppage end-endpage end-endfile before processing38syn keyword naturalKeyword end-before39 40" conditionals41syn keyword naturalConditional if then else end-if end-norec42syn keyword naturalConditional decide end-decide value when condition none any43 44" assignment / calculation45syn keyword naturalKeyword reset assign move left right justified compress to into edited46syn keyword naturalKeyword add subtract multiply divide compute name47syn keyword naturalKeyword all giving remainder rounded leaving space numeric48syn keyword naturalKeyword examine full replace giving separate delimiter modified49syn keyword naturalKeyword suspend identical suppress50 51" program flow52syn keyword naturalFlow callnat fetch return enter escape bottom top stack formatted53syn keyword naturalFlow command call54syn keyword naturalflow end-subroutine routine55 56" file operations57syn keyword naturalKeyword update store get delete end transaction work once close58 59" other keywords60syn keyword naturalKeyword first every of no record[s] found ignore immediate61syn keyword naturalKeyword set settime key control stop terminate62 63" in-/output64syn keyword naturalKeyword write display input reinput notitle nohdr map newpage65syn keyword naturalKeyword alarm text help eject index window base size66syn keyword naturalKeyword format printer skip lines67 68" functions69syn keyword naturalKeyword abs atn cos exp frac int log sgn sin sqrt tan val old70syn keyword naturalKeyword pos71 72" report mode keywords73syn keyword naturalRMKeyword same loop obtain indexed do doend74 75" Subroutine name76syn keyword naturalFlow perform subroutine nextgroup=naturalFunction skipwhite77syn match naturalFunction "\<[a-z][-_a-z0-9]*\>"78 79syn keyword naturalFlow using nextgroup=naturalKeyword,naturalObjName skipwhite80syn match naturalObjName "\<[a-z][-_a-z0-9]\{,7}\>"81 82" Labels83syn match naturalLabel "\<[+#a-z][-_#a-z0-9]*\."84syn match naturalRef "\<[+#a-z][-_#a-z0-9]*\>\.\<[+#a-z][*]\=[-_#a-z0-9]*\>"85 86" mark keyword special handling87syn keyword naturalKeyword mark nextgroup=naturalMark skipwhite88syn match naturalMark "\<\*[a-z][-_#.a-z0-9]*\>"89 90" System variables91syn match naturalSysVar "\<\*[a-z][-a-z0-9]*\>"92 93"integer number, or floating point number without a dot.94syn match naturalNumber "\<-\=\d\+\>"95"floating point number, with dot96syn match naturalNumber "\<-\=\d\+\.\d\+\>"97"floating point number, starting with a dot98syn match naturalNumber "\.\d\+"99 100" Formats in write statement101syn match naturalFormat "\<\d\+[TX]\>"102 103" String and Character contstants104syn match naturalString "H'\x\+'"105syn region naturalString start=+"+ end=+"+106syn region naturalString start=+'+ end=+'+107 108" Type definition109syn match naturalAttribute "\<[-a-z][a-z]=[-a-z0-9_\.,]\+\>"110syn match naturalType contained "\<[ABINP]\d\+\(,\d\+\)\=\>"111syn match naturalType contained "\<[CL]\>"112 113" "TODO" / other comments114syn keyword naturalTodo contained todo test115syn match naturalCommentMark contained "[a-z][^ \t/:|]*\(\s[^ \t/:'"|]\+\)*:\s"he=e-1116 117" comments118syn region naturalComment start="/\*" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark119syn region naturalComment start="^\*[ *]" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark120syn region naturalComment start="^\d\{4} \*[\ \*]"lc=5 end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark121syn match naturalComment "^\*$"122syn match naturalComment "^\d\{4} \*$"lc=5123" /* is legal syntax in parentheses e.g. "#ident(label./*)"124syn region naturalPComment contained start="/\*\s*[^),]" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark125 126" operators127syn keyword naturalOperator and or not eq ne gt lt ge le mask scan modified128 129" constants130syn keyword naturalBoolean true false131syn match naturalLineNo "^\d\{4}"132 133" identifiers134syn match naturalIdent "\<[+#a-z][-_#a-z0-9]*\>[^\.']"me=e-1135syn match naturalIdent "\<[+#a-z][-_#a-z0-9]*$"136syn match naturalLegalIdent "[+#a-z][-_#a-z0-9]*/[-_#a-z0-9]*"137 138" parentheses139syn region naturalPar matchgroup=naturalParGui start="(" end=")" contains=naturalLabel,naturalRef,naturalOperator,@naturalConstant,naturalType,naturalSysVar,naturalPar,naturalLineNo,naturalPComment140syn match naturalLineRef "(\d\{4})"141 142" build syntax groups143syntax cluster naturalConstant contains=naturalString,naturalNumber,naturalAttribute,naturalBoolean144 145" folding146if v:version >= 600147 set foldignore=*148endif149 150 151" The default methods for highlighting. Can be overridden later152 153" Constants154hi def link naturalFormat Constant155hi def link naturalAttribute Constant156hi def link naturalNumber Number157hi def link naturalString String158hi def link naturalBoolean Boolean159 160" All kinds of keywords161hi def link naturalConditional Conditional162hi def link naturalRepeat Repeat163hi def link naturalLoop Repeat164hi def link naturalFlow Keyword165hi def link naturalError Keyword166hi def link naturalKeyword Keyword167hi def link naturalOperator Operator168hi def link naturalParGui Operator169 170" Labels171hi def link naturalLabel Label172hi def link naturalRefLabel Label173 174" Comments175hi def link naturalPComment Comment176hi def link naturalComment Comment177hi def link naturalTodo Todo178hi def link naturalCommentMark PreProc179 180hi def link naturalInclude Include181hi def link naturalSysVar Identifier182hi def link naturalLineNo LineNr183hi def link naturalLineRef Error184hi def link naturalSpecial Special185hi def link naturalComKey Todo186 187" illegal things188hi def link naturalRMKeyword Error189hi def link naturalLegalIdent Error190 191hi def link naturalType Type192hi def link naturalFunction Function193hi def link naturalObjName PreProc194 195 196let b:current_syntax = "natural"197 198let &cpo = s:cpo_save199unlet s:cpo_save200 201" vim:set ts=8 sw=8 noet ft=vim list:202 