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