@exercism/codemirror-lang-scheme 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +164 -2
- package/dist/index.cjs +722 -0
- package/dist/index.d.cts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +710 -0
- package/package.json +57 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
import { indentNodeProp, foldNodeProp, foldInside, syntaxTree, LRLanguage, LanguageSupport } from '@codemirror/language';
|
|
2
|
+
import { LRParser } from '@lezer/lr';
|
|
3
|
+
import { styleTags, tags } from '@lezer/highlight';
|
|
4
|
+
import { snippetCompletion } from '@codemirror/autocomplete';
|
|
5
|
+
|
|
6
|
+
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
7
|
+
const spec_symbolName = {__proto__:null,".":232, define:239, "define*":239, "define-public":239, "define-inline":239, "define-integrable":239, "define/contract":241, "define/public":241, "define/private":241, "define/override":241, "define/augment":241, "define/pubment":241, "define-values":253, "define-syntax":259, "define-syntax-rule":259, "define-macro":259, "define-record-type":263, lambda:269, "lambda*":269, "λ":269, "case-lambda":275, let:279, "let*":279, letrec:279, "letrec*":279, "let-syntax":279, "letrec-syntax":279, "let-values":283, "let*-values":283, receive:287, do:291, guard:295, struct:299, match:305, "match*":305, "match-lambda":309, "match-lambda*":309, "match-define":313, for:317, "for/list":317, "for/vector":317, "for/hash":317, "for/hasheq":317, "for/hasheqv":317, "for/and":317, "for/or":317, "for/sum":317, "for/product":317, "for/first":317, "for/last":317, "for/set":317, "for/string":317, "for*":317, "for*/list":317, "for*/vector":317, "for*/hash":317, "for*/hasheq":317, "for*/hasheqv":317, "for*/and":317, "for*/or":317, "for*/sum":317, "for*/product":317, "for*/first":317, "for*/last":317, "for*/set":317, "for/fold":323, "for*/fold":323, "for/foldr":323, "for*/foldr":323, "for/lists":323, "for*/lists":323, "let/ec":327, "let/cc":327, if:333, cond:333, case:333, and:333, or:333, when:333, unless:333, begin:333, else:333, "set!":333, quote:333, quasiquote:333, unquote:333, "unquote-splicing":333, delay:333, "delay-force":333, "make-promise":333, parameterize:333, assert:333, "syntax-rules":333, "syntax-case":333, "with-syntax":333, syntax:333, quasisyntax:333, import:333, export:333, library:333, "define-library":333, include:333, "include-ci":333, "cond-expand":333, "define-module":333, "use-modules":333, "fluid-let":333, module:335, "module+":335, "module*":335, provide:335, require:335, "contract-out":335, "struct-out":335, "all-defined-out":335, "all-from-out":335, "rename-out":335, "only-in":335, "except-in":335, "prefix-in":335, "rename-in":335, "for-syntax":335, begin0:335, "with-handlers":335, "with-handlers*":335, local:335, "struct-copy":335, "match-let":335, "match-let*":335, "define-syntax-parser":335, "syntax-parse":335, class:335, "class*":335, new:335, send:335, "super-new":335, field:335, init:335, "init-field":335, inherit:335, this:335, "->":335, "->*":335, "->i":335, "+":337, "-":337, "*":337, "/":337, "=":337, "<":337, ">":337, "<=":337, ">=":337};
|
|
8
|
+
const parser = LRParser.deserialize({
|
|
9
|
+
version: 14,
|
|
10
|
+
states: "!!lQcQPOOP#YOPOOOOQO'#Cc'#CcOOQO'#Ck'#CkOOQO'#Ea'#EaQcQPOOO#bQPO'#ClO$}QPO'#ClO&jQPO'#ClO(VQPO'#DsO(^QPO'#DtO(eQPO'#DwOcQPO'#D{OcQPO'#D}OcQPO'#EPOcQPO'#EROcQPO'#ETOcQPO'#EVOcQPO'#EXOcQPO'#EZOOQO'#Es'#EsOOQO'#Ep'#EpP(lOQO'#C_P(wQPO'#CaPOOO)C@c)C@cOOQO-E8_-E8_OOQO'#Cn'#CnO+PQPO'#EvOOQO'#Cx'#CxO+^QPO'#E}OOQO'#Cz'#CzO+xQPO'#FQOOQO'#C|'#C|O,dQPO'#FSOOQO'#DR'#DRO-WQPO'#FVOOQO'#DT'#DTO-eQPO'#FYOOQO'#DV'#DVO-yQPO'#F[OOQO'#DY'#DYO.eQPO'#F^OOQO'#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%^Q'T%lQ'V%mQ'W%nV(Q'T'V'WQ$Q!VQ%q#{T%u$Q%qQ%}$TQ&P$UQ&Q$VV'f%}&P&QQ(V'_Q(X'`Q(Y'aV(j(V(X(YQ&T$XQ&V$YQ&W$ZV'h&T&V&W$bSOTXYZ!e!j!l!n#R#W#[#d#n#s#t#u#y$S$W$]$^$i$r$s$t$u$v%T%U%V%W%_%`%e%f%g%h%i%j%k%o%r%s%t%v&R&X&Y&e&g&h&q&s&t&w&y&{&|'X'Y'Z']'^'b'c'd'j'}(O(P(S(Z(](^(f(h(iS!p[(sS!q](tS!r^(uS!s_(vS!t`(wS!ua(xS!vb(yS!wc(zQ!{gQ#{!TW$R!X#|#}$OR'e%{%beOTXYZ[]^_`abcg!T!X!e!j!l!n#R#W#[#d#n#s#t#u#y#|#}$O$S$W$]$^$i$r$s$t$u$v%T%U%V%W%_%`%e%f%g%h%i%j%k%o%r%s%t%v%{&R&X&Y&e&g&h&q&s&t&w&y&{&|'X'Y'Z']'^'b'c'd'j'}(O(P(S(Z(](^(f(h(i(s(t(u(v(w(x(y(zV!dUVWQ!gUQ!hVR!iWV!fUVWR#RkQ$f!}Q$g#OR$h#PQ%Q#`Q%R#aQ%S#bR&Z$eZ$}#`#a#b$e%OR#WmR${#^Q#dsQ#t{Q%U#eQ%V#fR%W#g]'S%l%m%n'T'V'W[%|$T$U$V%}&P&Q]&S$X$Y$Z&T&V&WV!eUVW",
|
|
13
|
+
nodeNames: "⚠ LineComment |# BlockComment #| DatumComment #; Symbol Number String Regexp Character Boolean Nil Keyword Dot List ( DefineLike VarName List LocalName List ) [ ] { } DefineValuesLike List DefineSyntaxLike List DefineRecordLike TypeName List FieldName List LambdaLike List CaseLambdaLike List LetLike LoopName List LetValuesLike List ReceiveLike DoLike GuardLike StructLike List List MatchLike List Pattern MatchLambdaLike MatchDefineLike ForLike List List List ForFoldLike List EscapeLike SpecialForm RacketForm Operator Callee #( Vector ByteVector #u8( #vu8( HashTable #hash( #hasheq( #hashe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;'S;=`$3c<%lO$1{P$2OVO#O$1{#O#P$2e#P#p$1{#p#q$3^#q;'S$1{;'S;=`$3c<%lO$1{P$2hRO;'S$1{;'S;=`$2q;=`O$1{P$2tWO#O$1{#O#P$2e#P#p$1{#p#q$3^#q;'S$1{;'S;=`$3c;=`<%l$1{<%lO$1{P$3cO#ePP$3fP;=`<%l$1{R$3nVQQO#O$1{#O#P$2e#P#p$1{#p#q$3^#q;'S$1{;'S;=`$3c<%lO$1{R$4[TkP#cQOs%ht#p%h#q;'S%h;'S;=`%|<%lO%h",
|
|
22
|
+
tokenizers: [0, 1],
|
|
23
|
+
topRules: {"Program":[0,94]},
|
|
24
|
+
dialects: {racket: 2649},
|
|
25
|
+
dynamicPrecedences: {"18":1,"28":1,"30":1,"32":1,"37":1,"39":1,"41":1,"44":1,"46":1,"47":1,"48":1,"49":1,"52":1,"55":1,"56":1,"57":1,"61":1,"63":1,"64":1,"65":1,"66":1},
|
|
26
|
+
specialized: [{term: 113, get: (value) => spec_symbolName[value] || -1}],
|
|
27
|
+
tokenPrec: 2659
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// The parts of the language support that Scheme and Racket share: the parser
|
|
31
|
+
// with its highlighting, indentation and folding, and the language data.
|
|
32
|
+
const definitionHeads = [
|
|
33
|
+
"DefineLike", "DefineValuesLike", "DefineSyntaxLike", "DefineRecordLike", "LambdaLike",
|
|
34
|
+
"CaseLambdaLike", "LetLike", "LetValuesLike", "ReceiveLike", "StructLike", "MatchDefineLike",
|
|
35
|
+
"EscapeLike",
|
|
36
|
+
];
|
|
37
|
+
const controlHeads = ["DoLike", "GuardLike", "MatchLike", "MatchLambdaLike", "ForLike", "ForFoldLike"];
|
|
38
|
+
/// The nodes for keywords at the head of a list.
|
|
39
|
+
const keywordHeads = new Set([...definitionHeads, ...controlHeads, "SpecialForm", "RacketForm"]);
|
|
40
|
+
const closesList = /^\s*[)\]}]/;
|
|
41
|
+
const closers = new Set([")", "]", "}"]);
|
|
42
|
+
// Scheme indents a list in one of three ways:
|
|
43
|
+
//
|
|
44
|
+
// (define (f x) ; a special form indents its body by one unit
|
|
45
|
+
// (g x))
|
|
46
|
+
//
|
|
47
|
+
// (string-append a ; a call lines its arguments up under the first one
|
|
48
|
+
// b)
|
|
49
|
+
//
|
|
50
|
+
// '((1 . "one") ; a list that starts with a list lines up its elements
|
|
51
|
+
// (2 . "two"))
|
|
52
|
+
function listIndent(context) {
|
|
53
|
+
const open = context.node.firstChild;
|
|
54
|
+
if (!open)
|
|
55
|
+
return null;
|
|
56
|
+
const column = context.column(open.from);
|
|
57
|
+
if (closesList.test(context.textAfter))
|
|
58
|
+
return column;
|
|
59
|
+
const head = open.nextSibling;
|
|
60
|
+
if (!head || closers.has(head.name) || keywordHeads.has(head.name))
|
|
61
|
+
return column + context.unit;
|
|
62
|
+
if (head.name != "Callee" && head.name != "Operator")
|
|
63
|
+
return context.column(head.from);
|
|
64
|
+
const argument = head.nextSibling;
|
|
65
|
+
if (argument && !closers.has(argument.name) &&
|
|
66
|
+
context.lineAt(argument.from).from == context.lineAt(head.from).from)
|
|
67
|
+
return context.column(argument.from);
|
|
68
|
+
return column + context.unit;
|
|
69
|
+
}
|
|
70
|
+
/// The grammar's parser, with highlighting, indentation and folding.
|
|
71
|
+
const configuredParser = parser.configure({
|
|
72
|
+
props: [
|
|
73
|
+
indentNodeProp.add({
|
|
74
|
+
"List Vector ByteVector HashTable": listIndent,
|
|
75
|
+
}),
|
|
76
|
+
foldNodeProp.add({
|
|
77
|
+
"List Vector ByteVector HashTable": foldInside,
|
|
78
|
+
BlockComment: (node) => ({ from: node.from + 2, to: node.to - 2 }),
|
|
79
|
+
}),
|
|
80
|
+
styleTags({
|
|
81
|
+
[definitionHeads.join(" ")]: tags.definitionKeyword,
|
|
82
|
+
[controlHeads.join(" ")]: tags.controlKeyword,
|
|
83
|
+
"SpecialForm RacketForm": tags.keyword,
|
|
84
|
+
Operator: tags.operator,
|
|
85
|
+
"VarName/Symbol LocalName/Symbol LoopName/Symbol FieldName/Symbol Pattern/Symbol": tags.definition(tags.variableName),
|
|
86
|
+
"TypeName/Symbol": tags.definition(tags.typeName),
|
|
87
|
+
"Callee/Symbol": tags.function(tags.variableName),
|
|
88
|
+
"Quote/Symbol": tags.atom,
|
|
89
|
+
Symbol: tags.variableName,
|
|
90
|
+
Number: tags.number,
|
|
91
|
+
String: tags.string,
|
|
92
|
+
Regexp: tags.regexp,
|
|
93
|
+
Character: tags.character,
|
|
94
|
+
Boolean: tags.bool,
|
|
95
|
+
Nil: tags.null,
|
|
96
|
+
Keyword: tags.atom,
|
|
97
|
+
LineComment: tags.lineComment,
|
|
98
|
+
"BlockComment #| |#": tags.blockComment,
|
|
99
|
+
"DatumComment/...": tags.comment,
|
|
100
|
+
Directive: tags.meta,
|
|
101
|
+
"' ` , ,@ #' #` #, #,@": tags.operator,
|
|
102
|
+
Dot: tags.punctuation,
|
|
103
|
+
"( )": tags.paren,
|
|
104
|
+
"[ ]": tags.squareBracket,
|
|
105
|
+
"{ }": tags.brace,
|
|
106
|
+
"#( #u8( #vu8( #hash( #hasheq( #hasheqv(": tags.paren,
|
|
107
|
+
}),
|
|
108
|
+
],
|
|
109
|
+
});
|
|
110
|
+
/// The comment tokens, brackets and indent trigger for both languages.
|
|
111
|
+
const languageData = {
|
|
112
|
+
commentTokens: { line: ";", block: { open: "#|", close: "|#" } },
|
|
113
|
+
closeBrackets: { brackets: ["(", "[", "{", '"'] },
|
|
114
|
+
indentOnInput: /^\s*[)\]}]$/,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// The names that completion offers. The first two lists are R7RS-small, so a
|
|
118
|
+
// grammar for another Scheme (or Racket) can reuse them and add its own.
|
|
119
|
+
const words$1 = (text) => text.trim().split(/\s+/);
|
|
120
|
+
// R7RS syntax, including the auxiliary keywords used inside other forms.
|
|
121
|
+
const r7rsSyntax = words$1(`
|
|
122
|
+
and begin case case-lambda cond cond-expand define define-library
|
|
123
|
+
define-record-type define-syntax define-values delay delay-force do else
|
|
124
|
+
export guard if import include include-ci lambda let let* let*-values
|
|
125
|
+
let-syntax let-values letrec letrec* letrec-syntax parameterize quasiquote
|
|
126
|
+
quote set! syntax-error syntax-rules unless unquote unquote-splicing when
|
|
127
|
+
`);
|
|
128
|
+
// The procedures of every R7RS-small library.
|
|
129
|
+
const r7rsProcedures = words$1(`
|
|
130
|
+
* + - / < <= = > >= abs append apply assoc assq assv binary-port? boolean=?
|
|
131
|
+
boolean? bytevector bytevector-append bytevector-copy bytevector-copy!
|
|
132
|
+
bytevector-length bytevector-u8-ref bytevector-u8-set! bytevector? caar cadr
|
|
133
|
+
call-with-current-continuation call-with-port call-with-values call/cc car
|
|
134
|
+
cdar cddr cdr ceiling char->integer char-ready? char<=? char<? char=? char>=?
|
|
135
|
+
char>? char? close-input-port close-output-port close-port complex? cons
|
|
136
|
+
current-error-port current-input-port current-output-port denominator
|
|
137
|
+
dynamic-wind eof-object eof-object? eq? equal? eqv? error
|
|
138
|
+
error-object-irritants error-object-message error-object? even? exact
|
|
139
|
+
exact-integer-sqrt exact-integer? exact? expt features file-error? floor
|
|
140
|
+
floor-quotient floor-remainder floor/ flush-output-port for-each gcd
|
|
141
|
+
get-output-bytevector get-output-string inexact inexact? input-port-open?
|
|
142
|
+
input-port? integer->char integer? lcm length list list->string list->vector
|
|
143
|
+
list-copy list-ref list-set! list-tail list? make-bytevector make-list
|
|
144
|
+
make-parameter make-string make-vector map max member memq memv min modulo
|
|
145
|
+
negative? newline not null? number->string number? numerator odd?
|
|
146
|
+
open-input-bytevector open-input-string open-output-bytevector
|
|
147
|
+
open-output-string output-port-open? output-port? pair? peek-char peek-u8
|
|
148
|
+
positive? procedure? quotient raise raise-continuable rational? rationalize
|
|
149
|
+
read-bytevector read-bytevector! read-char read-error? read-line read-string
|
|
150
|
+
read-u8 real? remainder reverse round set-car! set-cdr! square string
|
|
151
|
+
string->list string->number string->symbol string->utf8 string->vector
|
|
152
|
+
string-append string-copy string-copy! string-fill! string-for-each
|
|
153
|
+
string-length string-map string-ref string-set! string<=? string<? string=?
|
|
154
|
+
string>=? string>? string? substring symbol->string symbol=? symbol?
|
|
155
|
+
textual-port? truncate truncate-quotient truncate-remainder truncate/
|
|
156
|
+
u8-ready? utf8->string values vector vector->list vector->string
|
|
157
|
+
vector-append vector-copy vector-copy! vector-fill! vector-for-each
|
|
158
|
+
vector-length vector-map vector-ref vector-set! vector? with-exception-handler
|
|
159
|
+
write-bytevector write-char write-string write-u8 zero?
|
|
160
|
+
|
|
161
|
+
char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>?
|
|
162
|
+
char-downcase char-foldcase char-lower-case? char-numeric? char-upcase
|
|
163
|
+
char-upper-case? char-whitespace? digit-value string-ci<=? string-ci<?
|
|
164
|
+
string-ci=? string-ci>=? string-ci>? string-downcase string-foldcase
|
|
165
|
+
string-upcase
|
|
166
|
+
|
|
167
|
+
angle imag-part magnitude make-polar make-rectangular real-part
|
|
168
|
+
|
|
169
|
+
caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr
|
|
170
|
+
cadaar cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar
|
|
171
|
+
cddddr
|
|
172
|
+
|
|
173
|
+
environment eval
|
|
174
|
+
|
|
175
|
+
call-with-input-file call-with-output-file delete-file file-exists?
|
|
176
|
+
open-binary-input-file open-binary-output-file open-input-file
|
|
177
|
+
open-output-file with-input-from-file with-output-to-file
|
|
178
|
+
|
|
179
|
+
acos asin atan cos exp finite? infinite? log nan? sin sqrt tan
|
|
180
|
+
|
|
181
|
+
force make-promise promise?
|
|
182
|
+
|
|
183
|
+
load
|
|
184
|
+
|
|
185
|
+
command-line emergency-exit exit get-environment-variable
|
|
186
|
+
get-environment-variables
|
|
187
|
+
|
|
188
|
+
read
|
|
189
|
+
|
|
190
|
+
interaction-environment
|
|
191
|
+
|
|
192
|
+
current-jiffy current-second jiffies-per-second
|
|
193
|
+
|
|
194
|
+
display write write-shared write-simple
|
|
195
|
+
`);
|
|
196
|
+
// Procedures from R6RS, SRFI-1 and Guile that the track's solutions often use.
|
|
197
|
+
// The track runs on both Chez and Guile, so each one exists in at least one of
|
|
198
|
+
// them.
|
|
199
|
+
const commonProcedures = words$1(`
|
|
200
|
+
fold-left fold-right filter remove partition find exists for-all list-sort
|
|
201
|
+
div mod
|
|
202
|
+
fold reduce iota first second third last take drop delete delete-duplicates
|
|
203
|
+
any every count filter-map append-map
|
|
204
|
+
format sort string-null? string-split string-join string-index string-contains
|
|
205
|
+
1+ 1-
|
|
206
|
+
`);
|
|
207
|
+
// Syntax from R6RS, SRFI-8 and Guile that the track's solutions often use.
|
|
208
|
+
const commonSyntax = words$1(`
|
|
209
|
+
assert receive define* lambda* define-public
|
|
210
|
+
`);
|
|
211
|
+
|
|
212
|
+
// A Scheme identifier, such as `list->string`, `set-car!` or `<=`.
|
|
213
|
+
const Identifier = /^[^\s()\[\]{}"';`,|#][^\s()\[\]{}"';`,|]*$/;
|
|
214
|
+
// The cursor is in one of these when it is typing a name.
|
|
215
|
+
const wordNodes = new Set(["Symbol", "Operator", ...keywordHeads]);
|
|
216
|
+
// Nothing is offered inside these, or while a new name is being typed.
|
|
217
|
+
const dontComplete = new Set([
|
|
218
|
+
"String", "Regexp", "Character", "Number", "Boolean", "Keyword", "LineComment", "BlockComment",
|
|
219
|
+
"DatumComment", "Directive", "VarName", "LocalName", "LoopName", "FieldName", "TypeName",
|
|
220
|
+
]);
|
|
221
|
+
function inNode(node, names) {
|
|
222
|
+
for (let cur = node; cur; cur = cur.parent)
|
|
223
|
+
if (names.has(cur.name))
|
|
224
|
+
return true;
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
const schemeSnippets = [
|
|
228
|
+
["define", "procedure", "define (${name} ${params})\n\t${}"],
|
|
229
|
+
["define", "variable", "define ${name} ${value}"],
|
|
230
|
+
["lambda", "anonymous procedure", "lambda (${params})\n\t${}"],
|
|
231
|
+
["let", "local bindings", "let ((${name} ${value}))\n\t${}"],
|
|
232
|
+
["let", "named let loop", "let ${loop} ((${name} ${init}))\n\t${}"],
|
|
233
|
+
["let*", "sequential bindings", "let* ((${name} ${value}))\n\t${}"],
|
|
234
|
+
["letrec", "recursive bindings", "letrec ((${name} ${value}))\n\t${}"],
|
|
235
|
+
["if", "conditional", "if ${test}\n\t${then}\n\t${else}"],
|
|
236
|
+
["cond", "conditional", "cond\n\t(${test} ${result})\n\t(else ${default})"],
|
|
237
|
+
["case", "conditional", "case ${key}\n\t((${datum}) ${result})\n\t(else ${default})"],
|
|
238
|
+
["when", "conditional", "when ${test}\n\t${}"],
|
|
239
|
+
["unless", "conditional", "unless ${test}\n\t${}"],
|
|
240
|
+
["do", "loop", "do ((${i} ${init} ${step}))\n\t((${test}) ${result})\n\t${}"],
|
|
241
|
+
["define-record-type", "record", "define-record-type ${name}\n\t(make-${name} ${field})\n\t${name}?\n\t(${field} ${name}-${field})"],
|
|
242
|
+
["import", "import libraries", "import (scheme base)"],
|
|
243
|
+
];
|
|
244
|
+
function wordAt(context, inner) {
|
|
245
|
+
if (wordNodes.has(inner.name) && inner.to - inner.from < 60) {
|
|
246
|
+
const text = context.state.sliceDoc(inner.from, context.pos);
|
|
247
|
+
if (Identifier.test(text))
|
|
248
|
+
return { from: inner.from };
|
|
249
|
+
}
|
|
250
|
+
return context.explicit ? { from: context.pos } : null;
|
|
251
|
+
}
|
|
252
|
+
/// Makes a completion source that offers the given syntax, procedures and
|
|
253
|
+
/// snippets.
|
|
254
|
+
function builtinSource(syntax, procedures, snippets) {
|
|
255
|
+
const options = [
|
|
256
|
+
...[...new Set(syntax)].map((label) => ({ label, type: "keyword" })),
|
|
257
|
+
...[...new Set(procedures)].map((label) => ({ label, type: "function" })),
|
|
258
|
+
];
|
|
259
|
+
const inParens = options.concat(snippets.map(([label, detail, body]) => snippetCompletion(body, { label, detail, type: "keyword", boost: -1 })));
|
|
260
|
+
const withParens = options.concat(snippets.map(([label, detail, body]) => snippetCompletion("(" + body + ")", { label, detail, type: "keyword", boost: -1 })));
|
|
261
|
+
return (context) => {
|
|
262
|
+
const inner = syntaxTree(context.state).resolveInner(context.pos, -1);
|
|
263
|
+
if (inNode(inner, dontComplete))
|
|
264
|
+
return null;
|
|
265
|
+
const word = wordAt(context, inner);
|
|
266
|
+
if (!word)
|
|
267
|
+
return null;
|
|
268
|
+
const afterParen = /[(\[{]/.test(context.state.sliceDoc(word.from - 1, word.from));
|
|
269
|
+
return { from: word.from, options: afterParen ? inParens : withParens, validFor: Identifier };
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/// Completes R7RS syntax and procedures, a few common extensions, and
|
|
273
|
+
/// snippets for the common forms.
|
|
274
|
+
const builtinCompletionSource = builtinSource([...r7rsSyntax, ...commonSyntax], [...r7rsProcedures, ...commonProcedures], schemeSnippets);
|
|
275
|
+
const brackets = new Set(["(", ")", "[", "]", "{", "}"]);
|
|
276
|
+
// The elements of a list, without its brackets.
|
|
277
|
+
function elements(list) {
|
|
278
|
+
const result = [];
|
|
279
|
+
for (let child = list.firstChild; child; child = child.nextSibling) {
|
|
280
|
+
if (!brackets.has(child.name))
|
|
281
|
+
result.push(child);
|
|
282
|
+
}
|
|
283
|
+
return result;
|
|
284
|
+
}
|
|
285
|
+
// The names in a parameter list: `x`, `(a b . rest)` or Guile's
|
|
286
|
+
// `(a #:optional (b 1))`.
|
|
287
|
+
function paramNames(node, add) {
|
|
288
|
+
if (!node)
|
|
289
|
+
return;
|
|
290
|
+
if (node.name == "LocalName" || node.name == "VarName") {
|
|
291
|
+
add({ node, type: "variable" });
|
|
292
|
+
}
|
|
293
|
+
else if (node.name == "List") {
|
|
294
|
+
for (const el of elements(node)) {
|
|
295
|
+
if (el.name == "LocalName" || el.name == "VarName")
|
|
296
|
+
add({ node: el, type: "variable" });
|
|
297
|
+
else if (el.name == "List") {
|
|
298
|
+
const first = elements(el)[0];
|
|
299
|
+
if ((first === null || first === void 0 ? void 0 : first.name) == "LocalName")
|
|
300
|
+
add({ node: first, type: "variable" });
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function isLambda(state, node) {
|
|
306
|
+
var _a;
|
|
307
|
+
return (node === null || node === void 0 ? void 0 : node.name) == "List" && ((_a = elements(node)[0]) === null || _a === void 0 ? void 0 : _a.name) == "LambdaLike";
|
|
308
|
+
}
|
|
309
|
+
// The names that a definition at this list's level creates. A `begin` at the
|
|
310
|
+
// same level can hold more of them.
|
|
311
|
+
function definedNames(state, list, add) {
|
|
312
|
+
var _a, _b, _c, _d;
|
|
313
|
+
const els = elements(list);
|
|
314
|
+
const head = els[0];
|
|
315
|
+
if (!head)
|
|
316
|
+
return;
|
|
317
|
+
switch (head.name) {
|
|
318
|
+
case "DefineLike": {
|
|
319
|
+
let target = els[1];
|
|
320
|
+
let isProcedure = isLambda(state, els[2]);
|
|
321
|
+
while ((target === null || target === void 0 ? void 0 : target.name) == "List") {
|
|
322
|
+
target = elements(target)[0];
|
|
323
|
+
isProcedure = true;
|
|
324
|
+
}
|
|
325
|
+
if ((target === null || target === void 0 ? void 0 : target.name) == "VarName")
|
|
326
|
+
add({ node: target, type: isProcedure ? "function" : "variable" });
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
case "DefineValuesLike":
|
|
330
|
+
paramNames(els[1], add);
|
|
331
|
+
break;
|
|
332
|
+
case "DefineSyntaxLike": {
|
|
333
|
+
const target = ((_a = els[1]) === null || _a === void 0 ? void 0 : _a.name) == "List" ? elements(els[1])[0] : els[1];
|
|
334
|
+
if ((target === null || target === void 0 ? void 0 : target.name) == "VarName")
|
|
335
|
+
add({ node: target, type: "keyword" });
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
case "DefineRecordLike": {
|
|
339
|
+
if (((_b = els[1]) === null || _b === void 0 ? void 0 : _b.name) == "TypeName")
|
|
340
|
+
add({ node: els[1], type: "type" });
|
|
341
|
+
for (const el of els.slice(2)) {
|
|
342
|
+
if (el.name == "VarName")
|
|
343
|
+
add({ node: el, type: "function" });
|
|
344
|
+
else if (el.name == "List") {
|
|
345
|
+
for (const v of elements(el))
|
|
346
|
+
if (v.name == "VarName")
|
|
347
|
+
add({ node: v, type: "function" });
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
case "StructLike": {
|
|
353
|
+
// `(struct point (x [y #:mutable]))` defines `point`, `point?`,
|
|
354
|
+
// `point-x`, `point-y` and `set-point-y!`.
|
|
355
|
+
const type = els[1];
|
|
356
|
+
if ((type === null || type === void 0 ? void 0 : type.name) != "TypeName")
|
|
357
|
+
break;
|
|
358
|
+
const name = state.sliceDoc(type.from, type.to);
|
|
359
|
+
add({ node: type, type: "type" });
|
|
360
|
+
add({ node: type, type: "function", label: name + "?" });
|
|
361
|
+
const fields = els.slice(2).find((el) => el.name == "List");
|
|
362
|
+
const text = (el) => state.sliceDoc(el.from, el.to);
|
|
363
|
+
const allMutable = els.some((el) => el.name == "Keyword" && text(el) == "#:mutable");
|
|
364
|
+
for (const field of fields ? elements(fields) : []) {
|
|
365
|
+
const parts = field.name == "List" ? elements(field) : [field];
|
|
366
|
+
if (((_c = parts[0]) === null || _c === void 0 ? void 0 : _c.name) != "FieldName")
|
|
367
|
+
continue;
|
|
368
|
+
const fieldName = text(parts[0]);
|
|
369
|
+
add({ node: parts[0], type: "function", label: `${name}-${fieldName}` });
|
|
370
|
+
if (allMutable || parts.some((p) => p.name == "Keyword" && text(p) == "#:mutable"))
|
|
371
|
+
add({ node: parts[0], type: "function", label: `set-${name}-${fieldName}!` });
|
|
372
|
+
}
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
case "MatchDefineLike":
|
|
376
|
+
if (((_d = els[1]) === null || _d === void 0 ? void 0 : _d.name) == "Pattern")
|
|
377
|
+
patternNames(state, els[1], add);
|
|
378
|
+
break;
|
|
379
|
+
case "RacketForm":
|
|
380
|
+
case "SpecialForm":
|
|
381
|
+
if (state.sliceDoc(head.from, head.to) == "begin") {
|
|
382
|
+
for (const el of els.slice(1))
|
|
383
|
+
if (el.name == "List")
|
|
384
|
+
definedNames(state, el, add);
|
|
385
|
+
}
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
// The names that a binding form binds and that are in scope at `pos`, which is
|
|
390
|
+
// inside the form.
|
|
391
|
+
function boundNames(state, list, pos, add) {
|
|
392
|
+
var _a, _b;
|
|
393
|
+
const els = elements(list);
|
|
394
|
+
const head = els[0];
|
|
395
|
+
if (!head)
|
|
396
|
+
return;
|
|
397
|
+
const keyword = state.sliceDoc(head.from, head.to);
|
|
398
|
+
switch (head.name) {
|
|
399
|
+
case "DefineLike": {
|
|
400
|
+
// The parameters of `(define (name . params) body)`, at every level of a
|
|
401
|
+
// curried definition.
|
|
402
|
+
let sig = els[1];
|
|
403
|
+
while ((sig === null || sig === void 0 ? void 0 : sig.name) == "List") {
|
|
404
|
+
for (const el of elements(sig).slice(1))
|
|
405
|
+
paramNames(el, add);
|
|
406
|
+
sig = elements(sig)[0];
|
|
407
|
+
}
|
|
408
|
+
break;
|
|
409
|
+
}
|
|
410
|
+
case "LambdaLike":
|
|
411
|
+
paramNames(els[1], add);
|
|
412
|
+
break;
|
|
413
|
+
case "CaseLambdaLike":
|
|
414
|
+
for (const clause of els.slice(1)) {
|
|
415
|
+
if (clause.name == "List" && clause.from < pos && pos < clause.to)
|
|
416
|
+
paramNames(elements(clause)[0], add);
|
|
417
|
+
}
|
|
418
|
+
break;
|
|
419
|
+
case "LetLike":
|
|
420
|
+
case "DoLike": {
|
|
421
|
+
let i = 1;
|
|
422
|
+
if (((_a = els[i]) === null || _a === void 0 ? void 0 : _a.name) == "LoopName") {
|
|
423
|
+
if (els[i + 1] && pos > els[i + 1].to)
|
|
424
|
+
add({ node: els[i], type: "function" });
|
|
425
|
+
i++;
|
|
426
|
+
}
|
|
427
|
+
const bindings = els[i];
|
|
428
|
+
if ((bindings === null || bindings === void 0 ? void 0 : bindings.name) != "List")
|
|
429
|
+
break;
|
|
430
|
+
const sequential = keyword == "let*";
|
|
431
|
+
const everywhere = head.name == "DoLike" || keyword.startsWith("letrec");
|
|
432
|
+
for (const b of elements(bindings)) {
|
|
433
|
+
const name = b.name == "List" ? elements(b)[0] : null;
|
|
434
|
+
if ((name === null || name === void 0 ? void 0 : name.name) != "LocalName")
|
|
435
|
+
continue;
|
|
436
|
+
if (everywhere || pos > bindings.to || (sequential && pos > b.to))
|
|
437
|
+
add({ node: name, type: "variable" });
|
|
438
|
+
}
|
|
439
|
+
break;
|
|
440
|
+
}
|
|
441
|
+
case "LetValuesLike": {
|
|
442
|
+
const bindings = els[1];
|
|
443
|
+
if ((bindings === null || bindings === void 0 ? void 0 : bindings.name) != "List")
|
|
444
|
+
break;
|
|
445
|
+
const sequential = keyword == "let*-values";
|
|
446
|
+
for (const b of elements(bindings)) {
|
|
447
|
+
if (b.name != "List")
|
|
448
|
+
continue;
|
|
449
|
+
if (pos > bindings.to || (sequential && pos > b.to))
|
|
450
|
+
paramNames(elements(b)[0], add);
|
|
451
|
+
}
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
case "ReceiveLike":
|
|
455
|
+
if (els[2] && pos > els[2].to)
|
|
456
|
+
paramNames(els[1], add);
|
|
457
|
+
break;
|
|
458
|
+
case "MatchLike":
|
|
459
|
+
case "MatchLambdaLike":
|
|
460
|
+
for (const clause of els.slice(head.name == "MatchLike" ? 2 : 1)) {
|
|
461
|
+
if (clause.name != "List" || pos <= clause.from || pos >= clause.to)
|
|
462
|
+
continue;
|
|
463
|
+
const pattern = elements(clause)[0];
|
|
464
|
+
if ((pattern === null || pattern === void 0 ? void 0 : pattern.name) == "Pattern" && pos > pattern.to)
|
|
465
|
+
patternNames(state, pattern, add);
|
|
466
|
+
}
|
|
467
|
+
break;
|
|
468
|
+
case "ForLike":
|
|
469
|
+
forNames(els[1], pos, add);
|
|
470
|
+
break;
|
|
471
|
+
case "ForFoldLike": {
|
|
472
|
+
// `(for/fold ([acc 0]) ([x xs]) body)`: the accumulators are in scope in
|
|
473
|
+
// the body, and the loop variables as in `for`.
|
|
474
|
+
const accumulators = els[1];
|
|
475
|
+
if ((accumulators === null || accumulators === void 0 ? void 0 : accumulators.name) == "List" && els[2] && pos > els[2].to) {
|
|
476
|
+
for (const el of elements(accumulators)) {
|
|
477
|
+
if (el.name == "LocalName")
|
|
478
|
+
add({ node: el, type: "variable" });
|
|
479
|
+
else if (el.name == "List")
|
|
480
|
+
paramNames(elements(el)[0], add);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
forNames(els[2], pos, add);
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
case "EscapeLike":
|
|
487
|
+
if (((_b = els[1]) === null || _b === void 0 ? void 0 : _b.name) == "LocalName")
|
|
488
|
+
add({ node: els[1], type: "function" });
|
|
489
|
+
break;
|
|
490
|
+
case "GuardLike": {
|
|
491
|
+
const clause = els[1];
|
|
492
|
+
const name = (clause === null || clause === void 0 ? void 0 : clause.name) == "List" ? elements(clause)[0] : null;
|
|
493
|
+
if ((name === null || name === void 0 ? void 0 : name.name) == "LocalName")
|
|
494
|
+
add({ node: name, type: "variable" });
|
|
495
|
+
break;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
// The names bound by the clauses of a `for` form. A name is in scope in the
|
|
500
|
+
// body and in the clauses after its own. Racket's `for` lets a later clause
|
|
501
|
+
// see the name only after a `#:when`, and `for*` always does. Completion
|
|
502
|
+
// offers it in every later clause for both.
|
|
503
|
+
function forNames(clauses, pos, add) {
|
|
504
|
+
if ((clauses === null || clauses === void 0 ? void 0 : clauses.name) != "List")
|
|
505
|
+
return;
|
|
506
|
+
for (const clause of elements(clauses)) {
|
|
507
|
+
if (clause.name != "List" || (pos < clauses.to && pos <= clause.to))
|
|
508
|
+
continue;
|
|
509
|
+
paramNames(elements(clause)[0], add);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
// The names a `match` pattern binds: its symbols, apart from list heads such
|
|
513
|
+
// as `list` and `cons`, quoted data, predicates such as `string?`, and `_` and
|
|
514
|
+
// `...`.
|
|
515
|
+
function patternNames(state, pattern, add) {
|
|
516
|
+
for (let child = pattern.firstChild; child; child = child.nextSibling) {
|
|
517
|
+
if (child.name == "Quote" || child.name == "Callee")
|
|
518
|
+
continue;
|
|
519
|
+
if (child.name != "Symbol") {
|
|
520
|
+
patternNames(state, child, add);
|
|
521
|
+
continue;
|
|
522
|
+
}
|
|
523
|
+
const text = state.sliceDoc(child.from, child.to);
|
|
524
|
+
if (!/^(_|\.\.\.|\.\.\d+|___|else)$|\?$/.test(text))
|
|
525
|
+
add({ node: child, type: "variable" });
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
function namesInScope(state, pos) {
|
|
529
|
+
const seen = new Set();
|
|
530
|
+
const options = [];
|
|
531
|
+
const add = (found) => {
|
|
532
|
+
var _a;
|
|
533
|
+
const { node, type } = found;
|
|
534
|
+
// Skip the name that is being typed.
|
|
535
|
+
if (node.from <= pos && pos <= node.to)
|
|
536
|
+
return;
|
|
537
|
+
const label = (_a = found.label) !== null && _a !== void 0 ? _a : state.sliceDoc(node.from, node.to);
|
|
538
|
+
if (seen.has(label))
|
|
539
|
+
return;
|
|
540
|
+
seen.add(label);
|
|
541
|
+
options.push({ label, type });
|
|
542
|
+
};
|
|
543
|
+
const tree = syntaxTree(state);
|
|
544
|
+
for (let node = tree.resolveInner(pos, -1); node; node = node.parent) {
|
|
545
|
+
if (node.name != "List" && node.name != "Program")
|
|
546
|
+
continue;
|
|
547
|
+
if (node.name == "List")
|
|
548
|
+
boundNames(state, node, pos, add);
|
|
549
|
+
// Definitions in a body are in scope in the whole body.
|
|
550
|
+
for (let child = node.firstChild; child; child = child.nextSibling) {
|
|
551
|
+
if (child.name == "List")
|
|
552
|
+
definedNames(state, child, add);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return options;
|
|
556
|
+
}
|
|
557
|
+
/// Completes the names defined or bound in the file that are in scope at the
|
|
558
|
+
/// cursor.
|
|
559
|
+
const localCompletionSource = (context) => {
|
|
560
|
+
const inner = syntaxTree(context.state).resolveInner(context.pos, -1);
|
|
561
|
+
if (inNode(inner, dontComplete))
|
|
562
|
+
return null;
|
|
563
|
+
const word = wordAt(context, inner);
|
|
564
|
+
if (!word)
|
|
565
|
+
return null;
|
|
566
|
+
return { from: word.from, options: namesInScope(context.state, context.pos), validFor: Identifier };
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
// The names that completion offers for Racket: the syntax and procedures of
|
|
570
|
+
// `racket/base`, and the most used ones from the libraries that `#lang racket`
|
|
571
|
+
// loads (racket/list, racket/string, racket/math, racket/set, racket/function
|
|
572
|
+
// and racket/contract), plus rackunit.
|
|
573
|
+
const words = (text) => text.trim().split(/\s+/);
|
|
574
|
+
const racketSyntax = words(`
|
|
575
|
+
define define-values define-syntax define-syntax-rule define/contract define-struct
|
|
576
|
+
define/public define/private define/override struct struct-copy lambda λ case-lambda
|
|
577
|
+
let let* letrec letrec* let-values let*-values letrec-values let/ec let/cc
|
|
578
|
+
if cond case when unless and or else begin begin0 set! set!-values do
|
|
579
|
+
quote quasiquote unquote unquote-splicing syntax quasisyntax unsyntax
|
|
580
|
+
syntax-rules syntax-case syntax-parse with-syntax
|
|
581
|
+
match match* match-lambda match-lambda* match-define match-let match-let*
|
|
582
|
+
for for/list for/vector for/hash for/hasheq for/and for/or for/sum for/product
|
|
583
|
+
for/first for/last for/fold for/foldr for/lists for/set
|
|
584
|
+
for* for*/list for*/vector for*/hash for*/and for*/or for*/sum for*/product
|
|
585
|
+
for*/first for*/last for*/fold for*/lists
|
|
586
|
+
module module+ module* provide require all-defined-out all-from-out
|
|
587
|
+
contract-out struct-out rename-out only-in except-in prefix-in rename-in for-syntax
|
|
588
|
+
parameterize with-handlers with-handlers* local delay force
|
|
589
|
+
class class* new send super-new field init init-field inherit this
|
|
590
|
+
-> ->* ->i
|
|
591
|
+
`);
|
|
592
|
+
const racketProcedures = words(`
|
|
593
|
+
* + - / < <= = > >= abs add1 sub1 quotient remainder modulo quotient/remainder
|
|
594
|
+
max min gcd lcm expt exp log sqrt sqr integer-sqrt exact-round exact-floor
|
|
595
|
+
exact-ceiling exact-truncate round floor ceiling truncate exact->inexact
|
|
596
|
+
inexact->exact exact inexact number->string string->number numerator denominator
|
|
597
|
+
zero? positive? negative? even? odd? exact? inexact? integer? rational? real?
|
|
598
|
+
number? natural? exact-integer? exact-nonnegative-integer? exact-positive-integer?
|
|
599
|
+
nan? infinite? pi sin cos tan atan random
|
|
600
|
+
bitwise-and bitwise-ior bitwise-xor bitwise-not arithmetic-shift
|
|
601
|
+
|
|
602
|
+
cons car cdr caar cadr cdar cddr caddr cdddr list list* cons? pair? null? list?
|
|
603
|
+
empty empty? first second third fourth fifth last rest last-pair length
|
|
604
|
+
list-ref list-tail append append* reverse map for-each andmap ormap foldl foldr
|
|
605
|
+
filter filter-not remove remq remv remove* remove-duplicates member memq memv
|
|
606
|
+
assoc assq assv sort take drop take-right drop-right takef dropf split-at
|
|
607
|
+
splitf-at partition count range inclusive-range make-list build-list flatten
|
|
608
|
+
append-map filter-map index-of indexes-of list-set list-update argmin argmax
|
|
609
|
+
group-by cartesian-product combinations permutations in-combinations shuffle
|
|
610
|
+
apply values call-with-values
|
|
611
|
+
|
|
612
|
+
string string? string-length string-ref string-append string-append*
|
|
613
|
+
substring string-copy string->list list->string string->symbol symbol->string
|
|
614
|
+
string-upcase string-downcase string-titlecase string-split string-join
|
|
615
|
+
string-trim string-replace string-prefix? string-suffix? string-contains?
|
|
616
|
+
string=? string<? string>? string<=? string>=? string-ci=? make-string
|
|
617
|
+
build-string non-empty-string? string-normalize-spaces
|
|
618
|
+
char? char->integer integer->char char-upcase char-downcase char-alphabetic?
|
|
619
|
+
char-numeric? char-whitespace? char-upper-case? char-lower-case? char=? char<?
|
|
620
|
+
char>? char-ci=? symbol? keyword? boolean? procedure? void void? equal? eqv? eq?
|
|
621
|
+
not
|
|
622
|
+
|
|
623
|
+
vector vector? make-vector build-vector vector-ref vector-set! vector-length
|
|
624
|
+
vector->list list->vector vector-map vector-for-each vector-fill! vector-copy
|
|
625
|
+
vector-append vector-count vector-member vector-sort vector-argmin vector-argmax
|
|
626
|
+
|
|
627
|
+
hash hasheq make-hash make-hasheq make-immutable-hash hash? hash-ref hash-ref!
|
|
628
|
+
hash-set hash-set! hash-update hash-update! hash-remove hash-remove!
|
|
629
|
+
hash-has-key? hash-keys hash-values hash->list hash-count hash-empty? hash-map
|
|
630
|
+
hash-for-each hash-clear!
|
|
631
|
+
set seteq list->set set->list set-member? set-add set-remove set-union
|
|
632
|
+
set-intersect set-subtract set-count set-empty? subset?
|
|
633
|
+
|
|
634
|
+
in-range in-inclusive-range in-naturals in-list in-vector in-string in-hash
|
|
635
|
+
in-hash-keys in-hash-values in-set in-indexed in-value in-cycle in-parallel
|
|
636
|
+
sequence->list stream-first stream-rest
|
|
637
|
+
|
|
638
|
+
display displayln write writeln print printf fprintf eprintf format newline
|
|
639
|
+
~a ~s ~v ~r with-output-to-string open-output-string get-output-string
|
|
640
|
+
read-line current-output-port
|
|
641
|
+
|
|
642
|
+
error raise raise-argument-error raise-user-error exn:fail? exn-message
|
|
643
|
+
identity const curry curryr compose compose1 negate conjoin disjoin thunk
|
|
644
|
+
|
|
645
|
+
regexp pregexp regexp-match regexp-match* regexp-match? regexp-replace
|
|
646
|
+
regexp-replace* regexp-split regexp-quote
|
|
647
|
+
|
|
648
|
+
any/c none/c or/c and/c not/c listof list/c vectorof hash/c cons/c one-of/c
|
|
649
|
+
integer-in between/c string-len/c
|
|
650
|
+
|
|
651
|
+
check-equal? check-true check-false check-exn check-not-equal? test-case
|
|
652
|
+
test-suite run-tests
|
|
653
|
+
`);
|
|
654
|
+
|
|
655
|
+
// Racket support. It uses the same grammar as Scheme, with the `racket`
|
|
656
|
+
// dialect turned on for Racket's special forms.
|
|
657
|
+
const racketLanguage = LRLanguage.define({
|
|
658
|
+
name: "racket",
|
|
659
|
+
parser: configuredParser.configure({ dialect: "racket" }),
|
|
660
|
+
languageData,
|
|
661
|
+
});
|
|
662
|
+
const racketSnippets = [
|
|
663
|
+
["define", "procedure", "define (${name} ${params})\n\t${}"],
|
|
664
|
+
["define", "variable", "define ${name} ${value}"],
|
|
665
|
+
["define/contract", "procedure with a contract", "define/contract (${name} ${params})\n\t(-> ${any/c} ${any/c})\n\t${}"],
|
|
666
|
+
["lambda", "anonymous procedure", "lambda (${params})\n\t${}"],
|
|
667
|
+
["let", "local bindings", "let ([${name} ${value}])\n\t${}"],
|
|
668
|
+
["let", "named let loop", "let ${loop} ([${name} ${init}])\n\t${}"],
|
|
669
|
+
["let*", "sequential bindings", "let* ([${name} ${value}])\n\t${}"],
|
|
670
|
+
["if", "conditional", "if ${test}\n\t${then}\n\t${else}"],
|
|
671
|
+
["cond", "conditional", "cond\n\t[${test} ${result}]\n\t[else ${default}]"],
|
|
672
|
+
["case", "conditional", "case ${key}\n\t[(${datum}) ${result}]\n\t[else ${default}]"],
|
|
673
|
+
["when", "conditional", "when ${test}\n\t${}"],
|
|
674
|
+
["unless", "conditional", "unless ${test}\n\t${}"],
|
|
675
|
+
["match", "pattern match", "match ${value}\n\t[${pattern} ${result}]\n\t[_ ${default}]"],
|
|
676
|
+
["struct", "structure type", "struct ${name} (${field})\n\t#:transparent"],
|
|
677
|
+
["for", "loop", "for ([${x} ${sequence}])\n\t${}"],
|
|
678
|
+
["for/list", "loop that builds a list", "for/list ([${x} ${sequence}])\n\t${}"],
|
|
679
|
+
["for/fold", "loop with an accumulator", "for/fold ([${acc} ${init}])\n\t\t ([${x} ${sequence}])\n\t${}"],
|
|
680
|
+
["provide", "export names", "provide ${name}"],
|
|
681
|
+
["require", "import a library", "require ${racket/list}"],
|
|
682
|
+
["module+", "test submodule", "module+ test\n\t(require rackunit)\n\t${}"],
|
|
683
|
+
];
|
|
684
|
+
/// Completes `racket/base` syntax and procedures, the common ones from
|
|
685
|
+
/// `#lang racket`, and snippets for Racket's common forms.
|
|
686
|
+
const racketCompletionSource = builtinSource(racketSyntax, racketProcedures, racketSnippets);
|
|
687
|
+
/// Racket language support, with completion for Racket's syntax and
|
|
688
|
+
/// procedures, snippets, and the names defined in the file.
|
|
689
|
+
function racket() {
|
|
690
|
+
return new LanguageSupport(racketLanguage, [
|
|
691
|
+
racketLanguage.data.of({ autocomplete: racketCompletionSource }),
|
|
692
|
+
racketLanguage.data.of({ autocomplete: localCompletionSource }),
|
|
693
|
+
]);
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
const schemeLanguage = LRLanguage.define({
|
|
697
|
+
name: "scheme",
|
|
698
|
+
parser: configuredParser,
|
|
699
|
+
languageData,
|
|
700
|
+
});
|
|
701
|
+
/// Scheme language support, with completion for R7RS syntax and procedures,
|
|
702
|
+
/// snippets, and the names defined in the file.
|
|
703
|
+
function scheme() {
|
|
704
|
+
return new LanguageSupport(schemeLanguage, [
|
|
705
|
+
schemeLanguage.data.of({ autocomplete: builtinCompletionSource }),
|
|
706
|
+
schemeLanguage.data.of({ autocomplete: localCompletionSource }),
|
|
707
|
+
]);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
export { builtinCompletionSource, localCompletionSource, r7rsProcedures, r7rsSyntax, racket, racketCompletionSource, racketLanguage, racketProcedures, racketSyntax, scheme, schemeLanguage };
|