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