3 " Maintainer: Paul Baleme <pbaleme@mail.com>
4 " Last change: September 14, 2000
5 " Based on lisp.vim by : Dr. Charles E. Campbell, Jr. <cec@gryphon.gsfc.nasa.gov>
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
16 set iskeyword=42,43,45,47-58,60-62,64-90,97-122,_
18 setlocal iskeyword=42,43,45,47-58,60-62,64-90,97-122,_
22 syn match jessSymbol ![^()'`,"; \t]\+! contained
23 syn match jessBarSymbol !|..\{-}|! contained
24 syn region jessList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=jessAtom,jessBQList,jessConcat,jessDeclaration,jessList,jessNumber,jessSymbol,jessSpecial,jessFunc,jessKey,jessAtomMark,jessString,jessComment,jessBarSymbol,jessAtomBarSymbol,jessVar
25 syn region jessBQList matchgroup=PreProc start="`(" skip="|.\{-}|" matchgroup=PreProc end=")" contains=jessAtom,jessBQList,jessConcat,jessDeclaration,jessList,jessNumber,jessSpecial,jessSymbol,jessFunc,jessKey,jessVar,jessAtomMark,jessString,jessComment,jessBarSymbol,jessAtomBarSymbol
28 syn match jessAtomMark "'"
29 syn match jessAtom "'("me=e-1 contains=jessAtomMark nextgroup=jessAtomList
30 syn match jessAtom "'[^ \t()]\+" contains=jessAtomMark
31 syn match jessAtomBarSymbol !'|..\{-}|! contains=jessAtomMark
32 syn region jessAtom start=+'"+ skip=+\\"+ end=+"+
33 syn region jessAtomList matchgroup=Special start="(" skip="|.\{-}|" matchgroup=Special end=")" contained contains=jessAtomList,jessAtomNmbr0,jessString,jessComment,jessAtomBarSymbol
34 syn match jessAtomNmbr "\<[0-9]\+" contained
36 " Standard jess Functions and Macros
37 syn keyword jessFunc * + ** - / < > <= >= <> =
38 syn keyword jessFunc long longp
39 syn keyword jessFunc abs agenda and
40 syn keyword jessFunc assert assert-string bag
41 syn keyword jessFunc batch bind bit-and
42 syn keyword jessFunc bit-not bit-or bload
43 syn keyword jessFunc bsave build call
44 syn keyword jessFunc clear clear-storage close
45 syn keyword jessFunc complement$ context count-query-results
46 syn keyword jessFunc create$
47 syn keyword jessFunc delete$ div
48 syn keyword jessFunc do-backward-chaining e
49 syn keyword jessFunc engine eq eq*
50 syn keyword jessFunc eval evenp exit
51 syn keyword jessFunc exp explode$ external-addressp
52 syn keyword jessFunc fact-slot-value facts fetch
53 syn keyword jessFunc first$ float floatp
54 syn keyword jessFunc foreach format gensym*
55 syn keyword jessFunc get get-fact-duplication
56 syn keyword jessFunc get-member get-multithreaded-io
57 syn keyword jessFunc get-reset-globals get-salience-evaluation
58 syn keyword jessFunc halt if implode$
59 syn keyword jessFunc import insert$ integer
60 syn keyword jessFunc integerp intersection$ jess-version-number
61 syn keyword jessFunc jess-version-string length$
62 syn keyword jessFunc lexemep list-function$ load-facts
63 syn keyword jessFunc load-function load-package log
64 syn keyword jessFunc log10 lowcase matches
65 syn keyword jessFunc max member$ min
66 syn keyword jessFunc mod modify multifieldp
67 syn keyword jessFunc neq new not
68 syn keyword jessFunc nth$ numberp oddp
69 syn keyword jessFunc open or pi
70 syn keyword jessFunc ppdeffunction ppdefglobal ddpefrule
71 syn keyword jessFunc printout random read
72 syn keyword jessFunc readline replace$ reset
73 syn keyword jessFunc rest$ retract retract-string
74 syn keyword jessFunc return round rules
75 syn keyword jessFunc run run-query run-until-halt
76 syn keyword jessFunc save-facts set set-fact-duplication
77 syn keyword jessFunc set-factory set-member set-multithreaded-io
78 syn keyword jessFunc set-node-index-hash set-reset-globals
79 syn keyword jessFunc set-salience-evaluation set-strategy
80 syn keyword jessFunc setgen show-deffacts show-deftemplates
81 syn keyword jessFunc show-jess-listeners socket
82 syn keyword jessFunc sqrt store str-cat
83 syn keyword jessFunc str-compare str-index str-length
84 syn keyword jessFunc stringp sub-string subseq$
85 syn keyword jessFunc subsetp sym-cat symbolp
86 syn keyword jessFunc system throw time
87 syn keyword jessFunc try undefadvice undefinstance
88 syn keyword jessFunc undefrule union$ unwatch
89 syn keyword jessFunc upcase view watch
90 syn keyword jessFunc while
91 syn match jessFunc "\<c[ad]\+r\>"
93 " jess Keywords (modifiers)
94 syn keyword jessKey defglobal deffunction defrule
95 syn keyword jessKey deffacts
96 syn keyword jessKey defadvice defclass definstance
98 " Standard jess Variables
99 syn region jessVar start="?" end="[^a-zA-Z0-9]"me=e-1
102 syn region jessString start=+"+ skip=+\\"+ end=+"+
104 " Shared with Declarations, Macros, Functions
105 "syn keyword jessDeclaration
107 syn match jessNumber "[0-9]\+"
109 syn match jessSpecial "\*[a-zA-Z_][a-zA-Z_0-9-]*\*"
110 syn match jessSpecial !#|[^()'`,"; \t]\+|#!
111 syn match jessSpecial !#x[0-9a-fA-F]\+!
112 syn match jessSpecial !#o[0-7]\+!
113 syn match jessSpecial !#b[01]\+!
114 syn match jessSpecial !#\\[ -\~]!
115 syn match jessSpecial !#[':][^()'`,"; \t]\+!
116 syn match jessSpecial !#([^()'`,"; \t]\+)!
118 syn match jessConcat "\s\.\s"
119 syntax match jessParenError ")"
122 syn match jessComment ";.*$"
127 " Define the default highlighting.
128 " For version 5.7 and earlier: only when not done already
129 " For version 5.8 and later: only when an item doesn't have highlighting yet
130 if version >= 508 || !exists("did_jess_syntax_inits")
132 let did_jess_syntax_inits = 1
133 command -nargs=+ HiLink hi link <args>
135 command -nargs=+ HiLink hi def link <args>
138 HiLink jessAtomNmbr jessNumber
139 HiLink jessAtomMark jessMark
141 HiLink jessAtom Identifier
142 HiLink jessAtomBarSymbol Special
143 HiLink jessBarSymbol Special
144 HiLink jessComment Comment
145 HiLink jessConcat Statement
146 HiLink jessDeclaration Statement
147 HiLink jessFunc Statement
149 HiLink jessMark Delimiter
150 HiLink jessNumber Number
151 HiLink jessParenError Error
152 HiLink jessSpecial Type
153 HiLink jessString String
154 HiLink jessVar Identifier
159 let b:current_syntax = "jess"