| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Vim syntax file | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | " Language:	Scheme (R5RS + some R6RS extras) | 
					
						
							| 
									
										
										
										
											2016-05-24 20:02:38 +02:00
										 |  |  | " Last Change:	2016 May 23 | 
					
						
							| 
									
										
										
										
											2004-12-09 21:34:53 +00:00
										 |  |  | " Maintainer:	Sergey Khorev <sergey.khorev@gmail.com> | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | " Original author:	Dirk van Deun <dirk@igwe.vub.ac.be> | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " This script incorrectly recognizes some junk input as numerals: | 
					
						
							|  |  |  | " parsing the complete system of Scheme numerals using the pattern | 
					
						
							|  |  |  | " language is practically impossible: I did a lax approximation. | 
					
						
							| 
									
										
										
										
											2012-02-13 00:05:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | " MzScheme extensions can be activated with setting is_mzscheme variable | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Suggestions and bug reports are solicited by the author. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Initializing: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " quit when a syntax file was already loaded | 
					
						
							|  |  |  | if exists("b:current_syntax") | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-13 00:05:22 +01:00
										 |  |  | let s:cpo_save = &cpo | 
					
						
							|  |  |  | set cpo&vim | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | syn case ignore | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Fascist highlighting: everything that doesn't fit the rules is an error... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | syn match	schemeError	![^ \t()\[\]";]*! | 
					
						
							|  |  |  | syn match	schemeError	")" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Quoted and backquoted stuff | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | syn region schemeQuoted matchgroup=Delimiter start="['`]" end=![ \t()\[\]";]!me=e-1 contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | syn region schemeQuoted matchgroup=Delimiter start="['`](" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							|  |  |  | syn region schemeQuoted matchgroup=Delimiter start="['`]#(" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn region schemeStrucRestricted matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							|  |  |  | syn region schemeStrucRestricted matchgroup=Delimiter start="#(" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | " Popular Scheme extension: | 
					
						
							|  |  |  | " using [] as well as () | 
					
						
							|  |  |  | syn region schemeStrucRestricted matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							|  |  |  | syn region schemeStrucRestricted matchgroup=Delimiter start="#\[" matchgroup=Delimiter end="\]" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | syn region schemeUnquote matchgroup=Delimiter start="," end=![ \t\[\]()";]!me=e-1 contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							|  |  |  | syn region schemeUnquote matchgroup=Delimiter start=",@" end=![ \t\[\]()";]!me=e-1 contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn region schemeUnquote matchgroup=Delimiter start=",(" end=")" contains=ALL | 
					
						
							|  |  |  | syn region schemeUnquote matchgroup=Delimiter start=",@(" end=")" contains=ALL | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | syn region schemeUnquote matchgroup=Delimiter start=",#(" end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							|  |  |  | syn region schemeUnquote matchgroup=Delimiter start=",@#(" end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | syn region schemeUnquote matchgroup=Delimiter start=",\[" end="\]" contains=ALL | 
					
						
							|  |  |  | syn region schemeUnquote matchgroup=Delimiter start=",@\[" end="\]" contains=ALL | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn region schemeUnquote matchgroup=Delimiter start=",#\[" end="\]" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							|  |  |  | syn region schemeUnquote matchgroup=Delimiter start=",@#\[" end="\]" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " R5RS Scheme Functions and Syntax: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | setlocal iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_ | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | syn keyword schemeSyntax lambda and or if cond case define let let* letrec | 
					
						
							|  |  |  | syn keyword schemeSyntax begin do delay set! else => | 
					
						
							|  |  |  | syn keyword schemeSyntax quote quasiquote unquote unquote-splicing | 
					
						
							|  |  |  | syn keyword schemeSyntax define-syntax let-syntax letrec-syntax syntax-rules | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | " R6RS | 
					
						
							|  |  |  | syn keyword schemeSyntax define-record-type fields protocol | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | syn keyword schemeFunc not boolean? eq? eqv? equal? pair? cons car cdr set-car! | 
					
						
							|  |  |  | syn keyword schemeFunc set-cdr! caar cadr cdar cddr caaar caadr cadar caddr | 
					
						
							|  |  |  | syn keyword schemeFunc cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr | 
					
						
							|  |  |  | syn keyword schemeFunc cadaar cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr | 
					
						
							|  |  |  | syn keyword schemeFunc cddaar cddadr cdddar cddddr null? list? list length | 
					
						
							|  |  |  | syn keyword schemeFunc append reverse list-ref memq memv member assq assv assoc | 
					
						
							|  |  |  | syn keyword schemeFunc symbol? symbol->string string->symbol number? complex? | 
					
						
							|  |  |  | syn keyword schemeFunc real? rational? integer? exact? inexact? = < > <= >= | 
					
						
							|  |  |  | syn keyword schemeFunc zero? positive? negative? odd? even? max min + * - / abs | 
					
						
							|  |  |  | syn keyword schemeFunc quotient remainder modulo gcd lcm numerator denominator | 
					
						
							|  |  |  | syn keyword schemeFunc floor ceiling truncate round rationalize exp log sin cos | 
					
						
							|  |  |  | syn keyword schemeFunc tan asin acos atan sqrt expt make-rectangular make-polar | 
					
						
							|  |  |  | syn keyword schemeFunc real-part imag-part magnitude angle exact->inexact | 
					
						
							|  |  |  | syn keyword schemeFunc inexact->exact number->string string->number char=? | 
					
						
							|  |  |  | syn keyword schemeFunc char-ci=? char<? char-ci<? char>? char-ci>? char<=? | 
					
						
							|  |  |  | syn keyword schemeFunc char-ci<=? char>=? char-ci>=? char-alphabetic? char? | 
					
						
							|  |  |  | syn keyword schemeFunc char-numeric? char-whitespace? char-upper-case? | 
					
						
							|  |  |  | syn keyword schemeFunc char-lower-case? | 
					
						
							|  |  |  | syn keyword schemeFunc char->integer integer->char char-upcase char-downcase | 
					
						
							|  |  |  | syn keyword schemeFunc string? make-string string string-length string-ref | 
					
						
							|  |  |  | syn keyword schemeFunc string-set! string=? string-ci=? string<? string-ci<? | 
					
						
							|  |  |  | syn keyword schemeFunc string>? string-ci>? string<=? string-ci<=? string>=? | 
					
						
							|  |  |  | syn keyword schemeFunc string-ci>=? substring string-append vector? make-vector | 
					
						
							|  |  |  | syn keyword schemeFunc vector vector-length vector-ref vector-set! procedure? | 
					
						
							|  |  |  | syn keyword schemeFunc apply map for-each call-with-current-continuation | 
					
						
							|  |  |  | syn keyword schemeFunc call-with-input-file call-with-output-file input-port? | 
					
						
							|  |  |  | syn keyword schemeFunc output-port? current-input-port current-output-port | 
					
						
							|  |  |  | syn keyword schemeFunc open-input-file open-output-file close-input-port | 
					
						
							|  |  |  | syn keyword schemeFunc close-output-port eof-object? read read-char peek-char | 
					
						
							|  |  |  | syn keyword schemeFunc write display newline write-char call/cc | 
					
						
							|  |  |  | syn keyword schemeFunc list-tail string->list list->string string-copy | 
					
						
							|  |  |  | syn keyword schemeFunc string-fill! vector->list list->vector vector-fill! | 
					
						
							|  |  |  | syn keyword schemeFunc force with-input-from-file with-output-to-file | 
					
						
							|  |  |  | syn keyword schemeFunc char-ready? load transcript-on transcript-off eval | 
					
						
							|  |  |  | syn keyword schemeFunc dynamic-wind port? values call-with-values | 
					
						
							|  |  |  | syn keyword schemeFunc scheme-report-environment null-environment | 
					
						
							|  |  |  | syn keyword schemeFunc interaction-environment | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | " R6RS | 
					
						
							|  |  |  | syn keyword schemeFunc make-eq-hashtable make-eqv-hashtable make-hashtable | 
					
						
							|  |  |  | syn keyword schemeFunc hashtable? hashtable-size hashtable-ref hashtable-set! | 
					
						
							|  |  |  | syn keyword schemeFunc hashtable-delete! hashtable-contains? hashtable-update! | 
					
						
							|  |  |  | syn keyword schemeFunc hashtable-copy hashtable-clear! hashtable-keys | 
					
						
							|  |  |  | syn keyword schemeFunc hashtable-entries hashtable-equivalence-function hashtable-hash-function | 
					
						
							| 
									
										
										
										
											2012-02-13 00:05:22 +01:00
										 |  |  | syn keyword schemeFunc hashtable-mutable? equal-hash string-hash string-ci-hash symbol-hash | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | syn keyword schemeFunc find for-all exists filter partition fold-left fold-right | 
					
						
							|  |  |  | syn keyword schemeFunc remp remove remv remq memp assp cons* | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " ... so that a single + or -, inside a quoted context, would not be | 
					
						
							|  |  |  | " interpreted as a number (outside such contexts, it's a schemeFunc) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | syn match	schemeDelimiter	!\.[ \t\[\]()";]!me=e-1 | 
					
						
							|  |  |  | syn match	schemeDelimiter	!\.$! | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " ... and a single dot is not a number but a delimiter | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " This keeps all other stuff unhighlighted, except *stuff* and <stuff>: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | syn match	schemeOther	,[a-z!$%&*/:<=>?^_~+@#%-][-a-z!$%&*/:<=>?^_~0-9+.@#%]*, | 
					
						
							|  |  |  | syn match	schemeError	,[a-z!$%&*/:<=>?^_~+@#%-][-a-z!$%&*/:<=>?^_~0-9+.@#%]*[^-a-z!$%&*/:<=>?^_~0-9+.@ \t\[\]()";]\+[^ \t\[\]()";]*, | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | syn match	schemeOther	"\.\.\." | 
					
						
							|  |  |  | syn match	schemeError	!\.\.\.[^ \t\[\]()";]\+! | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " ... a special identifier | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | syn match	schemeConstant	,\*[-a-z!$%&*/:<=>?^_~0-9+.@]\+\*[ \t\[\]()";],me=e-1 | 
					
						
							|  |  |  | syn match	schemeConstant	,\*[-a-z!$%&*/:<=>?^_~0-9+.@]\+\*$, | 
					
						
							|  |  |  | syn match	schemeError	,\*[-a-z!$%&*/:<=>?^_~0-9+.@]*\*[^-a-z!$%&*/:<=>?^_~0-9+.@ \t\[\]()";]\+[^ \t\[\]()";]*, | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | syn match	schemeConstant	,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>[ \t\[\]()";],me=e-1 | 
					
						
							|  |  |  | syn match	schemeConstant	,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>$, | 
					
						
							|  |  |  | syn match	schemeError	,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>[^-a-z!$%&*/:<=>?^_~0-9+.@ \t\[\]()";]\+[^ \t\[\]()";]*, | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Non-quoted lists, and strings: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn region schemeStruc matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALL | 
					
						
							|  |  |  | syn region schemeStruc matchgroup=Delimiter start="#(" matchgroup=Delimiter end=")" contains=ALL | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | syn region schemeStruc matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]" contains=ALL | 
					
						
							|  |  |  | syn region schemeStruc matchgroup=Delimiter start="#\[" matchgroup=Delimiter end="\]" contains=ALL | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Simple literals: | 
					
						
							| 
									
										
										
										
											2012-05-18 13:46:39 +02:00
										 |  |  | syn region schemeString start=+\%(\\\)\@<!"+ skip=+\\[\\"]+ end=+"+ contains=@Spell | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Comments: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-18 13:46:39 +02:00
										 |  |  | syn match	schemeComment	";.*$" contains=@Spell | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Writing out the complete description of Scheme numerals without | 
					
						
							|  |  |  | " using variables is a day's work for a trained secretary... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | syn match	schemeOther	![+-][ \t\[\]()";]!me=e-1 | 
					
						
							|  |  |  | syn match	schemeOther	![+-]$! | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | " | 
					
						
							|  |  |  | " This is a useful lax approximation: | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | syn match	schemeNumber	"[-#+.]\=[0-9][-#+/0-9a-f@i.boxesfdl]*" | 
					
						
							|  |  |  | syn match	schemeError	![-#+0-9.][-#+/0-9a-f@i.boxesfdl]*[^-#+/0-9a-f@i.boxesfdl \t\[\]()";][^ \t\[\]()";]*! | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | syn match	schemeBoolean	"#[tf]" | 
					
						
							|  |  |  | syn match	schemeError	!#[tf][^ \t\[\]()";]\+! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn match	schemeCharacter	"#\\" | 
					
						
							|  |  |  | syn match	schemeCharacter	"#\\." | 
					
						
							|  |  |  | syn match       schemeError	!#\\.[^ \t\[\]()";]\+! | 
					
						
							|  |  |  | syn match	schemeCharacter	"#\\space" | 
					
						
							|  |  |  | syn match	schemeError	!#\\space[^ \t\[\]()";]\+! | 
					
						
							|  |  |  | syn match	schemeCharacter	"#\\newline" | 
					
						
							|  |  |  | syn match	schemeError	!#\\newline[^ \t\[\]()";]\+! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " R6RS | 
					
						
							|  |  |  | syn match schemeCharacter "#\\x[0-9a-fA-F]\+" | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if exists("b:is_mzscheme") || exists("is_mzscheme") | 
					
						
							| 
									
										
										
										
											2004-12-09 21:34:53 +00:00
										 |  |  |     " MzScheme extensions | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  |     " multiline comment | 
					
						
							| 
									
										
										
										
											2012-05-18 13:46:39 +02:00
										 |  |  |     syn region	schemeComment start="#|" end="|#" contains=@Spell | 
					
						
							| 
									
										
										
										
											2004-12-09 21:34:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  |     " #%xxx are the special MzScheme identifiers | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  |     syn match schemeOther "#%[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  |     " anything limited by |'s is identifier | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  |     syn match schemeOther "|[^|]\+|" | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  |     syn match	schemeCharacter	"#\\\%(return\|tab\)" | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     " Modules require stmt | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax module require dynamic-require lib prefix all-except prefix-all-except rename | 
					
						
							|  |  |  |     " modules provide stmt | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax provide struct all-from all-from-except all-defined all-defined-except | 
					
						
							|  |  |  |     " Other from MzScheme | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax with-handlers when unless instantiate define-struct case-lambda syntax-case | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax free-identifier=? bound-identifier=? module-identifier=? syntax-object->datum | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax datum->syntax-object | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax let-values let*-values letrec-values set!-values fluid-let parameterize begin0 | 
					
						
							| 
									
										
										
										
											2012-02-13 00:05:22 +01:00
										 |  |  |     syn keyword schemeExtSyntax error raise opt-lambda define-values unit unit/sig define-signature | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  |     syn keyword schemeExtSyntax invoke-unit/sig define-values/invoke-unit/sig compound-unit/sig import export | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax link syntax quasisyntax unsyntax with-syntax | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     syn keyword schemeExtFunc format system-type current-extension-compiler current-extension-linker | 
					
						
							|  |  |  |     syn keyword schemeExtFunc use-standard-linker use-standard-compiler | 
					
						
							|  |  |  |     syn keyword schemeExtFunc find-executable-path append-object-suffix append-extension-suffix | 
					
						
							|  |  |  |     syn keyword schemeExtFunc current-library-collection-paths current-extension-compiler-flags make-parameter | 
					
						
							|  |  |  |     syn keyword schemeExtFunc current-directory build-path normalize-path current-extension-linker-flags | 
					
						
							|  |  |  |     syn keyword schemeExtFunc file-exists? directory-exists? delete-directory/files delete-directory delete-file | 
					
						
							|  |  |  |     syn keyword schemeExtFunc system compile-file system-library-subpath getenv putenv current-standard-link-libraries | 
					
						
							|  |  |  |     syn keyword schemeExtFunc remove* file-size find-files fold-files directory-list shell-execute split-path | 
					
						
							|  |  |  |     syn keyword schemeExtFunc current-error-port process/ports process printf fprintf open-input-string open-output-string | 
					
						
							|  |  |  |     syn keyword schemeExtFunc get-output-string | 
					
						
							|  |  |  |     " exceptions | 
					
						
							|  |  |  |     syn keyword schemeExtFunc exn exn:application:arity exn:application:continuation exn:application:fprintf:mismatch | 
					
						
							|  |  |  |     syn keyword schemeExtFunc exn:application:mismatch exn:application:type exn:application:mismatch exn:break exn:i/o:filesystem exn:i/o:port | 
					
						
							|  |  |  |     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 | 
					
						
							|  |  |  |     syn keyword schemeExtFunc exn:read:non-char exn:special-comment exn:syntax exn:thread exn:user exn:variable exn:application:mismatch | 
					
						
							|  |  |  |     syn keyword schemeExtFunc exn? exn:application:arity? exn:application:continuation? exn:application:fprintf:mismatch? exn:application:mismatch? | 
					
						
							|  |  |  |     syn keyword schemeExtFunc exn:application:type? exn:application:mismatch? exn:break? exn:i/o:filesystem? exn:i/o:port? exn:i/o:port:closed? | 
					
						
							|  |  |  |     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? | 
					
						
							|  |  |  |     syn keyword schemeExtFunc exn:special-comment? exn:syntax? exn:thread? exn:user? exn:variable? exn:application:mismatch? | 
					
						
							|  |  |  |     " Command-line parsing | 
					
						
							| 
									
										
										
										
											2012-02-13 00:05:22 +01:00
										 |  |  |     syn keyword schemeExtFunc command-line current-command-line-arguments once-any help-labels multi once-each | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     " syntax quoting, unquoting and quasiquotation | 
					
						
							|  |  |  |     syn region schemeUnquote matchgroup=Delimiter start="#," end=![ \t\[\]()";]!me=e-1 contains=ALL | 
					
						
							|  |  |  |     syn region schemeUnquote matchgroup=Delimiter start="#,@" end=![ \t\[\]()";]!me=e-1 contains=ALL | 
					
						
							|  |  |  |     syn region schemeUnquote matchgroup=Delimiter start="#,(" end=")" contains=ALL | 
					
						
							|  |  |  |     syn region schemeUnquote matchgroup=Delimiter start="#,@(" end=")" contains=ALL | 
					
						
							|  |  |  |     syn region schemeUnquote matchgroup=Delimiter start="#,\[" end="\]" contains=ALL | 
					
						
							|  |  |  |     syn region schemeUnquote matchgroup=Delimiter start="#,@\[" end="\]" contains=ALL | 
					
						
							|  |  |  |     syn region schemeQuoted matchgroup=Delimiter start="#['`]" end=![ \t()\[\]";]!me=e-1 contains=ALL | 
					
						
							|  |  |  |     syn region schemeQuoted matchgroup=Delimiter start="#['`](" matchgroup=Delimiter end=")" contains=ALL | 
					
						
							| 
									
										
										
										
											2016-05-24 20:02:38 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     " Identifiers are very liberal in MzScheme/Racket | 
					
						
							|  |  |  |     syn match schemeOther ![^()[\]{}",'`;#|\\ ]\+! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     " Language setting | 
					
						
							|  |  |  |     syn match schemeLang "#lang [-+_/A-Za-z0-9]\+\>" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     " Various number forms | 
					
						
							|  |  |  |     syn match schemeNumber "[-+]\=[0-9]\+\(\.[0-9]*\)\=\(e[-+]\=[0-9]\+\)\=\>" | 
					
						
							|  |  |  |     syn match schemeNumber "[-+]\=\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\>" | 
					
						
							|  |  |  |     syn match schemeNumber "[-+]\=[0-9]\+/[0-9]\+\>" | 
					
						
							|  |  |  |     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\>" | 
					
						
							| 
									
										
										
										
											2004-07-16 20:18:37 +00:00
										 |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | if exists("b:is_chicken") || exists("is_chicken") | 
					
						
							| 
									
										
										
										
											2004-12-09 21:34:53 +00:00
										 |  |  |     " multiline comment | 
					
						
							| 
									
										
										
										
											2012-05-18 13:46:39 +02:00
										 |  |  |     syntax region schemeMultilineComment start=/#|/ end=/|#/ contains=@Spell,schemeMultilineComment | 
					
						
							| 
									
										
										
										
											2004-12-09 21:34:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  |     syn match schemeOther "##[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" | 
					
						
							|  |  |  |     syn match schemeExtSyntax "#:[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax unit uses declare hide foreign-declare foreign-parse foreign-parse/spec | 
					
						
							| 
									
										
										
										
											2004-12-09 21:34:53 +00:00
										 |  |  |     syn keyword schemeExtSyntax foreign-lambda foreign-lambda* define-external define-macro load-library | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax let-values let*-values letrec-values ->string require-extension | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax let-optionals let-optionals* define-foreign-variable define-record | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax pointer tag-pointer tagged-pointer? define-foreign-type | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax require require-for-syntax cond-expand and-let* receive argc+argv | 
					
						
							|  |  |  |     syn keyword schemeExtSyntax fixnum? fx= fx> fx< fx>= fx<= fxmin fxmax | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  |     syn keyword schemeExtFunc ##core#inline ##sys#error ##sys#update-errno | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     " here-string | 
					
						
							| 
									
										
										
										
											2012-05-18 13:46:39 +02:00
										 |  |  |     syn region schemeString start=+#<<\s*\z(.*\)+ end=+^\z1$+ contains=@Spell | 
					
						
							| 
									
										
										
										
											2012-02-13 00:05:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  |     if filereadable(expand("<sfile>:p:h")."/cpp.vim") | 
					
						
							|  |  |  | 	unlet! b:current_syntax | 
					
						
							|  |  |  | 	syn include @ChickenC <sfile>:p:h/cpp.vim | 
					
						
							|  |  |  | 	syn region ChickenC matchgroup=schemeOther start=+(\@<=foreign-declare "+ end=+")\@=+ contains=@ChickenC | 
					
						
							|  |  |  | 	syn region ChickenC matchgroup=schemeComment start=+foreign-declare\s*#<<\z(.*\)$+hs=s+15 end=+^\z1$+ contains=@ChickenC | 
					
						
							|  |  |  | 	syn region ChickenC matchgroup=schemeOther start=+(\@<=foreign-parse "+ end=+")\@=+ contains=@ChickenC | 
					
						
							|  |  |  | 	syn region ChickenC matchgroup=schemeComment start=+foreign-parse\s*#<<\z(.*\)$+hs=s+13 end=+^\z1$+ contains=@ChickenC | 
					
						
							|  |  |  | 	syn region ChickenC matchgroup=schemeOther start=+(\@<=foreign-parse/spec "+ end=+")\@=+ contains=@ChickenC | 
					
						
							|  |  |  | 	syn region ChickenC matchgroup=schemeComment start=+foreign-parse/spec\s*#<<\z(.*\)$+hs=s+18 end=+^\z1$+ contains=@ChickenC | 
					
						
							|  |  |  | 	syn region ChickenC matchgroup=schemeComment start=+#>+ end=+<#+ contains=@ChickenC | 
					
						
							|  |  |  | 	syn region ChickenC matchgroup=schemeComment start=+#>?+ end=+<#+ contains=@ChickenC | 
					
						
							|  |  |  | 	syn region ChickenC matchgroup=schemeComment start=+#>!+ end=+<#+ contains=@ChickenC | 
					
						
							|  |  |  | 	syn region ChickenC matchgroup=schemeComment start=+#>\$+ end=+<#+ contains=@ChickenC | 
					
						
							|  |  |  | 	syn region ChickenC matchgroup=schemeComment start=+#>%+ end=+<#+ contains=@ChickenC | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-24 20:39:31 +00:00
										 |  |  |     " suggested by Alex Queiroz | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  |     syn match schemeExtSyntax "#![-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" | 
					
						
							| 
									
										
										
										
											2012-05-18 13:46:39 +02:00
										 |  |  |     syn region schemeString start=+#<#\s*\z(.*\)+ end=+^\z1$+ contains=@Spell | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Synchronization and the wrapping up... | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn sync match matchPlace grouphere NONE "^[^ \t]" | 
					
						
							|  |  |  | " ... i.e. synchronize on a line that starts at the left margin | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Define the default highlighting. | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Only when an item doesn't have highlighting yet | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  | hi def link schemeSyntax		Statement | 
					
						
							|  |  |  | hi def link schemeFunc		Function | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  | hi def link schemeString		String | 
					
						
							|  |  |  | hi def link schemeCharacter	Character | 
					
						
							|  |  |  | hi def link schemeNumber		Number | 
					
						
							|  |  |  | hi def link schemeBoolean		Boolean | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  | hi def link schemeDelimiter	Delimiter | 
					
						
							|  |  |  | hi def link schemeConstant		Constant | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  | hi def link schemeComment		Comment | 
					
						
							|  |  |  | hi def link schemeMultilineComment	Comment | 
					
						
							|  |  |  | hi def link schemeError		Error | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  | hi def link schemeExtSyntax	Type | 
					
						
							|  |  |  | hi def link schemeExtFunc		PreProc | 
					
						
							| 
									
										
										
										
											2016-05-24 20:02:38 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  | hi def link schemeLang		PreProc | 
					
						
							| 
									
										
										
										
											2016-05-24 20:02:38 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | let b:current_syntax = "scheme" | 
					
						
							| 
									
										
										
										
											2012-02-13 00:05:22 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | let &cpo = s:cpo_save | 
					
						
							|  |  |  | unlet s:cpo_save |