@magnusopera/fscript 0.80.1 → 0.81.1

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.
@@ -12,6 +12,7 @@ import { append, tryHead, tryFindIndex, tryFind as tryFind_1, filter, collect, c
12
12
  import { ExternalFunction, Value as Value_1, MapKey } from "./Value.js";
13
13
  import { compare as compare_1, op_Addition, toInt32_unchecked, fromInt32, toInt64_unchecked, equals } from "../fable_modules/fable-library-js.5.13.0/BigInt.js";
14
14
  import { ofSeq } from "../fable_modules/fable-library-js.5.13.0/Set.js";
15
+ import { $007CRecordFields$007C_$007C } from "./HostInterop.js";
15
16
  import { tryParse as tryParse_2 } from "../fable_modules/fable-library-js.5.13.0/Boolean.js";
16
17
  import { some } from "../fable_modules/fable-library-js.5.13.0/Option.js";
17
18
 
@@ -290,14 +291,28 @@ function valueEquals(a_mut, b_mut) {
290
291
  valueEquals:
291
292
  while (true) {
292
293
  const a = a_mut, b = b_mut;
293
- let matchResult, x, y, x_1, y_1, x_2, y_2, x_3, y_3, xs, ys, xs_1, ys_1, xf, yf, xf_1, yf_1, x_8, y_8, cx, cy, px, py, tx, ty, tx_1, ty_1;
294
+ let matchResult, x, y, x_1, y_1, x_2, y_2, x_3, y_3, xs, ys, xs_1, ys_1, xf, yf;
294
295
  switch (a.tag) {
295
296
  case 0: {
296
297
  if (b.tag === 0) {
297
298
  matchResult = 0;
298
299
  }
299
300
  else {
300
- matchResult = 13;
301
+ const activePatternResult = $007CRecordFields$007C_$007C(a);
302
+ if (activePatternResult != null) {
303
+ const activePatternResult_1 = $007CRecordFields$007C_$007C(b);
304
+ if (activePatternResult_1 != null) {
305
+ matchResult = 7;
306
+ xf = activePatternResult;
307
+ yf = activePatternResult_1;
308
+ }
309
+ else {
310
+ matchResult = 8;
311
+ }
312
+ }
313
+ else {
314
+ matchResult = 8;
315
+ }
301
316
  }
302
317
  break;
303
318
  }
@@ -308,7 +323,21 @@ function valueEquals(a_mut, b_mut) {
308
323
  y = b.fields[0];
309
324
  }
310
325
  else {
311
- matchResult = 13;
326
+ const activePatternResult_2 = $007CRecordFields$007C_$007C(a);
327
+ if (activePatternResult_2 != null) {
328
+ const activePatternResult_3 = $007CRecordFields$007C_$007C(b);
329
+ if (activePatternResult_3 != null) {
330
+ matchResult = 7;
331
+ xf = activePatternResult_2;
332
+ yf = activePatternResult_3;
333
+ }
334
+ else {
335
+ matchResult = 8;
336
+ }
337
+ }
338
+ else {
339
+ matchResult = 8;
340
+ }
312
341
  }
313
342
  break;
314
343
  }
@@ -319,7 +348,21 @@ function valueEquals(a_mut, b_mut) {
319
348
  y_1 = b.fields[0];
320
349
  }
321
350
  else {
322
- matchResult = 13;
351
+ const activePatternResult_4 = $007CRecordFields$007C_$007C(a);
352
+ if (activePatternResult_4 != null) {
353
+ const activePatternResult_5 = $007CRecordFields$007C_$007C(b);
354
+ if (activePatternResult_5 != null) {
355
+ matchResult = 7;
356
+ xf = activePatternResult_4;
357
+ yf = activePatternResult_5;
358
+ }
359
+ else {
360
+ matchResult = 8;
361
+ }
362
+ }
363
+ else {
364
+ matchResult = 8;
365
+ }
323
366
  }
324
367
  break;
325
368
  }
@@ -330,7 +373,21 @@ function valueEquals(a_mut, b_mut) {
330
373
  y_2 = b.fields[0];
331
374
  }
332
375
  else {
333
- matchResult = 13;
376
+ const activePatternResult_6 = $007CRecordFields$007C_$007C(a);
377
+ if (activePatternResult_6 != null) {
378
+ const activePatternResult_7 = $007CRecordFields$007C_$007C(b);
379
+ if (activePatternResult_7 != null) {
380
+ matchResult = 7;
381
+ xf = activePatternResult_6;
382
+ yf = activePatternResult_7;
383
+ }
384
+ else {
385
+ matchResult = 8;
386
+ }
387
+ }
388
+ else {
389
+ matchResult = 8;
390
+ }
334
391
  }
335
392
  break;
336
393
  }
@@ -341,7 +398,21 @@ function valueEquals(a_mut, b_mut) {
341
398
  y_3 = b.fields[0];
342
399
  }
343
400
  else {
344
- matchResult = 13;
401
+ const activePatternResult_8 = $007CRecordFields$007C_$007C(a);
402
+ if (activePatternResult_8 != null) {
403
+ const activePatternResult_9 = $007CRecordFields$007C_$007C(b);
404
+ if (activePatternResult_9 != null) {
405
+ matchResult = 7;
406
+ xf = activePatternResult_8;
407
+ yf = activePatternResult_9;
408
+ }
409
+ else {
410
+ matchResult = 8;
411
+ }
412
+ }
413
+ else {
414
+ matchResult = 8;
415
+ }
345
416
  }
346
417
  break;
347
418
  }
