functionalscript 0.0.481 → 0.0.483
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/commonjs/build/module.f.cjs +4 -4
- package/commonjs/build/test.f.cjs +1 -1
- package/commonjs/package/dependencies/module.f.cjs +3 -3
- package/commonjs/package/dependencies/test.f.cjs +1 -2
- package/commonjs/package/module.f.cjs +2 -1
- package/commonjs/path/test.f.cjs +2 -5
- package/dev/module.mjs +1 -1
- package/dev/test.f.cjs +1 -1
- package/doc/LANGUAGE.md +2 -2
- package/fsm/module.f.cjs +2 -2
- package/json/tokenizer/module.f.cjs +39 -38
- package/package.json +1 -1
- package/types/btree/module.f.cjs +2 -0
- package/types/string_set/module.f.cjs +3 -0
|
@@ -3,13 +3,13 @@ const module_ = require('../module/module.f.cjs')
|
|
|
3
3
|
const { idToString, dir } = module_
|
|
4
4
|
const function_ = require('../module/function/module.f.cjs')
|
|
5
5
|
const map = require('../../types/map/module.f.cjs')
|
|
6
|
-
const { setReplace } = map
|
|
6
|
+
const { empty: mapEmpty, setReplace } = map
|
|
7
7
|
const object = require('../../types/object/module.f.cjs')
|
|
8
8
|
const { fromMap } = object
|
|
9
9
|
const path = require('../path/module.f.cjs')
|
|
10
10
|
const { parseAndFind } = path
|
|
11
11
|
const stringSet = require('../../types/string_set/module.f.cjs')
|
|
12
|
-
const { set: setSet, contains: setContains } = stringSet
|
|
12
|
+
const { set: setSet, contains: setContains, empty: stringSetEmpty } = stringSet
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @template M
|
|
@@ -73,7 +73,7 @@ const getOrBuild = compile => packageGet => moduleMapInterface => {
|
|
|
73
73
|
const [kind, result] = compile(source)
|
|
74
74
|
if (kind === 'error') { return error(['compilation error', result])(moduleMap) }
|
|
75
75
|
// build
|
|
76
|
-
const [[state, value], [requireMap, moduleMap2]] = result(require_)([
|
|
76
|
+
const [[state, value], [requireMap, moduleMap2]] = result(require_)([mapEmpty, moduleMap])
|
|
77
77
|
const x = state === 'error' ?
|
|
78
78
|
error(['runtime error', value]) :
|
|
79
79
|
set(['ok', { exports: value, requireMap: fromMap(requireMap) }])
|
|
@@ -93,7 +93,7 @@ const getOrBuild = compile => packageGet => moduleMapInterface => {
|
|
|
93
93
|
if (p === null) { return notFound(moduleMap) }
|
|
94
94
|
// check file
|
|
95
95
|
const source = p.file(moduleId.path.join('/'))
|
|
96
|
-
return (source === null ? notFound : build(
|
|
96
|
+
return (source === null ? notFound : build(stringSetEmpty)(moduleId)(source))(moduleMap)
|
|
97
97
|
}
|
|
98
98
|
return f
|
|
99
99
|
}
|
|
@@ -71,7 +71,7 @@ const getOrBuild = _.getOrBuild
|
|
|
71
71
|
(/** @type {module_.MapInterface<map.Map<module_.State>>} */(map))
|
|
72
72
|
|
|
73
73
|
module.exports = () => {
|
|
74
|
-
let [r, m] = getOrBuild({ package: '', path: ['index.js'] })(
|
|
74
|
+
let [r, m] = getOrBuild({ package: '', path: ['index.js'] })(map.empty)
|
|
75
75
|
{
|
|
76
76
|
const x = JSON.stringify(r)
|
|
77
77
|
if (x !==
|
|
@@ -8,14 +8,14 @@ const { entries } = Object
|
|
|
8
8
|
|
|
9
9
|
/** @typedef {{readonly[k in string]: string}} DependencyMapJson */
|
|
10
10
|
|
|
11
|
-
/** @typedef {DependencyMapJson|
|
|
11
|
+
/** @typedef {DependencyMapJson|null} DependenciesJson */
|
|
12
12
|
|
|
13
13
|
/** @type {(entry: json.Entry) => boolean} */
|
|
14
14
|
const isDependencyJson = ([, v]) => typeof v === 'string'
|
|
15
15
|
|
|
16
|
-
/** @type {(j: json.Unknown
|
|
16
|
+
/** @type {(j: json.Unknown) => j is DependenciesJson} */
|
|
17
17
|
const isDependenciesJson = j => {
|
|
18
|
-
if (j ===
|
|
18
|
+
if (j === null) { return true }
|
|
19
19
|
if (!isObject(j)) { return false }
|
|
20
20
|
return every(map(isDependencyJson)(entries(j)))
|
|
21
21
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const _ = require('./module.f.cjs')
|
|
2
2
|
|
|
3
3
|
module.exports = () => {
|
|
4
|
-
if (!_.isDependenciesJson(
|
|
5
|
-
if (_.isDependenciesJson(null)) { throw 'error' }
|
|
4
|
+
if (!_.isDependenciesJson(null)) { throw 'error' }
|
|
6
5
|
if (!_.isDependenciesJson({})) { throw 'error' }
|
|
7
6
|
if (!_.isDependenciesJson({'a':'b'})) { throw 'error' }
|
|
8
7
|
if (_.isDependenciesJson({ 'a': 12 })) { throw 'error' }
|
|
@@ -2,6 +2,7 @@ const json = require('../../json/module.f.cjs')
|
|
|
2
2
|
const { isObject } = json
|
|
3
3
|
const dependencies = require('./dependencies/module.f.cjs')
|
|
4
4
|
const { isDependenciesJson } = dependencies
|
|
5
|
+
const { at } = require('../../types/object/module.f.cjs')
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* @typedef {{
|
|
@@ -16,7 +17,7 @@ const isPackageJson = j => {
|
|
|
16
17
|
if (!isObject(j)) { return false }
|
|
17
18
|
if (typeof j.name !== 'string') { return false }
|
|
18
19
|
if (typeof j.version !== 'string') { return false }
|
|
19
|
-
if (!isDependenciesJson(
|
|
20
|
+
if (!isDependenciesJson(at('dependencies')(j))) { return false }
|
|
20
21
|
return true
|
|
21
22
|
}
|
|
22
23
|
|
package/commonjs/path/test.f.cjs
CHANGED
|
@@ -9,11 +9,8 @@ const package_ = require('../package/module.f.cjs')
|
|
|
9
9
|
/** @type {<T>(o: object.Map<T>) => (s: string) => T|null} */
|
|
10
10
|
const i = o => s => at(s)(o)
|
|
11
11
|
|
|
12
|
-
/** @type {(g: json.Unknown
|
|
13
|
-
const stringify =
|
|
14
|
-
if (g === undefined) { throw g }
|
|
15
|
-
return json.stringify(identity)(g)
|
|
16
|
-
}
|
|
12
|
+
/** @type {(g: json.Unknown) => string} */
|
|
13
|
+
const stringify = json.stringify(identity)
|
|
17
14
|
|
|
18
15
|
module.exports = {
|
|
19
16
|
0: () => {
|
package/dev/module.mjs
CHANGED
package/dev/test.f.cjs
CHANGED
package/doc/LANGUAGE.md
CHANGED
|
@@ -93,7 +93,7 @@ const functionDouble = a => a * 2
|
|
|
93
93
|
const structure = { name: "John", surname: "Smith" }
|
|
94
94
|
const array = [1, 2, 3]
|
|
95
95
|
const nestedStructure = {
|
|
96
|
-
address:
|
|
96
|
+
address: null,
|
|
97
97
|
serialNumber: "123-45-78",
|
|
98
98
|
sum: 14 + myConst + functionDouble(4),
|
|
99
99
|
moreInfo: {
|
|
@@ -226,7 +226,7 @@ const iterable = list => ({
|
|
|
226
226
|
let i = list
|
|
227
227
|
while (true) {
|
|
228
228
|
const r = next(i)
|
|
229
|
-
if (r ===
|
|
229
|
+
if (r === null) { return }
|
|
230
230
|
yield r.first
|
|
231
231
|
i = r.tail
|
|
232
232
|
}
|
package/fsm/module.f.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const list = require('../types/list/module.f.cjs')
|
|
2
|
-
const { equal, isEmpty, fold, toArray, scan, foldScan } = list
|
|
2
|
+
const { equal, isEmpty, fold, toArray, scan, foldScan, empty: emptyList } = list
|
|
3
3
|
const byteSet = require('../types/byte_set/module.f.cjs')
|
|
4
4
|
const { toRangeMap, union: byteSetUnion, one, empty } = byteSet
|
|
5
5
|
const sortedSet = require('../types/sorted_set/module.f.cjs')
|
|
@@ -66,7 +66,7 @@ const scanFetch = scan(fetchOp)
|
|
|
66
66
|
const addEntry = grammar => set => dfa => {
|
|
67
67
|
const s = stringifyIdentity(set)
|
|
68
68
|
if (s in dfa) { return dfa }
|
|
69
|
-
const setMap = fold(foldOp(set))(
|
|
69
|
+
const setMap = fold(foldOp(set))(emptyList)(grammar)
|
|
70
70
|
const stringMap = toArray(scanStringify(setMap))
|
|
71
71
|
const newDfa = { ...dfa, [s]: stringMap }
|
|
72
72
|
const newStates = scanFetch(setMap)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const operator = require('../../types/function/operator/module.f.cjs')
|
|
2
2
|
const list = require('../../types/list/module.f.cjs')
|
|
3
3
|
const { contains } = require('../../types/range/module.f.cjs')
|
|
4
|
-
const { stateScan, flat } = list
|
|
4
|
+
const { empty, stateScan, flat } = list
|
|
5
5
|
const { fromCharCode } = String
|
|
6
6
|
const {
|
|
7
7
|
range,
|
|
@@ -125,7 +125,7 @@ const containsSmallLetter = contains(latinSmallLetterRange)
|
|
|
125
125
|
|
|
126
126
|
/** @typedef {{ readonly kind: 'eof'}} EofState */
|
|
127
127
|
|
|
128
|
-
/** @typedef {number|
|
|
128
|
+
/** @typedef {number|null} CharCodeOrEof */
|
|
129
129
|
|
|
130
130
|
/** @type {(old: string) => (input: number) => string} */
|
|
131
131
|
const appendChar = old => input => `${old}${fromCharCode(input)}`
|
|
@@ -133,13 +133,13 @@ const appendChar = old => input => `${old}${fromCharCode(input)}`
|
|
|
133
133
|
/** @type {(state: InitialState) => (input: number) => readonly[list.List<JsonToken>, TokenizerState]} */
|
|
134
134
|
const initialStateOp = initialState => input => {
|
|
135
135
|
if (containsDigitOneNine(input)) {
|
|
136
|
-
return [
|
|
136
|
+
return [empty, { kind: 'number', value: fromCharCode(input), numberKind: 'int' }]
|
|
137
137
|
}
|
|
138
138
|
if (containsSmallLetter(input)) {
|
|
139
|
-
return [
|
|
139
|
+
return [empty, { kind: 'keyword', value: fromCharCode(input) }]
|
|
140
140
|
}
|
|
141
141
|
if (isWhiteSpace(input)) {
|
|
142
|
-
return [
|
|
142
|
+
return [empty, initialState]
|
|
143
143
|
}
|
|
144
144
|
switch (input) {
|
|
145
145
|
case leftCurlyBracket: return [[{ kind: '{' }], initialState]
|
|
@@ -148,9 +148,9 @@ const initialStateOp = initialState => input => {
|
|
|
148
148
|
case comma: return [[{ kind: ',' }], initialState]
|
|
149
149
|
case leftSquareBracket: return [[{ kind: '[' }], initialState]
|
|
150
150
|
case rightSquareBracket: return [[{ kind: ']' }], initialState]
|
|
151
|
-
case quotationMark: return [
|
|
152
|
-
case digit0: return [
|
|
153
|
-
case hyphenMinus: return [
|
|
151
|
+
case quotationMark: return [empty, { kind: 'string', value: '' }]
|
|
152
|
+
case digit0: return [empty, { kind: 'number', value: fromCharCode(input), numberKind: '0' }]
|
|
153
|
+
case hyphenMinus: return [empty, { kind: 'number', value: fromCharCode(input), numberKind: '-' }]
|
|
154
154
|
default: return [[{ kind: 'error', message: 'unexpected character' }], initialState]
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -160,49 +160,49 @@ const parseNumberStateOp = state => input => {
|
|
|
160
160
|
if (input === fullStop) {
|
|
161
161
|
switch (state.numberKind) {
|
|
162
162
|
case '0':
|
|
163
|
-
case 'int': return [
|
|
163
|
+
case 'int': return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: '.' }]
|
|
164
164
|
default: return tokenizeOp({ kind: 'invalidNumber' })(input)
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
if (input === digit0) {
|
|
168
168
|
switch (state.numberKind) {
|
|
169
169
|
case '0': return tokenizeOp({ kind: 'invalidNumber' })(input)
|
|
170
|
-
case '-': return [
|
|
171
|
-
case '.': return [
|
|
170
|
+
case '-': return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: '0' }]
|
|
171
|
+
case '.': return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: 'fractional' }]
|
|
172
172
|
case 'e':
|
|
173
173
|
case 'e+':
|
|
174
|
-
case 'e-': return [
|
|
175
|
-
default: return [
|
|
174
|
+
case 'e-': return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: 'expDigits' }]
|
|
175
|
+
default: return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: state.numberKind }]
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
if (containsDigitOneNine(input)) {
|
|
179
179
|
switch (state.numberKind) {
|
|
180
180
|
case '0': return tokenizeOp({ kind: 'invalidNumber' })(input)
|
|
181
|
-
case '-': return [
|
|
182
|
-
case '.': return [
|
|
181
|
+
case '-': return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: 'int' }]
|
|
182
|
+
case '.': return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: 'fractional' }]
|
|
183
183
|
case 'e':
|
|
184
184
|
case 'e+':
|
|
185
|
-
case 'e-': return [
|
|
186
|
-
default: return [
|
|
185
|
+
case 'e-': return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: 'expDigits' }]
|
|
186
|
+
default: return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: state.numberKind }]
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
if (input === latinSmallLetterE || input === latinCapitalLetterE) {
|
|
190
190
|
switch (state.numberKind) {
|
|
191
191
|
case '0':
|
|
192
192
|
case 'int':
|
|
193
|
-
case 'fractional': return [
|
|
193
|
+
case 'fractional': return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: 'e' }]
|
|
194
194
|
default: return tokenizeOp({ kind: 'invalidNumber' })(input)
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
if (input === hyphenMinus) {
|
|
198
198
|
switch (state.numberKind) {
|
|
199
|
-
case 'e': return [
|
|
199
|
+
case 'e': return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: 'e-' }]
|
|
200
200
|
default: return tokenizeOp({ kind: 'invalidNumber' })(input)
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
if (input === plusSign) {
|
|
204
204
|
switch (state.numberKind) {
|
|
205
|
-
case 'e': return [
|
|
205
|
+
case 'e': return [empty, { kind: 'number', value: appendChar(state.value)(input), numberKind: 'e+' }]
|
|
206
206
|
default: return tokenizeOp({ kind: 'invalidNumber' })(input)
|
|
207
207
|
}
|
|
208
208
|
}
|
|
@@ -261,15 +261,15 @@ const invalidNumberStateOp = () => input => {
|
|
|
261
261
|
const next = tokenizeOp({ kind: 'initial' })(input)
|
|
262
262
|
return [{ first: { kind: 'error', message: 'invalid number' }, tail: next[0] }, next[1]]
|
|
263
263
|
}
|
|
264
|
-
return [
|
|
264
|
+
return [empty, { kind: 'invalidNumber' }]
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
/** @type {(state: ParseStringState) => (input: number) => readonly[list.List<JsonToken>, TokenizerState]} */
|
|
268
268
|
const parseStringStateOp = state => input => {
|
|
269
269
|
switch (input) {
|
|
270
270
|
case quotationMark: return [[{ kind: 'string', value: state.value }], { kind: 'initial' }]
|
|
271
|
-
case reverseSolidus: return [
|
|
272
|
-
default: return [
|
|
271
|
+
case reverseSolidus: return [empty, { kind: 'escapeChar', value: state.value }]
|
|
272
|
+
default: return [empty, { kind: 'string', value: appendChar(state.value)(input) }]
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
|
|
@@ -278,13 +278,13 @@ const parseEscapeCharStateOp = state => input => {
|
|
|
278
278
|
switch (input) {
|
|
279
279
|
case quotationMark:
|
|
280
280
|
case reverseSolidus:
|
|
281
|
-
case solidus: return [
|
|
282
|
-
case latinSmallLetterB: return [
|
|
283
|
-
case latinSmallLetterF: return [
|
|
284
|
-
case latinSmallLetterN: return [
|
|
285
|
-
case latinSmallLetterR: return [
|
|
286
|
-
case latinSmallLetterT: return [
|
|
287
|
-
case latinSmallLetterU: return [
|
|
281
|
+
case solidus: return [empty, { kind: 'string', value: appendChar(state.value)(input) }]
|
|
282
|
+
case latinSmallLetterB: return [empty, { kind: 'string', value: appendChar(state.value)(backspace) }]
|
|
283
|
+
case latinSmallLetterF: return [empty, { kind: 'string', value: appendChar(state.value)(ff) }]
|
|
284
|
+
case latinSmallLetterN: return [empty, { kind: 'string', value: appendChar(state.value)(lf) }]
|
|
285
|
+
case latinSmallLetterR: return [empty, { kind: 'string', value: appendChar(state.value)(cr) }]
|
|
286
|
+
case latinSmallLetterT: return [empty, { kind: 'string', value: appendChar(state.value)(ht) }]
|
|
287
|
+
case latinSmallLetterU: return [empty, { kind: 'unicodeChar', value: state.value, unicode: 0, hexIndex: 0 }]
|
|
288
288
|
default: {
|
|
289
289
|
const next = tokenizeOp({ kind: 'string', value: state.value })(input)
|
|
290
290
|
return [{ first: { kind: 'error', message: 'unescaped character' }, tail: next[0] }, next[1]]
|
|
@@ -292,22 +292,23 @@ const parseEscapeCharStateOp = state => input => {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
/** @type {(hex: number) => number|
|
|
295
|
+
/** @type {(hex: number) => number|null} */
|
|
296
296
|
const hexDigitToNumber = hex => {
|
|
297
297
|
if (containsDigit(hex)) { return hex - digit0 }
|
|
298
298
|
if (containsCapitalAF(hex)) { return hex - latinCapitalLetterA + 10 }
|
|
299
299
|
if (containsSmallAF(hex)) { return hex - latinSmallLetterA + 10 }
|
|
300
|
+
return null
|
|
300
301
|
}
|
|
301
302
|
|
|
302
303
|
/** @type {(state: ParseUnicodeCharState) => (input: number) => readonly[list.List<JsonToken>, TokenizerState]} */
|
|
303
304
|
const parseUnicodeCharStateOp = state => input => {
|
|
304
305
|
const hexValue = hexDigitToNumber(input)
|
|
305
|
-
if (hexValue ===
|
|
306
|
+
if (hexValue === null) {
|
|
306
307
|
const next = tokenizeOp({ kind: 'string', value: state.value })(input)
|
|
307
308
|
return [{ first: { kind: 'error', message: 'invalid hex value' }, tail: next[0] }, next[1]]
|
|
308
309
|
}
|
|
309
310
|
const newUnicode = state.unicode | (hexValue << (3 - state.hexIndex) * 4)
|
|
310
|
-
return [
|
|
311
|
+
return [empty, state.hexIndex === 3 ?
|
|
311
312
|
{ kind: 'string', value: appendChar(state.value)(newUnicode) } :
|
|
312
313
|
{ kind: 'unicodeChar', value: state.value, unicode: newUnicode, hexIndex: state.hexIndex + 1 }]
|
|
313
314
|
}
|
|
@@ -325,7 +326,7 @@ const stringToKeywordToken = s => {
|
|
|
325
326
|
/** @type {(state: ParseKeywordState) => (input: number) => readonly[list.List<JsonToken>, TokenizerState]} */
|
|
326
327
|
const parseKeyWordStateOp = state => input => {
|
|
327
328
|
if (containsSmallLetter(input)) {
|
|
328
|
-
return [
|
|
329
|
+
return [empty, { kind: 'keyword', value: appendChar(state.value)(input) }]
|
|
329
330
|
}
|
|
330
331
|
const keyWordToken = stringToKeywordToken(state.value)
|
|
331
332
|
const next = tokenizeOp({ kind: 'initial' })(input)
|
|
@@ -333,7 +334,7 @@ const parseKeyWordStateOp = state => input => {
|
|
|
333
334
|
}
|
|
334
335
|
|
|
335
336
|
/** @type {(state: EofState) => (input: number) => readonly[list.List<JsonToken>, TokenizerState]} */
|
|
336
|
-
const eofStateOp = state =>
|
|
337
|
+
const eofStateOp = state => () => [[{ kind: 'error', message: 'eof' }], state]
|
|
337
338
|
|
|
338
339
|
/** @type {operator.StateScan<number, TokenizerState, list.List<JsonToken>>} */
|
|
339
340
|
const tokenizeCharCodeOp = state => {
|
|
@@ -352,7 +353,7 @@ const tokenizeCharCodeOp = state => {
|
|
|
352
353
|
/** @type {(state: TokenizerState) => readonly[list.List<JsonToken>, TokenizerState]} */
|
|
353
354
|
const tokenizeEofOp = state => {
|
|
354
355
|
switch (state.kind) {
|
|
355
|
-
case 'initial': return [
|
|
356
|
+
case 'initial': return [empty, { kind: 'eof' }]
|
|
356
357
|
case 'keyword': return [[stringToKeywordToken(state.value)], { kind: 'eof' }]
|
|
357
358
|
case 'string':
|
|
358
359
|
case 'escapeChar':
|
|
@@ -372,14 +373,14 @@ const tokenizeEofOp = state => {
|
|
|
372
373
|
}
|
|
373
374
|
|
|
374
375
|
/** @type {operator.StateScan<CharCodeOrEof, TokenizerState, list.List<JsonToken>>} */
|
|
375
|
-
const tokenizeOp = state => input => input ===
|
|
376
|
+
const tokenizeOp = state => input => input === null ? tokenizeEofOp(state) : tokenizeCharCodeOp(state)(input)
|
|
376
377
|
|
|
377
378
|
const scanTokenize = stateScan(tokenizeOp)
|
|
378
379
|
|
|
379
380
|
const initial = scanTokenize({ kind: 'initial' })
|
|
380
381
|
|
|
381
382
|
/** @type {(input: list.List<number>) => list.List<JsonToken>} */
|
|
382
|
-
const tokenize = input => flat(initial(flat([/** @type {list.List<CharCodeOrEof>} */(input), [
|
|
383
|
+
const tokenize = input => flat(initial(flat([/** @type {list.List<CharCodeOrEof>} */(input), [null]])))
|
|
383
384
|
|
|
384
385
|
module.exports = {
|
|
385
386
|
/** @readonly */
|
package/package.json
CHANGED
package/types/btree/module.f.cjs
CHANGED
|
@@ -6,6 +6,7 @@ const {
|
|
|
6
6
|
set: { set: btreeSet },
|
|
7
7
|
/** @type {(s: StringSet) => list.List<string>} */
|
|
8
8
|
values,
|
|
9
|
+
empty,
|
|
9
10
|
} = btree
|
|
10
11
|
const { cmp } = require("../string/module.f.cjs")
|
|
11
12
|
const list = require('../list/module.f.cjs')
|
|
@@ -29,6 +30,8 @@ const fromValues = fold(set)(undefined)
|
|
|
29
30
|
const remove = compose(cmp)(btreeRemove)
|
|
30
31
|
|
|
31
32
|
module.exports = {
|
|
33
|
+
/** @readonly */
|
|
34
|
+
empty,
|
|
32
35
|
/** @readonly */
|
|
33
36
|
contains,
|
|
34
37
|
/** @readonly */
|