Mercurial > vim
annotate runtime/syntax/scheme.vim @ 9246:6ee88fa405b3 v7.4.1906
commit https://github.com/vim/vim/commit/5f1032d2a55b9417a0a6fa225e35089c98a5a419
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jun 7 22:16:36 2016 +0200
patch 7.4.1906
Problem: Collapsing channel buffers and searching for NL does not work
properly. (Xavier de Gary, Ramel Eshed)
Solution: Do not assume the buffer contains a NUL or not. Change NUL bytes
to NL to avoid the string is truncated.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 07 Jun 2016 22:30:06 +0200 |
parents | bc38030aec7d |
children | 43efa4f5a8ea |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2034 | 2 " Language: Scheme (R5RS + some R6RS extras) |
9116
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
3 " Last Change: 2016 May 23 |
36 | 4 " Maintainer: Sergey Khorev <sergey.khorev@gmail.com> |
17 | 5 " Original author: Dirk van Deun <dirk@igwe.vub.ac.be> |
7 | 6 |
7 " This script incorrectly recognizes some junk input as numerals: | |
8 " parsing the complete system of Scheme numerals using the pattern | |
9 " language is practically impossible: I did a lax approximation. | |
3356 | 10 |
17 | 11 " MzScheme extensions can be activated with setting is_mzscheme variable |
7 | 12 |
13 " Suggestions and bug reports are solicited by the author. | |
14 | |
15 " Initializing: | |
16 | |
17 " For version 5.x: Clear all syntax items | |
18 " For version 6.x: Quit when a syntax file was already loaded | |
19 if version < 600 | |
20 syntax clear | |
21 elseif exists("b:current_syntax") | |
22 finish | |
23 endif | |
24 | |
3356 | 25 let s:cpo_save = &cpo |
26 set cpo&vim | |
27 | |
7 | 28 syn case ignore |
29 | |
30 " Fascist highlighting: everything that doesn't fit the rules is an error... | |
31 | |
2034 | 32 syn match schemeError ![^ \t()\[\]";]*! |
33 syn match schemeError ")" | |
7 | 34 |
35 " Quoted and backquoted stuff | |
36 | |
17 | 37 syn region schemeQuoted matchgroup=Delimiter start="['`]" end=![ \t()\[\]";]!me=e-1 contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc |
7 | 38 |
39 syn region schemeQuoted matchgroup=Delimiter start="['`](" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | |
40 syn region schemeQuoted matchgroup=Delimiter start="['`]#(" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | |
41 | |
42 syn region schemeStrucRestricted matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | |
43 syn region schemeStrucRestricted matchgroup=Delimiter start="#(" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | |
44 | |
17 | 45 " Popular Scheme extension: |
46 " using [] as well as () | |
47 syn region schemeStrucRestricted matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | |
48 syn region schemeStrucRestricted matchgroup=Delimiter start="#\[" matchgroup=Delimiter end="\]" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | |
7 | 49 |
17 | 50 syn region schemeUnquote matchgroup=Delimiter start="," end=![ \t\[\]()";]!me=e-1 contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc |
51 syn region schemeUnquote matchgroup=Delimiter start=",@" end=![ \t\[\]()";]!me=e-1 contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | |
52 | |
53 syn region schemeUnquote matchgroup=Delimiter start=",(" end=")" contains=ALL | |
54 syn region schemeUnquote matchgroup=Delimiter start=",@(" end=")" contains=ALL | |
7 | 55 |
56 syn region schemeUnquote matchgroup=Delimiter start=",#(" end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | |
57 syn region schemeUnquote matchgroup=Delimiter start=",@#(" end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | |
58 | |
17 | 59 syn region schemeUnquote matchgroup=Delimiter start=",\[" end="\]" contains=ALL |
60 syn region schemeUnquote matchgroup=Delimiter start=",@\[" end="\]" contains=ALL | |
61 | |
62 syn region schemeUnquote matchgroup=Delimiter start=",#\[" end="\]" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | |
63 syn region schemeUnquote matchgroup=Delimiter start=",@#\[" end="\]" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | |
64 | |
7 | 65 " R5RS Scheme Functions and Syntax: |
66 | |
67 if version < 600 | |
68 set iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_ | |
69 else | |
70 setlocal iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_ | |
71 endif | |
72 | |
73 syn keyword schemeSyntax lambda and or if cond case define let let* letrec | |
74 syn keyword schemeSyntax begin do delay set! else => | |
75 syn keyword schemeSyntax quote quasiquote unquote unquote-splicing | |
76 syn keyword schemeSyntax define-syntax let-syntax letrec-syntax syntax-rules | |
2034 | 77 " R6RS |
78 syn keyword schemeSyntax define-record-type fields protocol | |
7 | 79 |
80 syn keyword schemeFunc not boolean? eq? eqv? equal? pair? cons car cdr set-car! | |
81 syn keyword schemeFunc set-cdr! caar cadr cdar cddr caaar caadr cadar caddr | |
82 syn keyword schemeFunc cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr | |
83 syn keyword schemeFunc cadaar cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr | |
84 syn keyword schemeFunc cddaar cddadr cdddar cddddr null? list? list length | |
85 syn keyword schemeFunc append reverse list-ref memq memv member assq assv assoc | |
86 syn keyword schemeFunc symbol? symbol->string string->symbol number? complex? | |
87 syn keyword schemeFunc real? rational? integer? exact? inexact? = < > <= >= | |
88 syn keyword schemeFunc zero? positive? negative? odd? even? max min + * - / abs | |
89 syn keyword schemeFunc quotient remainder modulo gcd lcm numerator denominator | |
90 syn keyword schemeFunc floor ceiling truncate round rationalize exp log sin cos | |
91 syn keyword schemeFunc tan asin acos atan sqrt expt make-rectangular make-polar | |
92 syn keyword schemeFunc real-part imag-part magnitude angle exact->inexact | |
93 syn keyword schemeFunc inexact->exact number->string string->number char=? | |
94 syn keyword schemeFunc char-ci=? char<? char-ci<? char>? char-ci>? char<=? | |
95 syn keyword schemeFunc char-ci<=? char>=? char-ci>=? char-alphabetic? char? | |
96 syn keyword schemeFunc char-numeric? char-whitespace? char-upper-case? | |
97 syn keyword schemeFunc char-lower-case? | |
98 syn keyword schemeFunc char->integer integer->char char-upcase char-downcase | |
99 syn keyword schemeFunc string? make-string string string-length string-ref | |
100 syn keyword schemeFunc string-set! string=? string-ci=? string<? string-ci<? | |
101 syn keyword schemeFunc string>? string-ci>? string<=? string-ci<=? string>=? | |
102 syn keyword schemeFunc string-ci>=? substring string-append vector? make-vector | |
103 syn keyword schemeFunc vector vector-length vector-ref vector-set! procedure? | |
104 syn keyword schemeFunc apply map for-each call-with-current-continuation | |
105 syn keyword schemeFunc call-with-input-file call-with-output-file input-port? | |
106 syn keyword schemeFunc output-port? current-input-port current-output-port | |
107 syn keyword schemeFunc open-input-file open-output-file close-input-port | |
108 syn keyword schemeFunc close-output-port eof-object? read read-char peek-char | |
109 syn keyword schemeFunc write display newline write-char call/cc | |
110 syn keyword schemeFunc list-tail string->list list->string string-copy | |
111 syn keyword schemeFunc string-fill! vector->list list->vector vector-fill! | |
112 syn keyword schemeFunc force with-input-from-file with-output-to-file | |
113 syn keyword schemeFunc char-ready? load transcript-on transcript-off eval | |
114 syn keyword schemeFunc dynamic-wind port? values call-with-values | |
115 syn keyword schemeFunc scheme-report-environment null-environment | |
116 syn keyword schemeFunc interaction-environment | |
2034 | 117 " R6RS |
118 syn keyword schemeFunc make-eq-hashtable make-eqv-hashtable make-hashtable | |
119 syn keyword schemeFunc hashtable? hashtable-size hashtable-ref hashtable-set! | |
120 syn keyword schemeFunc hashtable-delete! hashtable-contains? hashtable-update! | |
121 syn keyword schemeFunc hashtable-copy hashtable-clear! hashtable-keys | |
122 syn keyword schemeFunc hashtable-entries hashtable-equivalence-function hashtable-hash-function | |
3356 | 123 syn keyword schemeFunc hashtable-mutable? equal-hash string-hash string-ci-hash symbol-hash |
2034 | 124 syn keyword schemeFunc find for-all exists filter partition fold-left fold-right |
125 syn keyword schemeFunc remp remove remv remq memp assp cons* | |
7 | 126 |
127 " ... so that a single + or -, inside a quoted context, would not be | |
128 " interpreted as a number (outside such contexts, it's a schemeFunc) | |
129 | |
2034 | 130 syn match schemeDelimiter !\.[ \t\[\]()";]!me=e-1 |
131 syn match schemeDelimiter !\.$! | |
7 | 132 " ... and a single dot is not a number but a delimiter |
133 | |
134 " This keeps all other stuff unhighlighted, except *stuff* and <stuff>: | |
135 | |
2034 | 136 syn match schemeOther ,[a-z!$%&*/:<=>?^_~+@#%-][-a-z!$%&*/:<=>?^_~0-9+.@#%]*, |
137 syn match schemeError ,[a-z!$%&*/:<=>?^_~+@#%-][-a-z!$%&*/:<=>?^_~0-9+.@#%]*[^-a-z!$%&*/:<=>?^_~0-9+.@ \t\[\]()";]\+[^ \t\[\]()";]*, | |
7 | 138 |
2034 | 139 syn match schemeOther "\.\.\." |
140 syn match schemeError !\.\.\.[^ \t\[\]()";]\+! | |
7 | 141 " ... a special identifier |
142 | |
2034 | 143 syn match schemeConstant ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]\+\*[ \t\[\]()";],me=e-1 |
144 syn match schemeConstant ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]\+\*$, | |
145 syn match schemeError ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]*\*[^-a-z!$%&*/:<=>?^_~0-9+.@ \t\[\]()";]\+[^ \t\[\]()";]*, | |
7 | 146 |
2034 | 147 syn match schemeConstant ,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>[ \t\[\]()";],me=e-1 |
148 syn match schemeConstant ,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>$, | |
149 syn match schemeError ,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>[^-a-z!$%&*/:<=>?^_~0-9+.@ \t\[\]()";]\+[^ \t\[\]()";]*, | |
7 | 150 |
151 " Non-quoted lists, and strings: | |
152 | |
153 syn region schemeStruc matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALL | |
154 syn region schemeStruc matchgroup=Delimiter start="#(" matchgroup=Delimiter end=")" contains=ALL | |
155 | |
17 | 156 syn region schemeStruc matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]" contains=ALL |
157 syn region schemeStruc matchgroup=Delimiter start="#\[" matchgroup=Delimiter end="\]" contains=ALL | |
158 | |
159 " Simple literals: | |
3513 | 160 syn region schemeString start=+\%(\\\)\@<!"+ skip=+\\[\\"]+ end=+"+ contains=@Spell |
7 | 161 |
162 " Comments: | |
163 | |
3513 | 164 syn match schemeComment ";.*$" contains=@Spell |
7 | 165 |
17 | 166 |
167 " Writing out the complete description of Scheme numerals without | |
168 " using variables is a day's work for a trained secretary... | |
169 | |
2034 | 170 syn match schemeOther ![+-][ \t\[\]()";]!me=e-1 |
171 syn match schemeOther ![+-]$! | |
17 | 172 " |
173 " This is a useful lax approximation: | |
2034 | 174 syn match schemeNumber "[-#+.]\=[0-9][-#+/0-9a-f@i.boxesfdl]*" |
175 syn match schemeError ![-#+0-9.][-#+/0-9a-f@i.boxesfdl]*[^-#+/0-9a-f@i.boxesfdl \t\[\]()";][^ \t\[\]()";]*! | |
17 | 176 |
2034 | 177 syn match schemeBoolean "#[tf]" |
178 syn match schemeError !#[tf][^ \t\[\]()";]\+! | |
17 | 179 |
2034 | 180 syn match schemeCharacter "#\\" |
181 syn match schemeCharacter "#\\." | |
182 syn match schemeError !#\\.[^ \t\[\]()";]\+! | |
183 syn match schemeCharacter "#\\space" | |
184 syn match schemeError !#\\space[^ \t\[\]()";]\+! | |
185 syn match schemeCharacter "#\\newline" | |
186 syn match schemeError !#\\newline[^ \t\[\]()";]\+! | |
187 | |
188 " R6RS | |
189 syn match schemeCharacter "#\\x[0-9a-fA-F]\+" | |
190 | |
17 | 191 |
192 if exists("b:is_mzscheme") || exists("is_mzscheme") | |
36 | 193 " MzScheme extensions |
17 | 194 " multiline comment |
3513 | 195 syn region schemeComment start="#|" end="|#" contains=@Spell |
36 | 196 |
17 | 197 " #%xxx are the special MzScheme identifiers |
2034 | 198 syn match schemeOther "#%[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" |
17 | 199 " anything limited by |'s is identifier |
2034 | 200 syn match schemeOther "|[^|]\+|" |
17 | 201 |
2034 | 202 syn match schemeCharacter "#\\\%(return\|tab\)" |
17 | 203 |
204 " Modules require stmt | |
205 syn keyword schemeExtSyntax module require dynamic-require lib prefix all-except prefix-all-except rename | |
206 " modules provide stmt | |
207 syn keyword schemeExtSyntax provide struct all-from all-from-except all-defined all-defined-except | |
208 " Other from MzScheme | |
209 syn keyword schemeExtSyntax with-handlers when unless instantiate define-struct case-lambda syntax-case | |
210 syn keyword schemeExtSyntax free-identifier=? bound-identifier=? module-identifier=? syntax-object->datum | |
211 syn keyword schemeExtSyntax datum->syntax-object | |
212 syn keyword schemeExtSyntax let-values let*-values letrec-values set!-values fluid-let parameterize begin0 | |
3356 | 213 syn keyword schemeExtSyntax error raise opt-lambda define-values unit unit/sig define-signature |
17 | 214 syn keyword schemeExtSyntax invoke-unit/sig define-values/invoke-unit/sig compound-unit/sig import export |
215 syn keyword schemeExtSyntax link syntax quasisyntax unsyntax with-syntax | |
216 | |
217 syn keyword schemeExtFunc format system-type current-extension-compiler current-extension-linker | |
218 syn keyword schemeExtFunc use-standard-linker use-standard-compiler | |
219 syn keyword schemeExtFunc find-executable-path append-object-suffix append-extension-suffix | |
220 syn keyword schemeExtFunc current-library-collection-paths current-extension-compiler-flags make-parameter | |
221 syn keyword schemeExtFunc current-directory build-path normalize-path current-extension-linker-flags | |
222 syn keyword schemeExtFunc file-exists? directory-exists? delete-directory/files delete-directory delete-file | |
223 syn keyword schemeExtFunc system compile-file system-library-subpath getenv putenv current-standard-link-libraries | |
224 syn keyword schemeExtFunc remove* file-size find-files fold-files directory-list shell-execute split-path | |
225 syn keyword schemeExtFunc current-error-port process/ports process printf fprintf open-input-string open-output-string | |
226 syn keyword schemeExtFunc get-output-string | |
227 " exceptions | |
228 syn keyword schemeExtFunc exn exn:application:arity exn:application:continuation exn:application:fprintf:mismatch | |
229 syn keyword schemeExtFunc exn:application:mismatch exn:application:type exn:application:mismatch exn:break exn:i/o:filesystem exn:i/o:port | |
230 syn keyword schemeExtFunc exn:i/o:port:closed exn:i/o:tcp exn:i/o:udp exn:misc exn:misc:application exn:misc:unsupported exn:module exn:read | |
231 syn keyword schemeExtFunc exn:read:non-char exn:special-comment exn:syntax exn:thread exn:user exn:variable exn:application:mismatch | |
232 syn keyword schemeExtFunc exn? exn:application:arity? exn:application:continuation? exn:application:fprintf:mismatch? exn:application:mismatch? | |
233 syn keyword schemeExtFunc exn:application:type? exn:application:mismatch? exn:break? exn:i/o:filesystem? exn:i/o:port? exn:i/o:port:closed? | |
234 syn keyword schemeExtFunc exn:i/o:tcp? exn:i/o:udp? exn:misc? exn:misc:application? exn:misc:unsupported? exn:module? exn:read? exn:read:non-char? | |
235 syn keyword schemeExtFunc exn:special-comment? exn:syntax? exn:thread? exn:user? exn:variable? exn:application:mismatch? | |
236 " Command-line parsing | |
3356 | 237 syn keyword schemeExtFunc command-line current-command-line-arguments once-any help-labels multi once-each |
17 | 238 |
239 " syntax quoting, unquoting and quasiquotation | |
240 syn region schemeUnquote matchgroup=Delimiter start="#," end=![ \t\[\]()";]!me=e-1 contains=ALL | |
241 syn region schemeUnquote matchgroup=Delimiter start="#,@" end=![ \t\[\]()";]!me=e-1 contains=ALL | |
242 syn region schemeUnquote matchgroup=Delimiter start="#,(" end=")" contains=ALL | |
243 syn region schemeUnquote matchgroup=Delimiter start="#,@(" end=")" contains=ALL | |
244 syn region schemeUnquote matchgroup=Delimiter start="#,\[" end="\]" contains=ALL | |
245 syn region schemeUnquote matchgroup=Delimiter start="#,@\[" end="\]" contains=ALL | |
246 syn region schemeQuoted matchgroup=Delimiter start="#['`]" end=![ \t()\[\]";]!me=e-1 contains=ALL | |
247 syn region schemeQuoted matchgroup=Delimiter start="#['`](" matchgroup=Delimiter end=")" contains=ALL | |
9116
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
248 |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
249 " Identifiers are very liberal in MzScheme/Racket |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
250 syn match schemeOther ![^()[\]{}",'`;#|\\ ]\+! |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
251 |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
252 " Language setting |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
253 syn match schemeLang "#lang [-+_/A-Za-z0-9]\+\>" |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
254 |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
255 " Various number forms |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
256 syn match schemeNumber "[-+]\=[0-9]\+\(\.[0-9]*\)\=\(e[-+]\=[0-9]\+\)\=\>" |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
257 syn match schemeNumber "[-+]\=\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\>" |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
258 syn match schemeNumber "[-+]\=[0-9]\+/[0-9]\+\>" |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
259 syn match schemeNumber "\([-+]\=\([0-9]\+\(\.[0-9]*\)\=\(e[-+]\=[0-9]\+\)\=\|\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\|[0-9]\+/[0-9]\+\)\)\=[-+]\([0-9]\+\(\.[0-9]*\)\=\(e[-+]\=[0-9]\+\)\=\|\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\|[0-9]\+/[0-9]\+\)\=i\>" |
17 | 260 endif |
261 | |
26 | 262 |
263 if exists("b:is_chicken") || exists("is_chicken") | |
36 | 264 " multiline comment |
3513 | 265 syntax region schemeMultilineComment start=/#|/ end=/|#/ contains=@Spell,schemeMultilineComment |
36 | 266 |
2034 | 267 syn match schemeOther "##[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" |
268 syn match schemeExtSyntax "#:[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" | |
26 | 269 |
270 syn keyword schemeExtSyntax unit uses declare hide foreign-declare foreign-parse foreign-parse/spec | |
36 | 271 syn keyword schemeExtSyntax foreign-lambda foreign-lambda* define-external define-macro load-library |
272 syn keyword schemeExtSyntax let-values let*-values letrec-values ->string require-extension | |
273 syn keyword schemeExtSyntax let-optionals let-optionals* define-foreign-variable define-record | |
274 syn keyword schemeExtSyntax pointer tag-pointer tagged-pointer? define-foreign-type | |
275 syn keyword schemeExtSyntax require require-for-syntax cond-expand and-let* receive argc+argv | |
276 syn keyword schemeExtSyntax fixnum? fx= fx> fx< fx>= fx<= fxmin fxmax | |
26 | 277 syn keyword schemeExtFunc ##core#inline ##sys#error ##sys#update-errno |
278 | |
279 " here-string | |
3513 | 280 syn region schemeString start=+#<<\s*\z(.*\)+ end=+^\z1$+ contains=@Spell |
3356 | 281 |
26 | 282 if filereadable(expand("<sfile>:p:h")."/cpp.vim") |
283 unlet! b:current_syntax | |
284 syn include @ChickenC <sfile>:p:h/cpp.vim | |
285 syn region ChickenC matchgroup=schemeOther start=+(\@<=foreign-declare "+ end=+")\@=+ contains=@ChickenC | |
286 syn region ChickenC matchgroup=schemeComment start=+foreign-declare\s*#<<\z(.*\)$+hs=s+15 end=+^\z1$+ contains=@ChickenC | |
287 syn region ChickenC matchgroup=schemeOther start=+(\@<=foreign-parse "+ end=+")\@=+ contains=@ChickenC | |
288 syn region ChickenC matchgroup=schemeComment start=+foreign-parse\s*#<<\z(.*\)$+hs=s+13 end=+^\z1$+ contains=@ChickenC | |
289 syn region ChickenC matchgroup=schemeOther start=+(\@<=foreign-parse/spec "+ end=+")\@=+ contains=@ChickenC | |
290 syn region ChickenC matchgroup=schemeComment start=+foreign-parse/spec\s*#<<\z(.*\)$+hs=s+18 end=+^\z1$+ contains=@ChickenC | |
291 syn region ChickenC matchgroup=schemeComment start=+#>+ end=+<#+ contains=@ChickenC | |
292 syn region ChickenC matchgroup=schemeComment start=+#>?+ end=+<#+ contains=@ChickenC | |
293 syn region ChickenC matchgroup=schemeComment start=+#>!+ end=+<#+ contains=@ChickenC | |
294 syn region ChickenC matchgroup=schemeComment start=+#>\$+ end=+<#+ contains=@ChickenC | |
295 syn region ChickenC matchgroup=schemeComment start=+#>%+ end=+<#+ contains=@ChickenC | |
296 endif | |
297 | |
1619 | 298 " suggested by Alex Queiroz |
2034 | 299 syn match schemeExtSyntax "#![-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" |
3513 | 300 syn region schemeString start=+#<#\s*\z(.*\)+ end=+^\z1$+ contains=@Spell |
26 | 301 endif |
302 | |
7 | 303 " Synchronization and the wrapping up... |
304 | |
305 syn sync match matchPlace grouphere NONE "^[^ \t]" | |
306 " ... i.e. synchronize on a line that starts at the left margin | |
307 | |
308 " Define the default highlighting. | |
309 " For version 5.7 and earlier: only when not done already | |
310 " For version 5.8 and later: only when an item doesn't have highlighting yet | |
311 if version >= 508 || !exists("did_scheme_syntax_inits") | |
312 if version < 508 | |
313 let did_scheme_syntax_inits = 1 | |
314 command -nargs=+ HiLink hi link <args> | |
315 else | |
316 command -nargs=+ HiLink hi def link <args> | |
317 endif | |
318 | |
319 HiLink schemeSyntax Statement | |
320 HiLink schemeFunc Function | |
321 | |
322 HiLink schemeString String | |
2034 | 323 HiLink schemeCharacter Character |
7 | 324 HiLink schemeNumber Number |
325 HiLink schemeBoolean Boolean | |
326 | |
327 HiLink schemeDelimiter Delimiter | |
26 | 328 HiLink schemeConstant Constant |
7 | 329 |
330 HiLink schemeComment Comment | |
17 | 331 HiLink schemeMultilineComment Comment |
7 | 332 HiLink schemeError Error |
333 | |
26 | 334 HiLink schemeExtSyntax Type |
335 HiLink schemeExtFunc PreProc | |
9116
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
336 |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
337 HiLink schemeLang PreProc |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
3513
diff
changeset
|
338 |
7 | 339 delcommand HiLink |
340 endif | |
341 | |
342 let b:current_syntax = "scheme" | |
3356 | 343 |
344 let &cpo = s:cpo_save | |
345 unlet s:cpo_save |