Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
(number) @constant.numeric
(character) @constant.character
(boolean) @constant.builtin.boolean

(string) @string

(escape_sequence) @constant.character.escape

(comment) @comment.line
(block_comment) @comment.block
(directive) @keyword.directive

; variables

((symbol) @variable.builtin
  (#eq? @variable.builtin "..."))

((symbol) @variable.builtin
  (#eq? @variable.builtin "."))

(symbol) @variable

["(" ")" "[" "]" "{" "}"] @punctuation.bracket

(quote "'") @operator
(unquote_splicing ",@") @operator
(unquote ",") @operator
(quasiquote "`") @operator

; procedure

(list
  .
  (symbol) @function)

; special forms

(list
  "["
  (symbol)+ @variable
  "]")

(list
  .
  (symbol) @_f
  .
  (list
    (symbol) @variable)
  (#any-of? @_f "lambda" "λ" "define-values"))

(list
  .
  (symbol) @_f
  (list
    .
    (list
      (symbol) @variable))
  (#eq? @_f "case-lambda"))

(list
  .
  (symbol) @_f
  .
  (list
    (list
      (symbol) @variable.parameter))
  (#any-of? @_f
    "let" "let*" "let-syntax" "let-values" "let*-values" "letrec" "letrec*" "letrec-syntax" "do"))

; operators

((symbol) @operator
  (#any-of? @operator "+" "-" "*" "/" "=" ">" "<" ">=" "<="))

; library

(list
  .
  (symbol) @_lib
  .
  (symbol) @namespace

  (#eq? @_lib "library"))

; quote

(list
  .
  (symbol) @_f
  (#eq? @_f "quote")) @string.symbol

; keywords

(list
  .
  ((symbol) @keyword.conditional
   (#any-of? @keyword.conditional "if" "cond" "case" "when" "unless")))

(list
  .
  (symbol) @keyword
  (#any-of? @keyword
    "define-syntax" "let*" "lambda" "λ" "case-lambda" "case" "=>" "quote-splicing" "unquote-splicing"
    "set!" "let" "letrec" "letrec-syntax" "let-values" "let*-values" "do" "else" "define" "cond"
    "syntax-rules" "unquote" "begin" "quote" "let-syntax" "and" "if" "quasiquote" "letrec" "delay"
    "or" "when" "unless" "identifier-syntax" "assert" "library" "export" "import" "rename" "only"
    "except" "prefix" "define-values"))

(list
  .
  (symbol) @function.builtin
  (#any-of? @function.builtin
    "caar" "cadr" "call-with-input-file" "call-with-output-file" "cdar" "cddr" "list"
    "open-input-file" "open-output-file" "with-input-from-file" "with-output-to-file" "*" "+" "-"
    "/" "<" "<=" "=" ">" ">=" "abs" "acos" "angle" "append" "apply" "asin" "assoc" "assq" "assv"
    "atan" "boolean?" "caaaar" "caaadr" "caaar" "caadar" "caaddr" "caadr" "cadaar" "cadadr" "cadar"
    "caddar" "cadddr" "caddr" "call-with-current-continuation" "call-with-values" "car" "cdaaar"
    "cdaadr" "cdaar" "cdadar" "cdaddr" "cdadr" "cddaar" "cddadr" "cddar" "cdddar" "cddddr" "cdddr"
    "cdr" "ceiling" "char->integer" "char-alphabetic?" "char-ci<=?" "char-ci<?" "char-ci=?"
    "char-ci>=?" "char-ci>?" "char-downcase" "char-lower-case?" "char-numeric?" "char-ready?"
    "char-upcase" "char-upper-case?" "char-whitespace?" "char<=?" "char<?" "char=?" "char>=?"
    "char>?" "char?" "close-input-port" "close-output-port" "complex?" "cons" "cos"
    "current-error-port" "current-input-port" "current-output-port" "denominator" "display"
    "dynamic-wind" "eof-object?" "eq?" "equal?" "eqv?" "eval" "even?" "exact->inexact" "exact?" "exp"
    "expt" "floor" "flush-output" "for-each" "force" "gcd" "imag-part" "inexact->exact" "inexact?"
    "input-port?" "integer->char" "integer?" "interaction-environment" "lcm" "length" "list->string"
    "list->vector" "list-ref" "list-tail" "list?" "load" "log" "magnitude" "make-polar"
    "make-rectangular" "make-string" "make-vector" "map" "max" "member" "memq" "memv" "min" "modulo"
    "negative?" "newline" "not" "null-environment" "null?" "number->string" "number?" "numerator"
    "odd?" "output-port?" "pair?" "peek-char" "positive?" "procedure?" "quotient" "rational?"
    "rationalize" "read" "read-char" "real-part" "real?" "remainder" "reverse" "round"
    "scheme-report-environment" "set-car!" "set-cdr!" "sin" "sqrt" "string" "string->list"
    "string->number" "string->symbol" "string-append" "string-ci<=?" "string-ci<?" "string-ci=?"
    "string-ci>=?" "string-ci>?" "string-copy" "string-fill!" "string-length" "string-ref"
    "string-set!" "string<=?" "string<?" "string=?" "string>=?" "string>?" "string?" "substring"
    "symbol->string" "symbol?" "tan" "transcript-off" "transcript-on" "truncate" "values" "vector"
    "vector->list" "vector-fill!" "vector-length" "vector-ref" "vector-set!" "vector?" "write"
    "write-char" "zero?"))