@cplieger/deadset-ts 8.0.0-dev.12 → 8.0.0-dev.13
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 +2 -0
- package/THIRD_PARTY_NOTICES.md +27 -0
- package/dist/src/build-scripts.js +6 -13
- package/dist/src/commands/read.js +156 -0
- package/dist/src/commands/shell.js +75 -0
- package/dist/src/commands/tools.js +460 -0
- package/dist/src/configuration-files.js +11 -25
- package/dist/src/conformance-record.js +1 -1
- package/dist/src/dependencies.js +67 -115
- package/dist/src/load/synthesize.js +12 -5
- package/dist/src/manifest.js +27 -14
- package/dist/src/roots.js +18 -11
- package/dist/src/text/named-files.js +24 -3
- package/dist/src/text/yaml.js +464 -173
- package/dist/src/vendor/unbash/ansi-c.js +132 -0
- package/dist/src/vendor/unbash/arithmetic-parts.js +37 -0
- package/dist/src/vendor/unbash/arithmetic.js +591 -0
- package/dist/src/vendor/unbash/assignment.js +131 -0
- package/dist/src/vendor/unbash/chars.js +48 -0
- package/dist/src/vendor/unbash/command.js +41 -0
- package/dist/src/vendor/unbash/expansion.js +80 -0
- package/dist/src/vendor/unbash/glob.js +268 -0
- package/dist/src/vendor/unbash/heredoc.js +27 -0
- package/dist/src/vendor/unbash/internal-types.js +1 -0
- package/dist/src/vendor/unbash/lexer.js +4274 -0
- package/dist/src/vendor/unbash/limits.js +3 -0
- package/dist/src/vendor/unbash/parser.js +1366 -0
- package/dist/src/vendor/unbash/parts.js +57 -0
- package/dist/src/vendor/unbash/substitution-context.js +8 -0
- package/dist/src/vendor/unbash/traversal.js +212 -0
- package/dist/src/vendor/unbash/types.js +1 -0
- package/dist/src/vendor/unbash/word-value.js +61 -0
- package/dist/src/vendor/unbash/word.js +40 -0
- package/dist/src/workflow-steps.js +111 -133
- package/jsr.json +2 -1
- package/package.json +4 -2
- package/src/build-scripts.ts +6 -13
- package/src/commands/read.ts +230 -0
- package/src/commands/shell.ts +126 -0
- package/src/commands/tools.ts +618 -0
- package/src/configuration-files.ts +10 -26
- package/src/conformance-record.ts +1 -1
- package/src/dependencies.ts +99 -123
- package/src/load/synthesize.ts +18 -5
- package/src/manifest.ts +43 -25
- package/src/roots.ts +20 -13
- package/src/text/named-files.ts +26 -3
- package/src/text/yaml.ts +503 -179
- package/src/vendor/unbash/LICENSE +15 -0
- package/src/vendor/unbash/VENDORED.md +16 -0
- package/src/vendor/unbash/ansi-c.ts +132 -0
- package/src/vendor/unbash/arithmetic-parts.ts +53 -0
- package/src/vendor/unbash/arithmetic.ts +641 -0
- package/src/vendor/unbash/assignment.ts +163 -0
- package/src/vendor/unbash/chars.ts +48 -0
- package/src/vendor/unbash/command.ts +47 -0
- package/src/vendor/unbash/expansion.ts +144 -0
- package/src/vendor/unbash/glob.ts +284 -0
- package/src/vendor/unbash/heredoc.ts +34 -0
- package/src/vendor/unbash/internal-types.ts +94 -0
- package/src/vendor/unbash/lexer.ts +4352 -0
- package/src/vendor/unbash/limits.ts +3 -0
- package/src/vendor/unbash/parser.ts +1612 -0
- package/src/vendor/unbash/parts.ts +96 -0
- package/src/vendor/unbash/substitution-context.ts +20 -0
- package/src/vendor/unbash/traversal.ts +182 -0
- package/src/vendor/unbash/types.ts +660 -0
- package/src/vendor/unbash/word-value.ts +64 -0
- package/src/vendor/unbash/word.ts +50 -0
- package/src/workflow-steps.ts +153 -154
- package/dist/src/text/shell.js +0 -159
- package/src/text/named-files.inputs.json +0 -1522
- package/src/text/shell.ts +0 -161
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// Code generated by scripts/vendor-unbash.ts from unbash 6.0.0 (968c14992a43dc06ce29c9f51858abd4a87851ea). DO NOT EDIT.
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
function isOctal(code) {
|
|
4
|
+
return code >= 48 && code <= 55;
|
|
5
|
+
}
|
|
6
|
+
function isHex(code) {
|
|
7
|
+
return (code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102);
|
|
8
|
+
}
|
|
9
|
+
function codePoint(value, fallback) {
|
|
10
|
+
try {
|
|
11
|
+
return String.fromCodePoint(value);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return fallback;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function decodeAnsiCQuoted(source, start, limit) {
|
|
18
|
+
let pos = start;
|
|
19
|
+
let value = "";
|
|
20
|
+
while (pos < limit && source.charCodeAt(pos) !== 39) {
|
|
21
|
+
if (source.charCodeAt(pos) !== 92 || pos + 1 >= limit) {
|
|
22
|
+
const runStart = pos;
|
|
23
|
+
while (pos < limit) {
|
|
24
|
+
const code = source.charCodeAt(pos);
|
|
25
|
+
// A backslash at the end of input has nothing to escape; consume it as a
|
|
26
|
+
// literal so the loop always advances.
|
|
27
|
+
if (code === 39 || (code === 92 && pos + 1 < limit))
|
|
28
|
+
break;
|
|
29
|
+
pos++;
|
|
30
|
+
}
|
|
31
|
+
value += source.slice(runStart, pos);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const escapeStart = pos++;
|
|
35
|
+
const escaped = source[pos++];
|
|
36
|
+
switch (escaped) {
|
|
37
|
+
case "a":
|
|
38
|
+
value += "\x07";
|
|
39
|
+
break;
|
|
40
|
+
case "b":
|
|
41
|
+
value += "\b";
|
|
42
|
+
break;
|
|
43
|
+
case "e":
|
|
44
|
+
case "E":
|
|
45
|
+
value += "\x1B";
|
|
46
|
+
break;
|
|
47
|
+
case "f":
|
|
48
|
+
value += "\f";
|
|
49
|
+
break;
|
|
50
|
+
case "n":
|
|
51
|
+
value += "\n";
|
|
52
|
+
break;
|
|
53
|
+
case "r":
|
|
54
|
+
value += "\r";
|
|
55
|
+
break;
|
|
56
|
+
case "t":
|
|
57
|
+
value += "\t";
|
|
58
|
+
break;
|
|
59
|
+
case "v":
|
|
60
|
+
value += "\v";
|
|
61
|
+
break;
|
|
62
|
+
case "\\":
|
|
63
|
+
value += "\\";
|
|
64
|
+
break;
|
|
65
|
+
case "'":
|
|
66
|
+
value += "'";
|
|
67
|
+
break;
|
|
68
|
+
case '"':
|
|
69
|
+
value += '"';
|
|
70
|
+
break;
|
|
71
|
+
case "?":
|
|
72
|
+
value += "?";
|
|
73
|
+
break;
|
|
74
|
+
case "\n":
|
|
75
|
+
break;
|
|
76
|
+
case "c": {
|
|
77
|
+
// The closing quote (or end of input) is not an operand: \c stays literal.
|
|
78
|
+
const code = pos < limit ? source.charCodeAt(pos) : 39;
|
|
79
|
+
if (code === 39) {
|
|
80
|
+
value += source.slice(escapeStart, pos);
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
pos++;
|
|
84
|
+
if (code === 92) {
|
|
85
|
+
// Bash writes a backslash operand as the pair \c\\; a lone backslash
|
|
86
|
+
// still decodes and leaves the character it escaped as a literal.
|
|
87
|
+
const pair = pos < limit && source.charCodeAt(pos) === 92;
|
|
88
|
+
if (pair)
|
|
89
|
+
pos++;
|
|
90
|
+
value += "\x1c";
|
|
91
|
+
if (!pair && pos < limit) {
|
|
92
|
+
value += source[pos];
|
|
93
|
+
pos++;
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
value += String.fromCharCode(code === 63 ? 127 : code & 31);
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
case "x":
|
|
101
|
+
case "u":
|
|
102
|
+
case "U": {
|
|
103
|
+
const digitsStart = pos;
|
|
104
|
+
const maxDigits = escaped === "x" ? 2 : escaped === "u" ? 4 : 8;
|
|
105
|
+
while (pos < limit && pos - digitsStart < maxDigits && isHex(source.charCodeAt(pos)))
|
|
106
|
+
pos++;
|
|
107
|
+
if (pos === digitsStart) {
|
|
108
|
+
value += `\\${escaped}`;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
const raw = source.slice(escapeStart, pos);
|
|
112
|
+
value += codePoint(Number.parseInt(source.slice(digitsStart, pos), 16), raw);
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
default: {
|
|
116
|
+
const escapedCode = escaped.charCodeAt(0);
|
|
117
|
+
if (!isOctal(escapedCode)) {
|
|
118
|
+
value += `\\${escaped}`;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
while (pos < limit && pos - escapeStart - 1 < 3 && isOctal(source.charCodeAt(pos)))
|
|
122
|
+
pos++;
|
|
123
|
+
value += String.fromCharCode(Number.parseInt(source.slice(escapeStart + 1, pos), 8) & 0xff);
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const closed = pos < limit;
|
|
129
|
+
if (closed)
|
|
130
|
+
pos++;
|
|
131
|
+
return { value, end: pos, closed };
|
|
132
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Code generated by scripts/vendor-unbash.ts from unbash 6.0.0 (968c14992a43dc06ce29c9f51858abd4a87851ea). DO NOT EDIT.
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { parseArithmeticExpression } from "./arithmetic.js";
|
|
4
|
+
import { hasEmbeddedWordStructure, Lexer } from "./lexer.js";
|
|
5
|
+
import { computeEmbeddedWordParts } from "./parts.js";
|
|
6
|
+
import { ScriptExpansionImpl } from "./expansion.js";
|
|
7
|
+
import { MAX_SYNTAX_NESTING } from "./limits.js";
|
|
8
|
+
export function parseArithmeticWithParts(body, offset, source, depth, context, embeddedDepth = depth) {
|
|
9
|
+
if (!hasEmbeddedWordStructure(source, offset, offset + body.length)) {
|
|
10
|
+
return parseArithmeticExpression(body, offset, undefined, depth) ?? undefined;
|
|
11
|
+
}
|
|
12
|
+
const embeddedWords = [];
|
|
13
|
+
const lexer = new Lexer(source, 0, source.length, false, context);
|
|
14
|
+
lexer._nestingDepth = depth;
|
|
15
|
+
const expression = parseArithmeticExpression(body, offset, {
|
|
16
|
+
embeddedWords,
|
|
17
|
+
commandExpansion: (pos, end, text) => new ScriptExpansionImpl("ArithmeticCommandExpansion", pos, end, text, {
|
|
18
|
+
source,
|
|
19
|
+
start: pos + 2,
|
|
20
|
+
end: end - 1,
|
|
21
|
+
depth: depth + 1,
|
|
22
|
+
parenBoundary: true,
|
|
23
|
+
context,
|
|
24
|
+
}),
|
|
25
|
+
findClosingBracket: (start, end) => lexer.findClosingBracket(start, end),
|
|
26
|
+
findClosingBrace: (start, end) => lexer.findClosingBrace(start, end),
|
|
27
|
+
findClosingParenthesis: (start, end) => lexer.findClosingParenthesis(start, end),
|
|
28
|
+
findArithmeticExpansionEnd: (start, end) => lexer.findArithmeticExpansionEnd(start, end),
|
|
29
|
+
findArithmeticWordEnd: (start, end) => lexer.findArithmeticWordEnd(start, end),
|
|
30
|
+
}, depth) ?? undefined;
|
|
31
|
+
// Past the nesting budget an embedded word keeps its text without parts.
|
|
32
|
+
if (embeddedDepth <= MAX_SYNTAX_NESTING) {
|
|
33
|
+
for (const node of embeddedWords)
|
|
34
|
+
node.parts = computeEmbeddedWordParts(source, node, embeddedDepth, context, true);
|
|
35
|
+
}
|
|
36
|
+
return expression;
|
|
37
|
+
}
|