Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
| 9 | if version < 600 |
| 10 | syntax clear |
| 11 | elseif exists("b:current_syntax") |
| 12 | finish |
| 13 | endif |
| 14 | |
| 15 | if version < 600 |
| 16 | set iskeyword=42,43,45,47-58,60-62,64-90,97-122,_ |
| 17 | else |
| 18 | setlocal iskeyword=42,43,45,47-58,60-62,64-90,97-122,_ |
| 19 | endif |
| 20 | |
| 21 | " Lists |
| 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 |
| 26 | |
| 27 | " Atoms |
| 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 |
| 35 | |
| 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\>" |
| 92 | |
| 93 | " jess Keywords (modifiers) |
| 94 | syn keyword jessKey defglobal deffunction defrule |
| 95 | syn keyword jessKey deffacts |
| 96 | syn keyword jessKey defadvice defclass definstance |
| 97 | |
| 98 | " Standard jess Variables |
| 99 | syn region jessVar start="?" end="[^a-zA-Z0-9]"me=e-1 |
| 100 | |
| 101 | " Strings |
| 102 | syn region jessString start=+"+ skip=+\\"+ end=+"+ |
| 103 | |
| 104 | " Shared with Declarations, Macros, Functions |
| 105 | "syn keyword jessDeclaration |
| 106 | |
| 107 | syn match jessNumber "[0-9]\+" |
| 108 | |
| 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]\+)! |
| 117 | |
| 118 | syn match jessConcat "\s\.\s" |
| 119 | syntax match jessParenError ")" |
| 120 | |
| 121 | " Comments |
| 122 | syn match jessComment ";.*$" |
| 123 | |
| 124 | " synchronization |
| 125 | syn 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 |
| 130 | if 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 |
| 157 | endif |
| 158 | |
| 159 | let b:current_syntax = "jess" |
| 160 | |
| 161 | " vim: ts=18 |