trebol 0.1.1 → 0.1.2
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/README.md +10 -1
- package/dist/cli.js +13747 -11409
- package/dist/fonts/OFL.txt +93 -0
- package/dist/fonts/inter-cyrillic-ext.woff2 +0 -0
- package/dist/fonts/inter-cyrillic.woff2 +0 -0
- package/dist/fonts/inter-greek-ext.woff2 +0 -0
- package/dist/fonts/inter-greek.woff2 +0 -0
- package/dist/fonts/inter-latin-ext.woff2 +0 -0
- package/dist/fonts/inter-latin.woff2 +0 -0
- package/dist/fonts/inter-vietnamese.woff2 +0 -0
- package/dist/lib/core/boot.js +2 -1
- package/dist/lib/core/func.d.ts +4 -0
- package/dist/lib/core/natives/control.js +1 -1
- package/dist/lib/core/natives/series.js +11 -1
- package/dist/lib/core/natives/text.js +3 -0
- package/dist/lib/host/browser.js +951 -58
- package/dist/lib/host/devlog.d.ts +11 -0
- package/dist/lib/host/devlog.js +13 -0
- package/dist/lib/host/devtools.d.ts +23 -0
- package/dist/lib/host/devtools.js +626 -0
- package/dist/lib/host/fonts/OFL.txt +93 -0
- package/dist/lib/host/fonts/inter-cyrillic-ext.woff2 +0 -0
- package/dist/lib/host/fonts/inter-cyrillic.woff2 +0 -0
- package/dist/lib/host/fonts/inter-greek-ext.woff2 +0 -0
- package/dist/lib/host/fonts/inter-greek.woff2 +0 -0
- package/dist/lib/host/fonts/inter-latin-ext.woff2 +0 -0
- package/dist/lib/host/fonts/inter-latin.woff2 +0 -0
- package/dist/lib/host/fonts/inter-vietnamese.woff2 +0 -0
- package/dist/lib/host/fonts.d.ts +11 -0
- package/dist/lib/host/fonts.js +29 -0
- package/dist/lib/host/index.d.ts +2 -0
- package/dist/lib/host/index.js +3 -1
- package/dist/lib/host/js.d.ts +5 -0
- package/dist/lib/host/js.js +130 -0
- package/dist/lib/host/markdown.d.ts +2 -0
- package/dist/lib/host/markdown.js +10 -0
- package/dist/lib/host/modules.d.ts +4 -0
- package/dist/lib/host/modules.js +39 -1
- package/dist/lib/host/net.js +9 -1
- package/dist/lib/host/orbit.d.ts +121 -0
- package/dist/lib/host/orbit.js +374 -0
- package/dist/lib/host/rows.d.ts +14 -0
- package/dist/lib/host/rows.js +29 -0
- package/dist/lib/host/scheduler.d.ts +6 -0
- package/dist/lib/host/scheduler.js +60 -36
- package/dist/lib/host/theme.js +207 -2
- package/dist/lib/ui/i18n.trb +6 -0
- package/dist/lib/ui/test.trb +565 -0
- package/dist/lib/ui/ui.trb +523 -82
- package/dist/trebol.js +1346 -124
- package/editors/vscode/README.md +15 -0
- package/editors/vscode/language-configuration.json +28 -0
- package/editors/vscode/package.json +42 -0
- package/editors/vscode/syntaxes/trebol.tmLanguage.json +237 -0
- package/package.json +7 -3
- package/src/core/boot.ts +1 -1
- package/src/core/func.ts +4 -0
- package/src/core/natives/control.ts +1 -1
- package/src/core/natives/series.ts +9 -1
- package/src/core/natives/text.ts +2 -0
- package/src/host/browser.ts +962 -51
- package/src/host/devlog.ts +16 -0
- package/src/host/devtools.ts +641 -0
- package/src/host/fonts/OFL.txt +93 -0
- package/src/host/fonts/inter-cyrillic-ext.woff2 +0 -0
- package/src/host/fonts/inter-cyrillic.woff2 +0 -0
- package/src/host/fonts/inter-greek-ext.woff2 +0 -0
- package/src/host/fonts/inter-greek.woff2 +0 -0
- package/src/host/fonts/inter-latin-ext.woff2 +0 -0
- package/src/host/fonts/inter-latin.woff2 +0 -0
- package/src/host/fonts/inter-vietnamese.woff2 +0 -0
- package/src/host/fonts.ts +39 -0
- package/src/host/index.ts +3 -1
- package/src/host/js.ts +127 -0
- package/src/host/markdown.ts +9 -0
- package/src/host/modules.ts +33 -1
- package/src/host/net.ts +9 -1
- package/src/host/orbit.ts +432 -0
- package/src/host/rows.ts +30 -0
- package/src/host/scheduler.ts +62 -36
- package/src/host/theme.ts +207 -2
- package/src/ui/i18n.trb +6 -0
- package/src/ui/test.trb +565 -0
- package/src/ui/ui.trb +523 -82
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/lib/core/boot.js
CHANGED
|
@@ -40,7 +40,8 @@ export function makeRuntime() {
|
|
|
40
40
|
for (const [name, bits] of Object.entries(TYPESETS))
|
|
41
41
|
set(name, typeset(bits));
|
|
42
42
|
for (const def of registeredNatives())
|
|
43
|
-
|
|
43
|
+
if (def.hidden !== true)
|
|
44
|
+
set(def.name, { t: K.Native, p: def });
|
|
44
45
|
for (const [name, fn] of OPS) {
|
|
45
46
|
const i = ctxFind(lib, intern(fn));
|
|
46
47
|
if (i < 0)
|
package/dist/lib/core/func.d.ts
CHANGED
|
@@ -51,6 +51,10 @@ export interface NativeDef {
|
|
|
51
51
|
readonly specBlock: BlockCell;
|
|
52
52
|
readonly id: number;
|
|
53
53
|
readonly name: string;
|
|
54
|
+
/** Explicit data for natives the host makes after boot, such as which JavaScript function a call runs. */
|
|
55
|
+
readonly data?: number;
|
|
56
|
+
/** Kept out of lib: only the host hands out natives built on it. */
|
|
57
|
+
readonly hidden?: boolean;
|
|
54
58
|
}
|
|
55
59
|
/** The payload of an op! cell: the two-argument function it calls. */
|
|
56
60
|
export interface OpDef {
|
|
@@ -323,7 +323,7 @@ native('until', '["Evaluates the block until it gives true." body [block!]]', (_
|
|
|
323
323
|
f.trap = LOOP_TRAP;
|
|
324
324
|
return doBlock(f.args[0]);
|
|
325
325
|
});
|
|
326
|
-
native('break', '["Leaves the loop it is in." /return value [any-value!]]', (_t, f) => ({ k: 'throw', e: { kind: T.Break, v: f.args[0].t === K.Logic ? f.args[1] :
|
|
326
|
+
native('break', '["Leaves the loop it is in." /return value [any-value!]]', (_t, f) => ({ k: 'throw', e: { kind: T.Break, v: f.args[0].t === K.Logic ? f.args[1] : UNSET, name: null } }));
|
|
327
327
|
native('continue', '["Goes on with the next turn of the loop it is in." ]', () => ({ k: 'throw', e: { kind: T.Continue, v: UNSET, name: null } }));
|
|
328
328
|
// --- functions -------------------------------------------------------------------
|
|
329
329
|
native('return', '["Leaves the function it is in, giving a value." value [any-type!]]', (_t, f) => ({ k: 'throw', e: { kind: T.Return, v: f.args[0], name: null } }));
|
|
@@ -9,8 +9,9 @@ import { ownMeta, NONE, TRUE, integer, char, logic, strictEqual, } from "../valu
|
|
|
9
9
|
import { bindSeries, copyDeep } from "../ctx.js";
|
|
10
10
|
import { isEqual, compare, foldCase } from "../compare.js";
|
|
11
11
|
import { pick } from "../access.js";
|
|
12
|
-
import { context, time, sameValue } from "../values.js";
|
|
12
|
+
import { context, time, sameValue, string } from "../values.js";
|
|
13
13
|
import { dateDiff } from "./math.js";
|
|
14
|
+
import { sourceOf } from "../mold.js";
|
|
14
15
|
import { splice, itemsFor, lengthOf, at, clampIndex, } from "../series.js";
|
|
15
16
|
import { T } from "../eval.js";
|
|
16
17
|
import { native, value, fail, truthy, doBlock } from "./define.js";
|
|
@@ -80,6 +81,11 @@ native('at', '["The series at a position, counted from where it is." series [ser
|
|
|
80
81
|
native('index?', '["The position of the series, from 1." series [series!]]', (_t, f) => value(integer(f.args[0].i + 1)));
|
|
81
82
|
native('head?', '["True if the series is at its head." series [series!]]', (_t, f) => value(logic(f.args[0].i === 0)));
|
|
82
83
|
native('tail?', '["True if the series is at its tail." series [series!]]', (_t, f) => value(logic(lengthOf(f.args[0]) === 0)));
|
|
84
|
+
native('loaded-at', '["Where the value at the position of a block was loaded from, as file:line:col; none if it was made at run time." block [any-block!]]', (_t, f) => {
|
|
85
|
+
const b = f.args[0];
|
|
86
|
+
const at = sourceOf(b.s, b.i);
|
|
87
|
+
return value(at === null ? NONE : string(at));
|
|
88
|
+
});
|
|
83
89
|
// --- editing ---------------------------------------------------------------------
|
|
84
90
|
const PUT_SPEC = 'series [series!] value [any-value!] /part "Put in only part of the value" range [integer! series!] /only "A block goes in as one value" /dup "Put it in several times" count [integer!]';
|
|
85
91
|
const putArgs = (f) => toPut(f.args[0], f.args[1], used(f.args[4]), used(f.args[2]) ? f.args[3] : null, used(f.args[5]) ? f.args[6] : null);
|
|
@@ -138,6 +144,10 @@ native('copy', '["A copy of the series, map, object or bitset." value [series! m
|
|
|
138
144
|
const part = { data: b.s.data.slice(from, end) };
|
|
139
145
|
if (b.s.nl)
|
|
140
146
|
part.nl = b.s.nl.slice(from, end);
|
|
147
|
+
if (b.s.pos)
|
|
148
|
+
part.pos = b.s.pos.slice(from, end);
|
|
149
|
+
if (b.s.file !== undefined)
|
|
150
|
+
part.file = b.s.file;
|
|
141
151
|
return value({ t: b.t, s: deep ? copyDeep(part) : part, i: 0 });
|
|
142
152
|
}
|
|
143
153
|
return value({ t: s.t, s: { data: s.s.data.slice(from, end) }, i: 0 });
|
|
@@ -156,6 +156,9 @@ function toKind(k, v) {
|
|
|
156
156
|
return { t: k, s: { data: codePoints(spell(v.sym)) }, i: 0 };
|
|
157
157
|
if (v.t === K.Char)
|
|
158
158
|
return { t: k, s: { data: [v.v] }, i: 0 };
|
|
159
|
+
// the text itself, so to string! <a> is "a", as in R3; form gives "<a>"
|
|
160
|
+
if (isAnyString(v.t))
|
|
161
|
+
return { t: k, s: { data: v.s.data.slice(v.i) }, i: 0 };
|
|
159
162
|
return { t: k, s: { data: codePoints(textOf(v)) }, i: 0 };
|
|
160
163
|
}
|
|
161
164
|
case K.Binary:
|