@hominis/fireforge 0.46.1 → 0.46.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/dist/build-info.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "0.46.
|
|
4
|
-
"commit": "
|
|
5
|
-
"shortCommit": "
|
|
3
|
+
"version": "0.46.2",
|
|
4
|
+
"commit": "533adc217a82c2a17735e8b38e25d8f41f8bfad8",
|
|
5
|
+
"shortCommit": "533adc217a82",
|
|
6
6
|
"dirty": false,
|
|
7
7
|
"dirtyHash": null,
|
|
8
|
-
"buildTime": "2026-09-
|
|
8
|
+
"buildTime": "2026-09-05T23:00:12.026Z"
|
|
9
9
|
}
|
|
@@ -22,6 +22,14 @@
|
|
|
22
22
|
* any downstream consumer that indexes by column (or derives an
|
|
23
23
|
* insertion index as a line number in the original array) still
|
|
24
24
|
* agrees on line numbers.
|
|
25
|
+
*
|
|
26
|
+
* Spans are copied with `indexOf` + `slice` rather than appended one
|
|
27
|
+
* character at a time. The per-character form allocated a rope link per
|
|
28
|
+
* character of every line in `tokens.css`, which on a long line cost far
|
|
29
|
+
* more than the scan it feeds: blanking a 1.6 MB line took ~39 ms against
|
|
30
|
+
* ~0.07 ms here, and the GC that pressure provoked grew faster than the
|
|
31
|
+
* input did — enough to make the scanners' linearity test read as
|
|
32
|
+
* super-linear on a loaded runner.
|
|
25
33
|
*/
|
|
26
34
|
export declare function stripBlockCommentsInLines(lines: string[]): string[];
|
|
27
35
|
/**
|
|
@@ -41,33 +41,46 @@ function rootOpensBraceOnLine(line) {
|
|
|
41
41
|
* any downstream consumer that indexes by column (or derives an
|
|
42
42
|
* insertion index as a line number in the original array) still
|
|
43
43
|
* agrees on line numbers.
|
|
44
|
+
*
|
|
45
|
+
* Spans are copied with `indexOf` + `slice` rather than appended one
|
|
46
|
+
* character at a time. The per-character form allocated a rope link per
|
|
47
|
+
* character of every line in `tokens.css`, which on a long line cost far
|
|
48
|
+
* more than the scan it feeds: blanking a 1.6 MB line took ~39 ms against
|
|
49
|
+
* ~0.07 ms here, and the GC that pressure provoked grew faster than the
|
|
50
|
+
* input did — enough to make the scanners' linearity test read as
|
|
51
|
+
* super-linear on a loaded runner.
|
|
44
52
|
*/
|
|
45
53
|
export function stripBlockCommentsInLines(lines) {
|
|
46
54
|
const out = [];
|
|
47
55
|
let inBlockComment = false;
|
|
48
56
|
for (const original of lines) {
|
|
57
|
+
// A line with no comment to enter or leave is already its own mirror.
|
|
58
|
+
if (!inBlockComment && !original.includes('/*')) {
|
|
59
|
+
out.push(original);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
49
62
|
let line = '';
|
|
50
|
-
|
|
63
|
+
let i = 0;
|
|
64
|
+
while (i < original.length) {
|
|
51
65
|
if (inBlockComment) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
line += ' ';
|
|
66
|
+
const end = original.indexOf('*/', i);
|
|
67
|
+
if (end === -1) {
|
|
68
|
+
line += ' '.repeat(original.length - i);
|
|
69
|
+
break;
|
|
59
70
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
i += 1;
|
|
64
|
-
inBlockComment = true;
|
|
71
|
+
line += ' '.repeat(end + 2 - i);
|
|
72
|
+
i = end + 2;
|
|
73
|
+
inBlockComment = false;
|
|
65
74
|
}
|
|
66
75
|
else {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
const start = original.indexOf('/*', i);
|
|
77
|
+
if (start === -1) {
|
|
78
|
+
line += original.slice(i);
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
line += `${original.slice(i, start)} `;
|
|
82
|
+
i = start + 2;
|
|
83
|
+
inBlockComment = true;
|
|
71
84
|
}
|
|
72
85
|
}
|
|
73
86
|
out.push(line);
|