" Vim syn file
" Language:	NVISION Script	
" Maintainer:	Barak Michener
" Last Change:	2006 Jun 29

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

"this language is oblivious to case.
syn case ignore


" The only keywords
syn keyword nvpKeyword elseif else defsub endif msgbox for if
syn keyword nvpKeyword gosub endsub next print printn sleep
syn keyword nvpKeyword to wend while yesnobox

syn keyword nvpFunction #flush #sendbreak #halt
" String contstants
syn region nvpString start=+"+  skip=+\\"+  end=+"+
"integer number, or floating point number without a dot.
syn match  nvpNumber		"\<\d\+\>"
"floating point number, with dot
syn match  nvpNumber		"\<\d\+\.\d*\>"
"floating point number, starting with a dot
syn match  nvpNumber		"\.\d\+\>"
"hex number
syn match  nvpNumber	display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
syn match  nvpNumber	"\<[0-9ABCDEF]{2}\>"

syn region nvpComment start="!" end="$"
syn match  nvpOperator "[+\-*/()%<>=\^]"

syn match  nvpVarPlain		 "$^[ADEFHILMOPSTWX]\="
syn match  nvpVarPlain		 "$[\\\"\[\]'&`+*.,;=%~?@$<>(-]"
syn match  nvpVarPlain		 "$\(0\|[1-9]\d*\)"
syn region nvpSend start="<<" end="$"
syn region nvpRecv start="\d*: " end="$"

" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_basic_syntax_inits")
  if version < 508
    let did_basic_syntax_inits = 1
    command -nargs=+ HiLink hi link <args>
  else
    command -nargs=+ HiLink hi def link <args>
  endif

  "My Highlighting
  HiLink nvpFunction	PreProc
  HiLink nvpKeyword 	Statement
  HiLink nvpString	String
  HiLink nvpNumber	Number
  HiLink nvpComment	Comment
  HiLink nvpOperator	Operator
  HiLink nvpVarPlain	Identifier
  HiLink nvpSend	Include
  HiLink nvpRecv	SpecialChar	

  delcommand HiLink
endif

let b:current_syntax = "nvpscript"

"vim: ts=4
