@mnemonik/shared 7.144.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mnemonik/shared",
3
- "version": "7.144.1",
3
+ "version": "7.144.2",
4
4
  "description": "Shared constants and utilities for Mnemonik packages",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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
- writeFileSync(grammarPath, grammar.replace(before, ' token.immediate("??")'));
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