" Vim syntax file
" Language:    Ksi
" Maintainer:  Michal Moskal <malekith@pld-linux.org>
" Last Change: Jul 20, 2002
" Version:     1.01

" 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

syn keyword ksiType func_ptr float bool int uint poly ptr tyref ellipsis 
syn keyword ksiType struct union void reference

syn keyword ksiType aligned artificial comdat extern global local
syn keyword ksiType malloc_like no_check_memory_usage no_limit_stack
syn keyword ksiType no_return one_only packed public pure_func
syn keyword ksiType section static_ctor static_dtor suppress_debug
syn keyword ksiType weak export_name alias_set

syn keyword ksiTerm func input_file structdef uniondef tyalias
syn keyword ksiTerm alias_subset abstract_type enumdef

syn keyword ksiTerm nil entry abs addr bind bit_and bit_andtc
syn keyword ksiTerm bit_ior bit_not bit_xor block builtin call
syn keyword ksiTerm ceil_div ceil_mod component compound cond const
syn keyword ksiTerm const_func convert eq exact_div exit exit_loop
syn keyword ksiTerm fbuiltin fcall ffs float_expr floor_div floor_mod
syn keyword ksiTerm func_ref ge goto gt indirect label le loop
syn keyword ksiTerm lrotate lshift lt max min minus modify mult ne
syn keyword ksiTerm negate non_lvalue nop ordered plus ptr_call
syn keyword ksiTerm ptr_fcall rdiv ref result return round_div
syn keyword ksiTerm round_mod rrotate rshift static_var trunc_div
syn keyword ksiTerm trunc_mod truth_and truth_andif truth_not
syn keyword ksiTerm truth_or truth_orif truth_xor uneq unge ungt
syn keyword ksiTerm unle unlt unordered var wfl fix_trunc fix_ceil
syn keyword ksiTerm fix_round fix_floor preinc postinc predec postdec
syn keyword ksiTerm size_of try_finally

syn keyword ksiType extern local public version define

syn keyword ksiTerm func global structdef uniondef enumdef


syn match	ksiSpec	"[\]\[]"
syn match	ksiNumber "0[xX][0-9a-fA-F]\+"
syn match	ksiNumber "[0-9]\+\((\.[0-9]*)\)\?\([eE]\([+-]\)\?[0-9]*\)\?"

syn match	ksiMacro	"[.\^][a-zA-Z_$@][a-zA-Z_@$0-9]*"

syn match	ksiIdentifier	"[a-zA-Z_$@][a-zA-Z_@$0-9]*"

" Comments
syn keyword ksiTodo	contained	XXX TODO
syn cluster ksiCommentGroup	contains=ksiTodo
syn match ksiComment	"//.*$"	contains=@ksiCommentGroup
syn match ksiComment	"#.*$"	contains=@ksiCommentGroup

syn match	ksiSpecial	display contained "\\\(x\x\x\|.\|$\)"
syn region	ksiString	start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=ksiSpecial

" synchronization
syn sync lines=100

" 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_ksi_syntax_inits")
  if version < 508
    let did_lisp_syntax_inits = 1
    command -nargs=+ HiLink hi link <args>
  else
    command -nargs=+ HiLink hi def link <args>
  endif

  HiLink ksiIdentifier	Identifier
  HiLink ksiComment	Comment
  HiLink ksiTerm	Statement
  HiLink ksiString	String
  HiLink ksiType	Type
  HiLink ksiMacro	Macro
  HiLink ksiSpec	Special
  HiLink ksiNumber	Number

" HiLink	ksiErrInParen	Error
" HiLink	ksiErrInBracket	Error
  delcommand HiLink
endif

let b:current_syntax = "ksi"

" vim: nowrap
