" Vim syntax file
" Language: Lisp
" Maintainer: Dr. Charles E. Campbell, Jr. <cec@gryphon.gsfc.nasa.gov>
" Last change: 1997 May 14

" remove any old syntax stuff hanging around
syntax clear

" Comments and Strings
syntax match lispComment	";.*$"
syntax region lispString	start=+"+	skip=+\\"+ end=+"+

syntax match lispDelimiter	contained "("
syntax match lispDelimiter	contained ")"

syntax keyword lispDeclaration	defmacro defsetf deftype defun dotimes flet labels let locally macrolet
syntax match lispDeclaration	"do\*"
syntax match lispDeclaration	"do-all-symbols"
syntax match lispDeclaration	"do-external-symbols"
syntax match lispDeclaration	"do-symbols"
syntax match lispDeclaration	"let\*"
syntax match lispDeclaration	"multiple-value-bind"

syntax match lispSpecial	!#([^()'`,"; \t]\+)!
syntax match lispSpecial	!#[':][^()'`,"; \t]\+!
syntax match lispSpecial	!#\\[ -\~]!
syntax match lispSpecial	!#b[01]\+!
syntax match lispSpecial	!#o[0-7]\+!
syntax match lispSpecial	!#x[0-9a-fA-F]\+!
syntax match lispSpecial	!#|[^()'`,"; \t]\+|#!
syntax match lispSpecial	![`,][^()'`,"; \t]\+!
syntax match lispSpecial	"\*[a-zA-Z_][a-zA-Z_0-9-]*\*"
syntax match lispSpecial	"|.\{-}|"

syntax match lispConcat	"[ \t]\.[ \t]"

syntax match lispOptional	!\&|.\{-}|!
syntax match lispOptional	!\&[^()'`,"; \t]\+!

syntax match	lispSymbol	contained !|.\{-}|!
syntax match	lispList	![^']([ \t]*|.\{-}|!	contains lispDelimiter lispSymbol lispOptional
syntax match	lispList	!^([ \t]*|.\{-}|!	contains lispDelimiter lispSymbol lispOptional

syntax match	lispSymbol	contained ![^()'`,"; \t]\+!
syntax match	lispList	![^']([ \t]*[^()'`,"; \t]\+!	contains lispDelimiter lispSymbol lispOptional
syntax match	lispList	!^([ \t]*[^()'`,"; \t]\+!	contains lispDelimiter lispSymbol lispOptional

if !exists("did_lisp_syntax_inits")
  let did_lisp_syntax_inits= 1
  highlight link lispComment	Comment
  highlight link lispConcat	Statement
  highlight link lispDeclaration	Statement
  highlight link lispDelimiter	Delimiter
  highlight link lispList	Delimiter
  highlight link lispOptional	Type
  highlight link lispSpecial	Special
  highlight link lispString	String
  highlight link lispSymbol	Statement
  endif
"vim: ts=14
