13231
|
1 " Vim syntax file
|
|
2 " Language: Scheme (CHICKEN)
|
13437
|
3 " Last Change: 2018-02-05
|
13231
|
4 " Author: Evan Hanson <evhan@foldling.org>
|
|
5 " Maintainer: Evan Hanson <evhan@foldling.org>
|
|
6 " URL: https://foldling.org/vim/syntax/chicken.vim
|
|
7 " Notes: This is supplemental syntax, to be loaded after the core Scheme
|
|
8 " syntax file (syntax/scheme.vim). Enable it by setting b:is_chicken=1
|
|
9 " and filetype=scheme.
|
|
10
|
|
11 " Only to be used on top of the Scheme syntax.
|
|
12 if !exists('b:did_scheme_syntax')
|
|
13 finish
|
|
14 endif
|
|
15
|
|
16 " Lighten parentheses.
|
13437
|
17 hi! def link schemeParentheses Comment
|
13231
|
18
|
|
19 " foo#bar
|
|
20 syn match schemeExtraSyntax /[^ #'`\t\n()\[\]"|;]\+#[^ '`\t\n()\[\]"|;]\+/
|
|
21
|
|
22 " ##foo#bar
|
|
23 syn match schemeExtraSyntax /##[^ '`\t\n()\[\]"|;]\+/
|
|
24
|
|
25 " Heredocs.
|
|
26 syn region schemeString start=/#<[<#]\s*\z(.*\)/ end=/^\z1$/
|
|
27
|
|
28 " Keywords.
|
|
29 syn match schemeKeyword /#[!:][a-zA-Z0-9!$%&*+-./:<=>?@^_~#]\+/
|
|
30 syn match schemeKeyword /[a-zA-Z0-9!$%&*+-./:<=>?@^_~#]\+:\>/
|
|
31
|
|
32 " C/C++ syntax.
|
|
33 let s:c = globpath(&rtp, 'syntax/cpp.vim', 0, 1)
|
|
34 if len(s:c)
|
|
35 exe 'syn include @c ' s:c[0]
|
|
36 syn region c matchgroup=schemeComment start=/#>/ end=/<#/ contains=@c
|
|
37 endif
|
|
38
|
|
39 syn keyword schemeSyntax define-record
|
|
40
|
|
41 syn keyword schemeLibrarySyntax declare
|
|
42 syn keyword schemeLibrarySyntax module
|
|
43 syn keyword schemeLibrarySyntax reexport
|
|
44 syn keyword schemeLibrarySyntax require-library
|
|
45
|
|
46 syn keyword schemeTypeSyntax -->
|
|
47 syn keyword schemeTypeSyntax ->
|
|
48 syn keyword schemeTypeSyntax :
|
|
49 syn keyword schemeTypeSyntax assume
|
|
50 syn keyword schemeTypeSyntax compiler-typecase
|
|
51 syn keyword schemeTypeSyntax define-specialization
|
|
52 syn keyword schemeTypeSyntax define-type
|
|
53 syn keyword schemeTypeSyntax the
|
|
54
|
|
55 syn keyword schemeExtraSyntax and-let*
|
|
56 syn keyword schemeExtraSyntax match
|
|
57 syn keyword schemeExtraSyntax match-lambda
|
|
58 syn keyword schemeExtraSyntax match-lambda*
|
|
59
|
|
60 syn keyword schemeSpecialSyntax define-compiler-syntax
|
|
61 syn keyword schemeSpecialSyntax define-constant
|
|
62 syn keyword schemeSpecialSyntax define-external
|
|
63 syn keyword schemeSpecialSyntax define-inline
|
|
64 syn keyword schemeSpecialSyntax foreign-code
|
|
65 syn keyword schemeSpecialSyntax foreign-declare
|
|
66 syn keyword schemeSpecialSyntax foreign-lambda
|
|
67 syn keyword schemeSpecialSyntax foreign-lambda*
|
|
68 syn keyword schemeSpecialSyntax foreign-primitive
|
|
69 syn keyword schemeSpecialSyntax foreign-safe-lambda
|
|
70 syn keyword schemeSpecialSyntax foreign-safe-lambda*
|
|
71 syn keyword schemeSpecialSyntax foreign-value
|
|
72
|
|
73 syn keyword schemeSyntaxSyntax begin-for-syntax
|
|
74 syn keyword schemeSyntaxSyntax define-for-syntax
|
|
75 syn keyword schemeSyntaxSyntax er-macro-transformer
|
|
76 syn keyword schemeSyntaxSyntax ir-macro-transformer
|
|
77 syn keyword schemeSyntaxSyntax require-library-for-syntax
|