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