@@ -352,7 +423,21 @@ function valueEquals(a_mut, b_mut) {
352
423
  ys = b.fields[0];
353
424
  }
354
425
  else {
355
- matchResult = 13;
426
+ const activePatternResult_10 = $007CRecordFields$007C_$007C(a);
427
+ if (activePatternResult_10 != null) {
428
+ const activePatternResult_11 = $007CRecordFields$007C_$007C(b);
429
+ if (activePatternResult_11 != null) {
430
+ matchResult = 7;
431
+ xf = activePatternResult_10;
432
+ yf = activePatternResult_11;
433
+ }
434
+ else {
435
+ matchResult = 8;
436
+ }
437
+ }
438
+ else {
439
+ matchResult = 8;
440
+ }
356
441
  }
357
442
  break;
358
443
  }
@@ -363,89 +448,41 @@ function valueEquals(a_mut, b_mut) {
363
448
  ys_1 = b.fields[0];
364
449
  }
365
450
  else {
366
- matchResult = 13;
367
- }
368
- break;
369
- }
370
- case 7: {
371
- if (b.tag === 7) {
372
- matchResult = 7;
373
- xf = a.fields[0];
374
- yf = b.fields[0];
375
- }
376
- else {
377
- matchResult = 13;
378
- }
379
- break;
380
- }
381
- case 8: {
382
- if (b.tag === 8) {
383
- matchResult = 8;
384
- xf_1 = a.fields[0];
385
- yf_1 = b.fields[0];
386
- }
387
- else {
388
- matchResult = 13;
389
- }
390
- break;
391
- }
392
- case 9: {
393
- if (a.fields[0] != null) {
394
- if (b.tag === 9) {
395
- if (b.fields[0] != null) {
396
- matchResult = 10;
397
- x_8 = a.fields[0];
398
- y_8 = b.fields[0];
451
+ const activePatternResult_12 = $007CRecordFields$007C_$007C(a);
452
+ if (activePatternResult_12 != null) {
453
+ const activePatternResult_13 = $007CRecordFields$007C_$007C(b);
454
+ if (activePatternResult_13 != null) {
455
+ matchResult = 7;
456
+ xf = activePatternResult_12;
457
+ yf = activePatternResult_13;
399
458
  }
400
459
  else {
401
- matchResult = 13;
460
+ matchResult = 8;
402
461
  }
403
462
  }
404
463
  else {
405
- matchResult = 13;
464
+ matchResult = 8;
406
465
  }
407
466
  }
408
- else if (b.tag === 9) {
409
- if (b.fields[0] == null) {
410
- matchResult = 9;
467
+ break;
468
+ }
469
+ default: {
470
+ const activePatternResult_14 = $007CRecordFields$007C_$007C(a);
471
+ if (activePatternResult_14 != null) {
472
+ const activePatternResult_15 = $007CRecordFields$007C_$007C(b);
473
+ if (activePatternResult_15 != null) {
474
+ matchResult = 7;
475
+ xf = activePatternResult_14;
476
+ yf = activePatternResult_15;
411
477
  }
412
478
  else {
413
- matchResult = 13;
479
+ matchResult = 8;
414
480
  }
415
481
  }
416
482
  else {
417
- matchResult = 13;
418
- }
419
- break;
420
- }
421
- case 10: {
422
- if (b.tag === 10) {
423
- matchResult = 11;
424
- cx = a.fields[1];
425
- cy = b.fields[1];
426
- px = a.fields[2];
427
- py = b.fields[2];
428
- tx = a.fields[0];
429
- ty = b.fields[0];
430
- }
431
- else {
432
- matchResult = 13;
433
- }
434
- break;
435
- }
436
- case 12: {
437
- if (b.tag === 12) {
438
- matchResult = 12;
439
- tx_1 = a.fields[0];
440
- ty_1 = b.fields[0];
441
- }
442
- else {
443
- matchResult = 13;
483
+ matchResult = 8;
444
484
  }
445
- break;
446
485
  }
447
- default:
448
- matchResult = 13;
449
486
  }
450
487
  switch (matchResult) {
451
488
  case 0:
@@ -483,62 +520,137 @@ function valueEquals(a_mut, b_mut) {
483
520
  else {
484
521
  return false;
485
522
  }
486
- case 8:
487
- if ((FSharpMap__get_Count(xf_1) === FSharpMap__get_Count(yf_1)) && ofSeq(FSharpMap__get_Keys(xf_1), {
488
- Compare: (x_6, y_6) => (compare(x_6, y_6) | 0),
489
- }).Equals(ofSeq(FSharpMap__get_Keys(yf_1), {
490
- Compare: (x_7, y_7) => (compare(x_7, y_7) | 0),
491
- }))) {
492
- return forAll((k_1, xv_1) => valueEquals(xv_1, FSharpMap__get_Item(yf_1, k_1)), xf_1);
493
- }
494
- else {
495
- return false;
496
- }
497
- case 9:
498
- return true;
499
- case 10: {
500
- a_mut = x_8;
501
- b_mut = y_8;
502
- continue valueEquals;
503
- }
504
- case 11:
505
- if ((tx === ty) && (cx === cy)) {
506
- let matchResult_1, xv_2, yv;
507
- if (px != null) {
508
- if (py != null) {
509
- matchResult_1 = 1;
510
- xv_2 = px;
511
- yv = py;
523
+ default: {
524
+ let matchResult_1, xf_1, yf_1, x_8, y_8, cx, cy, px, py, tx, ty, tx_1, ty_1;
525
+ switch (a.tag) {
526
+ case 8: {
527
+ if (b.tag === 8) {
528
+ matchResult_1 = 0;
529
+ xf_1 = a.fields[0];
530
+ yf_1 = b.fields[0];
512
531
  }
513
532
  else {
514
- matchResult_1 = 2;
533
+ matchResult_1 = 5;
515
534
  }
535
+ break;
516
536
  }
517
- else if (py == null) {
518
- matchResult_1 = 0;
537
+ case 9: {
538
+ if (a.fields[0] != null) {
539
+ if (b.tag === 9) {
540
+ if (b.fields[0] != null) {
541
+ matchResult_1 = 2;
542
+ x_8 = a.fields[0];
543
+ y_8 = b.fields[0];
544
+ }
545
+ else {
546
+ matchResult_1 = 5;
547
+ }
548
+ }
549
+ else {
550
+ matchResult_1 = 5;
551
+ }
552
+ }
553
+ else if (b.tag === 9) {
554
+ if (b.fields[0] == null) {
555
+ matchResult_1 = 1;
556
+ }
557
+ else {
558
+ matchResult_1 = 5;
559
+ }
560
+ }
561
+ else {
562
+ matchResult_1 = 5;
563
+ }
564
+ break;
519
565
  }
520
- else {
521
- matchResult_1 = 2;
566
+ case 10: {
567
+ if (b.tag === 10) {
568
+ matchResult_1 = 3;
569
+ cx = a.fields[1];
570
+ cy = b.fields[1];
571
+ px = a.fields[2];
572
+ py = b.fields[2];
573
+ tx = a.fields[0];
574
+ ty = b.fields[0];
575
+ }
576
+ else {
577
+ matchResult_1 = 5;
578
+ }
579
+ break;
522
580
  }
523
- switch (matchResult_1) {
524
- case 0:
525
- return true;
526
- case 1: {
527
- a_mut = xv_2;
528
- b_mut = yv;
529
- continue valueEquals;
581
+ case 12: {
582
+ if (b.tag === 12) {
583
+ matchResult_1 = 4;
584
+ tx_1 = a.fields[0];
585
+ ty_1 = b.fields[0];
530
586
  }
531
- default:
532
- return false;
587
+ else {
588
+ matchResult_1 = 5;
589
+ }
590
+ break;
533
591
  }
592
+ default:
593
+ matchResult_1 = 5;
534
594
  }
535
- else {
536
- return false;
595
+ switch (matchResult_1) {
596
+ case 0:
597
+ if ((FSharpMap__get_Count(xf_1) === FSharpMap__get_Count(yf_1)) && ofSeq(FSharpMap__get_Keys(xf_1), {
598
+ Compare: (x_6, y_6) => (compare(x_6, y_6) | 0),
599
+ }).Equals(ofSeq(FSharpMap__get_Keys(yf_1), {
600
+ Compare: (x_7, y_7) => (compare(x_7, y_7) | 0),
601
+ }))) {
602
+ return forAll((k_1, xv_1) => valueEquals(xv_1, FSharpMap__get_Item(yf_1, k_1)), xf_1);
603
+ }
604
+ else {
605
+ return false;
606
+ }
607
+ case 1:
608
+ return true;
609
+ case 2: {
610
+ a_mut = x_8;
611
+ b_mut = y_8;
612
+ continue valueEquals;
613
+ }
614
+ case 3:
615
+ if ((tx === ty) && (cx === cy)) {
616
+ let matchResult_2, xv_2, yv;
617
+ if (px != null) {
618
+ if (py != null) {
619
+ matchResult_2 = 1;
620
+ xv_2 = px;
621
+ yv = py;
622
+ }
623
+ else {
624
+ matchResult_2 = 2;
625
+ }
626
+ }
627
+ else if (py == null) {
628
+ matchResult_2 = 0;
629
+ }
630
+ else {
631
+ matchResult_2 = 2;
632
+ }
633
+ switch (matchResult_2) {
634
+ case 0:
635
+ return true;
636
+ case 1: {
637
+ a_mut = xv_2;
638
+ b_mut = yv;
639
+ continue valueEquals;
640
+ }
641
+ default:
642
+ return false;
643
+ }
644
+ }
645
+ else {
646
+ return false;
647
+ }
648
+ case 4:
649
+ return equals_1(tx_1, ty_1);
650
+ default:
651
+ return false;
537
652
  }
538
- case 12:
539
- return equals_1(tx_1, ty_1);
540
- default:
541
- return false;
653
+ }
542
654
  }
543
655
  break;
544
656
  }