" Vim syntax file " Language: newLISP " Maintainers: David S. de Lis and L.M. " Last Change: 2007-07-19 L.M. " Version: 1.0.51 " (based on lisp.vim version 13, " http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax) " URL: http://www.geocities.com/excaliborus/newlisp/newlisp.vim " 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 if version >= 600 setlocal iskeyword=42,43,45,47-58,60-62,64-90,97-122,_ else set iskeyword=42,43,45,47-58,60-62,64-90,97-122,_ endif " Clusters syn cluster newlispAtomCluster contains=newlispAtomBarSymbol,newlispAtomList,newlispAtomNmbr0,newlispComment,newlispDecl,newlispFunc,newlispLeadWhite syn cluster newlispListCluster contains=newlispAtom,newlispAtomBarSymbol,newlispAtomMark,newlispBQList,newlispBarSymbol,newlispComment,newlispConcat,newlispDecl,newlispFunc,newlispKey,newlispList,newlispNumber,newlispSpecial,newlispSymbol,newlispVar,newlispLeadWhite " Lists syn match newlispSymbol contained ![^()'{}"; \t]\+! syn match newlispBarSymbol contained !|..-|! syn region newlispList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@newlispListCluster,newlispString syn region newlispString matchgroup=Delimiter start="{" skip="|.\{-}|" matchgroup=Delimiter end="}" contains=@newlispListCluster,newlispString syn region newlispStringBig matchgroup=Delimiter start="\[text\]" skip="|.\{-}|" matchgroup=Delimiter end="\[/text\]" contains=@newlispListCluster,newlispString syn region newlispBQList matchgroup=PreProc start="`(" skip="|.\{-}|" matchgroup=PreProc end=")" contains=@newlispListCluster,newlispString " Atoms syn match newlispAtomMark "'" syn match newlispAtom "'("me=e-1 contains=newlispAtomMark nextgroup=newlispAtomList syn match newlispAtom "'[^ \t()]\+" contains=newlispAtomMark syn match newlispAtomBarSymbol !'|..\-|! contains=newlispAtomMark syn region newlispAtom start=+'"+ skip=+\\"+ end=+"+ syn region newlispAtom start=+'{+ skip=+\\}+ end=+}+ syn region newlispAtomList contained matchgroup=Special start="(" skip="|.\{-}|" matchgroup=Special end=")" contains=@newlispAtomCluster,newlispString syn match newlispAtomNmbr contained "\<\d\+" syn match newlispLeadWhite contained "^\s\+" " Standard newlisp Functions and Constants syn keyword newlispFunc ! != $ $0 $1 $10 $11 $12 $13 $14 $15 $2 $3 $4 $5 $6 $7 $8 $9 $args syn keyword newlispFunc $idx $main-args % & * + - / < << <= = > >= >> ? @ MAIN NaN? ^ abs syn keyword newlispFunc acos acosh add address amb and append append-file apply args array syn keyword newlispFunc array-list array? asin asinh assoc atan atan2 atanh atom? base64-dec syn keyword newlispFunc base64-enc bayes-query bayes-train begin beta betai bind binomial syn keyword newlispFunc callback case catch ceil change-dir char chop clean close command-line syn keyword newlispFunc cond cons constant context context? copy-file cos cosh count cpymem syn keyword newlispFunc crc32 crit-chi2 crit-z current-line curry date date-value debug syn keyword newlispFunc dec def-new default define define-macro delete delete-file delete-url syn keyword newlispFunc det device difference directory directory? div do-until do-while syn keyword newlispFunc doargs dolist dotimes dotree dump dup empty? encrypt ends-with env syn keyword newlispFunc erf error-event error-number error-text eval eval-string exec exists syn keyword newlispFunc exit exp expand explode factor fft file-info file? filter find find-all syn keyword newlispFunc first flat float float? floor flt for for-all fork format fv gammai syn keyword newlispFunc gammaln gcd get-char get-float get-int get-long get-string get-url syn keyword newlispFunc global global? if ifft import inc index int integer integer? intersect syn keyword newlispFunc invert irr join lambda? last legal? length let letex letn list list? load syn keyword newlispFunc local log lookup lower-case macro? main-args make-dir map mat match syn keyword newlispFunc max member min mod mul multiply name net-accept net-close net-connect syn keyword newlispFunc net-error net-eval net-listen net-local net-lookup net-peek net-peer syn keyword newlispFunc net-ping net-receive net-receive-from net-receive-udp net-select syn keyword newlispFunc net-send net-send-to net-send-udp net-service net-sessions new syn keyword newlispFunc nil? normal not now nper npv nth nth-set null? number? open or ostype syn keyword newlispFunc pack parse parse-date peek pipe pmt pop post-url pow pretty-print syn keyword newlispFunc primitive? print println prob-chi2 prob-z process protected? push put-url syn keyword newlispFunc pv quote quote? rand random randomize read-buffer read-char read-file syn keyword newlispFunc read-key read-line real-path ref ref-all regex remove-dir rename-file syn keyword newlispFunc replace replace-assoc reset rest reverse rotate round save search syn keyword newlispFunc seed seek select semaphore sequence series set set-locale set-nth syn keyword newlispFunc setq sgn share signal silent sin sinh sleep slice sort source sqrt syn keyword newlispFunc starts-with string string? sub swap sym symbol? symbols sys-error syn keyword newlispFunc sys-info tan tanh throw throw-error time time-of-day timer title-case syn keyword newlispFunc trace trace-highlight transpose trim true? unicode unify unique syn keyword newlispFunc unless unpack until upper-case utf8 utf8len uuid wait-pid while syn keyword newlispFunc write-buffer write-char write-file write-line xml-error xml-parse syn keyword newlispFunc xml-type-tags zero? \| ~ " boolean values syn keyword newlispBoolean true nil " Strings syn region newlispString start=+"+ skip=+\\\\\|\\"+ end=+"+ syn region newlispString start=+{+ skip=+\\\\\|\\}+ end=+}+ syn region newlispString start=+\[text\]+ skip=+\\\\\|\\]+ end=+\[/text\]+ " Declarations, Macros, Functions syn keyword newlispDecl define define-macro " Numbers: supporting integers and floating point numbers syn match newlispNumber "-\=\(\.\d\+\|\d\+\(\.\d*\)\=\)\(e[-+]\=\d\+\)\=" syn match newlispNumber "[-#+0-9.][-#+0-9a-feEx]*" " syn match newlispSpecial "\*[a-zA-Z_][a-zA-Z_0-9-]*\*" " syn match newlispSpecial !#|[^()'`,"; \t]\+|#! " syn match newlispSpecial !#x[0-9a-fA-F]\+! " syn match newlispSpecial !#o[0-7]\+! " syn match newlispSpecial !#b[01]\+! " syn match newlispSpecial !#\\[ -\~]! " syn match newlispSpecial !#[':][^()'`,"; \t]\+! " syn match newlispSpecial !#([^()'`,"; \t]\+)! " syn match newlispConcat "\s\.\s" syn match newlispParenError ")" " Comments syn cluster newlispCommentGroup contains=newlispTodo syn match newlispComment ";.*$" contains=@newlispCommentGroup syn match newlispComment "#.*$" contains=@newlispCommentGroup "syn region newlispCommentRegion start="#|" end="|#" contains=newlispCommentRegion,@newlispCommentGroup " 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_newlisp_syntax_inits") if version < 508 let did_newlisp_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink newlispCommentRegion newlispComment HiLink newlispAtomNmbr newlispNumber HiLink newlispAtomMark newlispMark HiLink newlispStringBig newlispString HiLink newlispStringOpt newlispString HiLink newlispAtom Identifier HiLink newlispAtomBarSymbol Special HiLink newlispBarSymbol Special HiLink newlispBoolean Special HiLink newlispComment Comment HiLink newlispConcat Statement HiLink newlispDecl Statement HiLink newlispFunc Statement HiLink newlispKey Type HiLink newlispMark Delimiter HiLink newlispNumber Number HiLink newlispParenError Error HiLink newlispSpecial Type HiLink newlispString String HiLink newlispTodo Todo HiLink newlispVar Statement delcommand HiLink endif let b:current_syntax = "newlisp" " vim: ts=2