@mnemonik/shared 7.144.0 → 7.144.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/package.json +1 -1
- package/scripts/vendor-grammars.ts +17 -1
- package/wasm/swift.wasm +0 -0
package/package.json
CHANGED
|
@@ -433,7 +433,23 @@ function rebuildSwift(dir: string, work: string): void {
|
|
|
433
433
|
const grammar = readFileSync(grammarPath, 'utf8');
|
|
434
434
|
const before = ' alias($._nil_coalescing_operator, "??")';
|
|
435
435
|
if (!grammar.includes(before)) throw new Error('Swift optional-marker patch no longer applies');
|
|
436
|
-
|
|
436
|
+
// Keep a conditional's braces outside nested `try await`, just as for direct calls.
|
|
437
|
+
const awaited =
|
|
438
|
+
' prec.left(0, $.call_expression),\n // Similarly special case';
|
|
439
|
+
if (!grammar.includes(awaited)) throw new Error('Swift try-await patch no longer applies');
|
|
440
|
+
const conflict = ' [$.try_expression, $._expression],';
|
|
441
|
+
if (!grammar.includes(conflict))
|
|
442
|
+
throw new Error('Swift try-await conflict patch no longer applies');
|
|
443
|
+
writeFileSync(
|
|
444
|
+
grammarPath,
|
|
445
|
+
grammar
|
|
446
|
+
.replace(before, ' token.immediate("??")')
|
|
447
|
+
.replace(
|
|
448
|
+
awaited,
|
|
449
|
+
' prec.left(0, $.call_expression),\n prec.left(0, $.await_expression),\n // Similarly special case'
|
|
450
|
+
)
|
|
451
|
+
.replace(conflict, conflict + '\n [$.try_expression, $._primary_expression],')
|
|
452
|
+
);
|
|
437
453
|
const scannerPath = join(dir, 'src', 'scanner.c');
|
|
438
454
|
const scanner = readFileSync(scannerPath, 'utf8');
|
|
439
455
|
const continuation =
|
package/wasm/swift.wasm
CHANGED
|
Binary file
|