-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGauche.JSON-tmLanguage
173 lines (173 loc) · 6.2 KB
/
Gauche.JSON-tmLanguage
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
{ "name": "Gauche",
"scopeName": "source.gauche",
"fileTypes": ["scm"],
"patterns": [
{ "name": "comment.line.semicolon.gauche",
"comment": "comment",
"match": ";.*$\\n?"
},
{ "name": "comment.block.gauche",
"comment": "block comment",
"begin": "\\#\\|",
"patterns": [
{ "include": "$self" }
],
"end": "\\|\\#"
},
{ "name": "meta.character.gauche",
"comment": "reader syntax",
"match": "(?<=(\\(|\\s|\\)))(\\#\\,)\\(",
"captures": {
"2": { "name": "comment.character.gauche" }
}
},
{ "name": "meta.language.gauche",
"comment": "#f, #t",
"match": "(?<=(\\(|\\s|\\)))((\\s*(#(f|t)))*)(\\(|\\s|\\))",
"captures": {
"2": { "name": "constant.language.gauche" }
}
},
{ "name": "meta.numeric.gauche",
"comment": "number",
"match": "(?<=(\\(|\\s|\\)))((\\s*(\\d+|#(e|i|b|o|d|x)\\d+))*)(\\(|\\s|\\))",
"captures": {
"2": { "name": "constant.numeric.gauche" }
}
},
{ "name": "string.quoted.double.gauche",
"comment": "string",
"begin": "\"",
"end": "\"",
"patterns": [
{ "name": "constant.character.escape.gauche",
"match": "\\\\."
}
]
},
{ "name": "meta.variable.gauche",
"comment": "gloval variable",
"match": "(?<=(\\(|\\s|\\)))((\\s*(\\*[\\w!$%&*+-./:<=>?@^_~]+\\*))*)(\\(|\\s|\\))",
"captures": {
"2": { "name": "variable.other.gauche" }
}
},
{ "name": "meta.variable.gauche",
"comment": "key (knowingly, it should be constant.language.gauche)",
"match": "(?<=(\\(|\\s|\\)))(:[\\w!$%&*+-./:<=>?@^_~]+)(\\(|\\s|\\))",
"captures": {
"2": { "name": "variable.parameter.gauche" }
}
},
{ "name": "meta.entity.gauche",
"comment": "class",
"match": "(?<=(\\(|\\s|\\)))(<[\\w!$%&*+-./:<=>?@^_~]+>)(\\(|\\s|\\))",
"captures": {
"2": { "name": "storage.type.gauche" }
}
},
{ "name": "meta.function.gauche",
"comment": "(define|define-foo (name ) )",
"match": "(?<=(\\(|\\s))(define(|-[\\w!$%&*+-./:<=>?@^_~]+))\\s*\\(\\s*([\\w!$%&*+-./:<=>?@^_~]+)(\\s|\\(|\\))",
"captures": {
"2": { "name": "support.function.gauche" },
"4": { "name": "entity.name.function.gauche"}
}
},
{ "name": "meta.function.gauche",
"comment": "(define|define-foo name )",
"match": "(?<=(\\(|\\s))(define(|-[\\w!$%&*+-./:<=>?@^_~]+))\\s+([\\w!$%&*+-./:<=>?@^_~]+)(\\s|\\()",
"captures": {
"2": { "name": "support.function.gauche" },
"4": { "name": "entity.name.function.gauche"}
}
},
{ "name": "meta.function.gauche",
"comment": "named let",
"match": "(?<=(\\(|\\s))(let)\\s+([\\w!$%&*+-./:<=>?@^_~]+)",
"captures": {
"2": { "name": "support.function.gauche" },
"3": { "name": "entity.name.function.gauche" }
}
},
{ "name": "meta.operator.gauche",
"comment": "keyword with name",
"match": "(?<=(\\(|\\s))(use|select-module)\\s+([\\w!$%&*+-./:<=>?@^_~]+)(\\s|\\(|\\))",
"captures": {
"2": { "name": "keyword.operator.gauche" },
"3": { "name": "entity.name.function.gauche"}
}
},
{ "name": "meta.function.gauche",
"comment": "define syntax",
"match": "(?<=(\\(|\\s))((define|let(|rec))-syntax|syntax-rules)(\\s|\\()",
"captures": {
"2": { "name": "support.function.gauche" }
}
},
{ "name": "meta.function.gauche",
"comment": "define|define-foo",
"match": "(?<=(\\(|\\s))(define(|-[\\w!$%&*+-./:<=>?@^_~]+))(\\s|\\()",
"captures": {
"2": { "name": "support.function.gauche" }
}
},
{ "name": "meta.function.gauche",
"comment": "lambda",
"match": "(?<=(\\(|\\s))(lambda|\\^(|[_a-z])|\\$|cut(|e)|case-lambda)(\\s|\\()",
"captures": {
"2": { "name": "support.function.gauche" }
}
},
{ "name": "meta.function.gauche",
"comment": "binding (let)",
"match": "(?<=(\\(|\\s))(let(|\\*|1)(|-[\\w!$%&*+-./:<=>?@^_~]+)|[\\w!$%&*+-./:<=>?@^_~]+-let(|\\*|1)|let(/cc|rec)|rlet1)(\\s|\\()",
"captures": {
"2": { "name": "support.function.gauche" }
}
},
{ "name": "meta.function.gauche",
"comment": "binding",
"match": "(?<=(\\(|\\s))(rec|receive|parameterize|get-optional)(\\s|\\()",
"captures": {
"2": { "name": "support.function.gauche" }
}
},
{ "name": "meta.function.gauche",
"comment": "iterator",
"match": "(?<=(\\(|\\s))(do(|list|times)|while|until)(\\s|\\()",
"captures": {
"2": { "name": "support.function.gauche" }
}
},
{ "name": "meta.function.gauche",
"comment": "match lambda",
"match": "(?<=(\\(|\\s))(match-(define|lambda(|\\*)|let(|\\*|1|rec)))(\\s|\\()",
"captures": {
"2": { "name": "support.function.gauche" }
}
},
{ "name": "meta.control.gauche",
"comment": "control",
"match": "(?<=(\\(|\\s))(if|cond(|-expand|-list)|else|case|and|or|when|unless|begin(|0)|dynamic-wind|guard|unwind-protect|match|rxmatch-(case|cond|if)|raise|error(|f))(\\s|\\()",
"captures": {
"2": { "name": "keyword.control.gauche" }
}
},
{ "name": "meta.operator.gauche",
"comment": "misc keywords",
"match": "(?<=(\\(|\\s))(shift|reset|force|delay|lazy|eager|values|eval|apply|filter|(|[\\w!$%&*+-./:<=>?@^_~]+-)(map|for-each)|export(|-all)|import|use|extend|select-module)(\\s|\\()",
"captures": {
"2": { "name": "keyword.operator.gauche" }
}
},
{ "name": "meta.operator.gauche",
"comment": "call-with-foo",
"match": "(?<=(\\(|\\s))(call/[cp]c|call-with-[\\w!$%&*+-./:<=>?@^_~]+)(\\s|\\()",
"captures": {
"2": { "name": "keyword.operator.gauche" }
}
}
],
"uuid": "b5925227-2a05-405b-8793-3fd13033a25e"
}