| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Vim syntax file | 
					
						
							|  |  |  | " | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | " Language:	NATURAL | 
					
						
							|  |  |  | " Version:	2.1.0.3 | 
					
						
							|  |  |  | " Maintainer:	Marko von Oppen <marko@von-oppen.com> | 
					
						
							|  |  |  | " Last Changed:	2008-07-29 01:40:52 | 
					
						
							|  |  |  | " Support:	http://www.von-oppen.com/ | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " For version 5.x: Clear all syntax items | 
					
						
							|  |  |  | " For version 6.x: Quit when this syntax file was already loaded | 
					
						
							|  |  |  | if v:version < 600 | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |   syntax clear | 
					
						
							|  |  |  |   set iskeyword+=-,*,#,+,_,/ | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | elseif exists("b:current_syntax") | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |   finish | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | else | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |   setlocal iskeyword+=-,*,#,+,_,/ | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " NATURAL is case insensitive | 
					
						
							|  |  |  | syntax case ignore | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " preprocessor | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalInclude	include nextgroup=naturalObjName skipwhite | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " define data | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalKeyword	define data end-define | 
					
						
							|  |  |  | syn keyword naturalKeyword	independent global parameter local redefine view | 
					
						
							|  |  |  | syn keyword naturalKeyword	const[ant] init initial | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " loops | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalLoop		read end-read end-work find end-find histogram end-histogram | 
					
						
							|  |  |  | syn keyword naturalLoop		end-all sort end-sort sorted descending ascending | 
					
						
							|  |  |  | syn keyword naturalRepeat	repeat end-repeat while until for step end-for | 
					
						
							|  |  |  | syn keyword naturalKeyword	in file with field starting from ending at thru by isn where | 
					
						
							|  |  |  | syn keyword naturalError	on error end-error | 
					
						
							|  |  |  | syn keyword naturalKeyword	accept reject end-enddata number unique retain as release | 
					
						
							|  |  |  | syn keyword naturalKeyword	start end-start break end-break physical page top sequence | 
					
						
							|  |  |  | syn keyword naturalKeyword	end-toppage end-endpage end-endfile before processing | 
					
						
							|  |  |  | syn keyword naturalKeyword	end-before | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " conditionals | 
					
						
							|  |  |  | syn keyword naturalConditional	if then else end-if end-norec | 
					
						
							|  |  |  | syn keyword naturalConditional	decide end-decide value when condition none any | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " assignment / calculation | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalKeyword	reset assign move left right justified compress to into edited | 
					
						
							|  |  |  | syn keyword naturalKeyword	add subtract multiply divide compute name | 
					
						
							|  |  |  | syn keyword naturalKeyword	all giving remainder rounded leaving space numeric | 
					
						
							|  |  |  | syn keyword naturalKeyword	examine full replace giving separate delimiter modified | 
					
						
							|  |  |  | syn keyword naturalKeyword	suspend identical suppress | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " program flow | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalFlow		callnat fetch return enter escape bottom top stack formatted | 
					
						
							|  |  |  | syn keyword naturalFlow		command call | 
					
						
							|  |  |  | syn keyword naturalflow		end-subroutine routine | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " file operations | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalKeyword	update store get delete end transaction work once close | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " other keywords | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalKeyword	first every of no record[s] found ignore immediate | 
					
						
							|  |  |  | syn keyword naturalKeyword	set settime key control stop terminate | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " in-/output | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalKeyword	write display input reinput notitle nohdr map newpage | 
					
						
							|  |  |  | syn keyword naturalKeyword	alarm text help eject index window base size | 
					
						
							|  |  |  | syn keyword naturalKeyword	format printer skip lines | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " functions | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalKeyword	abs atn cos exp frac int log sgn sin sqrt tan val old | 
					
						
							|  |  |  | syn keyword naturalKeyword	pos | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " report mode keywords | 
					
						
							|  |  |  | syn keyword naturalRMKeyword	same loop obtain indexed do doend | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Subroutine name | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalFlow		perform subroutine nextgroup=naturalFunction skipwhite | 
					
						
							|  |  |  | syn match   naturalFunction	"\<[a-z][-_a-z0-9]*\>" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalFlow		using nextgroup=naturalKeyword,naturalObjName skipwhite | 
					
						
							|  |  |  | syn match   naturalObjName	"\<[a-z][-_a-z0-9]\{,7}\>" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Labels | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn match   naturalLabel	"\<[+#a-z][-_#a-z0-9]*\." | 
					
						
							|  |  |  | syn match   naturalRef		"\<[+#a-z][-_#a-z0-9]*\>\.\<[+#a-z][*]\=[-_#a-z0-9]*\>" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " mark keyword special handling | 
					
						
							|  |  |  | syn keyword naturalKeyword	mark nextgroup=naturalMark skipwhite | 
					
						
							|  |  |  | syn match   naturalMark		"\<\*[a-z][-_#.a-z0-9]*\>" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " System variables | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn match   naturalSysVar	"\<\*[a-z][-a-z0-9]*\>" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | "integer number, or floating point number without a dot. | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn match   naturalNumber	"\<-\=\d\+\>" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | "floating point number, with dot | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn match   naturalNumber	"\<-\=\d\+\.\d\+\>" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | "floating point number, starting with a dot | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn match   naturalNumber	"\.\d\+" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Formats in write statement | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn match   naturalFormat	"\<\d\+[TX]\>" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " String and Character contstants | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn match   naturalString	"H'\x\+'" | 
					
						
							|  |  |  | syn region  naturalString	start=+"+ end=+"+ | 
					
						
							|  |  |  | syn region  naturalString	start=+'+ end=+'+ | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Type definition | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn match   naturalAttribute	"\<[-a-z][a-z]=[-a-z0-9_\.,]\+\>" | 
					
						
							|  |  |  | syn match   naturalType		contained "\<[ABINP]\d\+\(,\d\+\)\=\>" | 
					
						
							|  |  |  | syn match   naturalType		contained "\<[CL]\>" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " "TODO" / other comments | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalTodo		contained todo test | 
					
						
							|  |  |  | syn match   naturalCommentMark	contained "[a-z][^ \t/:|]*\(\s[^ \t/:'"|]\+\)*:\s"he=e-1 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " comments | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn region  naturalComment	start="/\*" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark | 
					
						
							|  |  |  | syn region  naturalComment	start="^\*[ *]" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark | 
					
						
							|  |  |  | syn region  naturalComment	start="^\d\{4} \*[\ \*]"lc=5 end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark | 
					
						
							|  |  |  | syn match   naturalComment	"^\*$" | 
					
						
							|  |  |  | syn match   naturalComment	"^\d\{4} \*$"lc=5 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " /* is legal syntax in parentheses e.g. "#ident(label./*)" | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn region  naturalPComment	contained start="/\*\s*[^),]"  end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " operators | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalOperator	and or not eq ne gt lt ge le mask scan modified | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " constants | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn keyword naturalBoolean	true false | 
					
						
							|  |  |  | syn match   naturalLineNo	"^\d\{4}" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " identifiers | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn match   naturalIdent	"\<[+#a-z][-_#a-z0-9]*\>[^\.']"me=e-1 | 
					
						
							|  |  |  | syn match   naturalIdent	"\<[+#a-z][-_#a-z0-9]*$" | 
					
						
							|  |  |  | syn match   naturalLegalIdent	"[+#a-z][-_#a-z0-9]*/[-_#a-z0-9]*" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " parentheses | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | syn region  naturalPar		matchgroup=naturalParGui start="(" end=")" contains=naturalLabel,naturalRef,naturalOperator,@naturalConstant,naturalType,naturalSysVar,naturalPar,naturalLineNo,naturalPComment | 
					
						
							|  |  |  | syn match   naturalLineRef	"(\d\{4})" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " build syntax groups | 
					
						
							|  |  |  | syntax cluster naturalConstant	contains=naturalString,naturalNumber,naturalAttribute,naturalBoolean | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " folding | 
					
						
							|  |  |  | if v:version >= 600 | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |   set foldignore=* | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if v:version >= 508 || !exists("did_natural_syntax_inits") | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |   if v:version < 508 | 
					
						
							|  |  |  |     let did_natural_syntax_inits = 1 | 
					
						
							|  |  |  |     command -nargs=+ HiLink hi link <args> | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     command -nargs=+ HiLink hi def link <args> | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  |   " The default methods for highlighting.  Can be overridden later | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Constants | 
					
						
							|  |  |  |   HiLink naturalFormat		Constant | 
					
						
							|  |  |  |   HiLink naturalAttribute	Constant | 
					
						
							|  |  |  |   HiLink naturalNumber		Number | 
					
						
							|  |  |  |   HiLink naturalString		String | 
					
						
							|  |  |  |   HiLink naturalBoolean		Boolean | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " All kinds of keywords | 
					
						
							|  |  |  |   HiLink naturalConditional	Conditional | 
					
						
							|  |  |  |   HiLink naturalRepeat		Repeat | 
					
						
							|  |  |  |   HiLink naturalLoop		Repeat | 
					
						
							|  |  |  |   HiLink naturalFlow		Keyword | 
					
						
							|  |  |  |   HiLink naturalError		Keyword | 
					
						
							|  |  |  |   HiLink naturalKeyword		Keyword | 
					
						
							|  |  |  |   HiLink naturalOperator	Operator | 
					
						
							|  |  |  |   HiLink naturalParGui		Operator | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Labels | 
					
						
							|  |  |  |   HiLink naturalLabel		Label | 
					
						
							|  |  |  |   HiLink naturalRefLabel	Label | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Comments | 
					
						
							|  |  |  |   HiLink naturalPComment	Comment | 
					
						
							|  |  |  |   HiLink naturalComment		Comment | 
					
						
							|  |  |  |   HiLink naturalTodo		Todo | 
					
						
							|  |  |  |   HiLink naturalCommentMark	PreProc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   HiLink naturalInclude		Include | 
					
						
							|  |  |  |   HiLink naturalSysVar		Identifier | 
					
						
							|  |  |  |   HiLink naturalLineNo		LineNr | 
					
						
							|  |  |  |   HiLink naturalLineRef		Error | 
					
						
							|  |  |  |   HiLink naturalSpecial		Special | 
					
						
							|  |  |  |   HiLink naturalComKey		Todo | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " illegal things | 
					
						
							|  |  |  |   HiLink naturalRMKeyword	Error | 
					
						
							|  |  |  |   HiLink naturalLegalIdent	Error | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   HiLink naturalType		Type | 
					
						
							|  |  |  |   HiLink naturalFunction	Function | 
					
						
							|  |  |  |   HiLink naturalObjName		PreProc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   delcommand HiLink | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let b:current_syntax = "natural" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | " vim:set ts=8 sw=8 noet ft=vim: |