@magnusopera/fscript 0.86.1 → 0.86.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.
Files changed (97) hide show
  1. package/dist/FScript.Language/Ast.js +2 -2
  2. package/dist/FScript.Language/BuiltinFunctions.js +31 -19
  3. package/dist/FScript.Language/BuiltinSignatures.js +6 -6
  4. package/dist/FScript.Language/BuiltinTypes.js +1 -1
  5. package/dist/FScript.Language/Error.js +2 -2
  6. package/dist/FScript.Language/Eval.js +11 -11
  7. package/dist/FScript.Language/Execution.js +6 -6
  8. package/dist/FScript.Language/ExportSignatures.js +5 -5
  9. package/dist/FScript.Language/HostInterop.js +8 -8
  10. package/dist/FScript.Language/IncludeResolver.js +10 -10
  11. package/dist/FScript.Language/Interactive.js +7 -7
  12. package/dist/FScript.Language/Lexer.js +9 -9
  13. package/dist/FScript.Language/Parser.js +10 -10
  14. package/dist/FScript.Language/Pretty.js +4 -4
  15. package/dist/FScript.Language/Span.js +2 -2
  16. package/dist/FScript.Language/TaskFunctions.js +2 -2
  17. package/dist/FScript.Language/TaskSharingAnalysis.js +17 -17
  18. package/dist/FScript.Language/Token.js +2 -2
  19. package/dist/FScript.Language/TypeInfer.js +12 -12
  20. package/dist/FScript.Language/Types.js +8 -8
  21. package/dist/FScript.Language/Value.js +2 -2
  22. package/dist/Library.js +13 -13
  23. package/dist/fable_modules/fable-library-js.5.24.0/Async.js +363 -0
  24. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/AsyncBuilder.js +70 -10
  25. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/CHANGELOG.md +90 -1
  26. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/CollectionUtil.js +10 -16
  27. package/dist/fable_modules/fable-library-js.5.24.0/DateOnlyTemporal.js +146 -0
  28. package/dist/fable_modules/fable-library-js.5.24.0/DateTimeFormat.js +523 -0
  29. package/dist/fable_modules/fable-library-js.5.24.0/DateTimeOffsetTemporal.js +283 -0
  30. package/dist/fable_modules/fable-library-js.5.24.0/DateTimeTemporal.js +243 -0
  31. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Decimal.js +100 -11
  32. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Encoding.js +23 -16
  33. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Guid.js +3 -1
  34. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/MailboxProcessor.js +23 -3
  35. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/MutableMap.js +5 -1
  36. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/MutableSet.js +5 -1
  37. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Numeric.js +38 -1
  38. package/dist/fable_modules/fable-library-js.5.24.0/Stopwatch.js +65 -0
  39. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/String.js +43 -9
  40. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/System.Text.js +9 -9
  41. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Task.js +22 -0
  42. package/dist/fable_modules/fable-library-js.5.24.0/TimeOnlyTemporal.js +142 -0
  43. package/dist/fable_modules/fable-library-js.5.24.0/TimeSpanTemporal.js +259 -0
  44. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Util.js +15 -3
  45. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/big.d.ts +1 -0
  46. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/lib/big.js +111 -64
  47. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/package.json +1 -1
  48. package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/quotation.js +47 -0
  49. package/dist/fable_modules/project_cracked.json +1 -1
  50. package/package.json +1 -1
  51. package/dist/fable_modules/fable-library-js.5.13.0/Async.js +0 -163
  52. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Array.js +0 -0
  53. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/BigInt.js +0 -0
  54. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/BitConverter.js +0 -0
  55. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Boolean.js +0 -0
  56. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Char.js +0 -0
  57. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Choice.js +0 -0
  58. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/ConditionalWeakTable.js +0 -0
  59. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Date.js +0 -0
  60. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/DateOffset.js +0 -0
  61. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/DateOnly.js +0 -0
  62. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Directory.js +0 -0
  63. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Double.js +0 -0
  64. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Environment.js +0 -0
  65. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Event.js +0 -0
  66. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/FSharp.Collections.js +0 -0
  67. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/FSharp.Core.CompilerServices.js +0 -0
  68. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/FSharp.Core.js +0 -0
  69. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/File.js +0 -0
  70. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Global.js +0 -0
  71. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Int32.js +0 -0
  72. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/List.js +0 -0
  73. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Long.js +0 -0
  74. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Map.js +0 -0
  75. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/MapUtil.js +0 -0
  76. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Native.js +0 -0
  77. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Observable.js +0 -0
  78. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Option.js +0 -0
  79. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Path.js +0 -0
  80. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/README.md +0 -0
  81. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Random.js +0 -0
  82. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Range.js +0 -0
  83. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Reflection.js +0 -0
  84. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/RegExp.js +0 -0
  85. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Result.js +0 -0
  86. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Seq.js +0 -0
  87. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Seq2.js +0 -0
  88. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Set.js +0 -0
  89. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/System.Collections.Generic.js +0 -0
  90. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/System.js +0 -0
  91. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/TaskBuilder.js +0 -0
  92. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/TimeOnly.js +0 -0
  93. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/TimeSpan.js +0 -0
  94. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Timer.js +0 -0
  95. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Types.js +0 -0
  96. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Unicode.13.0.0.js +0 -0
  97. /package/dist/fable_modules/{fable-library-js.5.13.0 → fable-library-js.5.24.0}/Uri.js +0 -0
@@ -633,3 +633,50 @@ export function exprFromJSON(json) {
633
633
  default: return new ExprValue(json, "unknown");
634
634
  }
635
635
  }
636
+ // ===================================================================
637
+ // DerivedPatterns
638
+ // F# defines these on top of Patterns. AndAlso and OrElse recover the
639
+ // shape `&&` and `||` desugar into; SpecificCall matches a call by the
640
+ // identity of a template quotation rather than by compiled name.
641
+ // ===================================================================
642
+ export function isAndAlso(expr) {
643
+ // a && b ==> if a then b else false
644
+ if (expr instanceof ExprIfThenElse
645
+ && expr.elseExpr instanceof ExprValue
646
+ && expr.elseExpr.value === false) {
647
+ return [expr.guard, expr.thenExpr];
648
+ }
649
+ return undefined;
650
+ }
651
+ export function isOrElse(expr) {
652
+ // a || b ==> if a then true else b
653
+ if (expr instanceof ExprIfThenElse
654
+ && expr.thenExpr instanceof ExprValue
655
+ && expr.thenExpr.value === true) {
656
+ return [expr.guard, expr.elseExpr];
657
+ }
658
+ return undefined;
659
+ }
660
+ /// A template such as <@ (=) @> quotes as nested lambdas around the call, so
661
+ /// the identifying Call node has to be dug out before comparing.
662
+ function templateCall(expr) {
663
+ let current = expr;
664
+ while (current instanceof ExprLambda) {
665
+ current = current.body;
666
+ }
667
+ return current instanceof ExprCall ? current : undefined;
668
+ }
669
+ // Takes both arguments; the partial application FSharp.Core expresses by
670
+ // currying is built by the replacement instead.
671
+ export function isSpecificCall(template, expr) {
672
+ const wanted = templateCall(template);
673
+ if (wanted === undefined || !(expr instanceof ExprCall))
674
+ return undefined;
675
+ if (expr.method !== wanted.method || expr.declaringType !== wanted.declaringType)
676
+ return undefined;
677
+ const instance = (expr.instance instanceof ExprValue && expr.instance.type === "novalue") ? null : expr.instance;
678
+ // The middle slot is F#'s generic-argument list. The runtime models types as
679
+ // names rather than System.Type, so it is always empty here; callers written
680
+ // against Fable match it with a wildcard.
681
+ return [instance, ofArray([]), ofArray(expr.args)];
682
+ }
@@ -1 +1 @@
1
- {"Version":"5.13.0","FableOptions":{"TypedArrays":true,"ClampByteArrays":false,"Language":["JavaScript"],"Define":["FABLE_COMPILER","FABLE_COMPILER_5","FABLE_COMPILER_JAVASCRIPT"],"DebugMode":false,"OptimizeFSharpAst":false,"Verbosity":["Normal"],"FileExtension":".js","TriggeredByDependency":false,"NoReflection":false},"ProjectPath":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/FScript.JavaScript.fsproj","SourcePaths":["/home/runner/work/FScript/FScript/src/FScript.Language/Span.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Error.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Token.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Ast.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Types.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Value.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Lexer.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Parser.fs","/home/runner/work/FScript/FScript/src/FScript.Language/IncludeResolver.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinTypes.fs","/home/runner/work/FScript/FScript/src/FScript.Language/HostInterop.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinSignatures.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Execution.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinFunctions.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TypeInfer.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TaskSharingAnalysis.fs","/home/runner/work/FScript/FScript/src/FScript.Language/ExportSignatures.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TaskFunctions.fs","/home/runner/work/FScript/FScript/src/FScript.Language/DebugHooks.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Eval.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Interactive.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Pretty.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Library.fs","/home/runner/work/FScript/FScript/src/FScript.JavaScript/Library.fs"],"FSharpOptions":["--define:FABLE_COMPILER","--define:FABLE_COMPILER_5","--define:FABLE_COMPILER_JAVASCRIPT","--define:TRACE","--define:RELEASE","--define:NETSTANDARD","--define:NETSTANDARD2_1","--define:NETSTANDARD1_0_OR_GREATER","--define:NETSTANDARD1_1_OR_GREATER","--define:NETSTANDARD1_2_OR_GREATER","--define:NETSTANDARD1_3_OR_GREATER","--define:NETSTANDARD1_4_OR_GREATER","--define:NETSTANDARD1_5_OR_GREATER","--define:NETSTANDARD1_6_OR_GREATER","--define:NETSTANDARD2_0_OR_GREATER","--define:NETSTANDARD2_1_OR_GREATER","--define:NULLABLE","--langversion:preview","--nowarn:FS0988","--noframework","--nologo","--simpleresolution","--nocopyfsharpcore","--nowin32manifest","--warn:3","--fullpaths","--flaterrors","--optimize-","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ValueTuple.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.Thread.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.Tasks.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.RegularExpressions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.Encoding.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.Encoding.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.Numerics.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.InteropServices.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.Primitives.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Numerics.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Net.Requests.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.IO.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Globalization.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Tracing.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Tools.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Debug.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Core.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Console.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.TypeConverter.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.Primitives.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Collections.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Collections.Concurrent.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/netstandard.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/mscorlib.dll","-r:/home/runner/.nuget/packages/fable.core/5.3.0/lib/netstandard2.0/Fable.Core.dll","-r:/home/runner/.nuget/packages/fable/5.13.0/tools/net10.0/any/FSharp.Core.dll"],"References":["/home/runner/work/FScript/FScript/src/FScript.Language/FScript.Language.fsproj"],"OutDir":["Some","/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist"],"FableLibDir":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist/fable_modules/fable-library-js.5.13.0","FableModulesDir":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist/fable_modules","OutputType":["Library"],"TargetFramework":["Some","netstandard2.1"],"Exclude":[],"SourceMaps":false,"SourceMapsRoot":null,"TreatWarningsAsErrors":true}
1
+ {"Version":"5.24.0","FableOptions":{"TypedArrays":true,"ClampByteArrays":false,"Language":["JavaScript"],"Define":["FABLE_COMPILER","FABLE_COMPILER_5","FABLE_COMPILER_JAVASCRIPT"],"DebugMode":false,"OptimizeFSharpAst":false,"Verbosity":["Normal"],"FileExtension":".js","TriggeredByDependency":false,"NoReflection":false,"JsTemporal":false},"ProjectPath":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/FScript.JavaScript.fsproj","SourcePaths":["/home/runner/work/FScript/FScript/src/FScript.Language/Span.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Error.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Token.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Ast.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Types.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Value.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Lexer.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Parser.fs","/home/runner/work/FScript/FScript/src/FScript.Language/IncludeResolver.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinTypes.fs","/home/runner/work/FScript/FScript/src/FScript.Language/HostInterop.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinSignatures.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Execution.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinFunctions.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TypeInfer.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TaskSharingAnalysis.fs","/home/runner/work/FScript/FScript/src/FScript.Language/ExportSignatures.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TaskFunctions.fs","/home/runner/work/FScript/FScript/src/FScript.Language/DebugHooks.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Eval.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Interactive.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Pretty.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Library.fs","/home/runner/work/FScript/FScript/src/FScript.JavaScript/Library.fs"],"FSharpOptions":["--define:FABLE_COMPILER","--define:FABLE_COMPILER_5","--define:FABLE_COMPILER_JAVASCRIPT","--define:TRACE","--define:RELEASE","--define:NETSTANDARD","--define:NETSTANDARD2_1","--define:NETSTANDARD1_0_OR_GREATER","--define:NETSTANDARD1_1_OR_GREATER","--define:NETSTANDARD1_2_OR_GREATER","--define:NETSTANDARD1_3_OR_GREATER","--define:NETSTANDARD1_4_OR_GREATER","--define:NETSTANDARD1_5_OR_GREATER","--define:NETSTANDARD1_6_OR_GREATER","--define:NETSTANDARD2_0_OR_GREATER","--define:NETSTANDARD2_1_OR_GREATER","--define:NULLABLE","--langversion:preview","--nowarn:FS0988","--targetprofile:netstandard","--noframework","--nologo","--simpleresolution","--nocopyfsharpcore","--nowin32manifest","--warn:3","--fullpaths","--flaterrors","--optimize-","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ValueTuple.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.Thread.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.Tasks.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.RegularExpressions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.Encoding.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.Encoding.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.Numerics.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.InteropServices.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.Primitives.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Numerics.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Net.Requests.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.IO.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Globalization.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Tracing.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Tools.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Debug.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Core.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Console.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.TypeConverter.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.Primitives.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Collections.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Collections.Concurrent.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/netstandard.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/mscorlib.dll","-r:/home/runner/.nuget/packages/fsharp.core/10.1.401/lib/netstandard2.1/FSharp.Core.dll","-r:/home/runner/.nuget/packages/fable.core/5.6.0/lib/netstandard2.0/Fable.Core.dll"],"References":["/home/runner/work/FScript/FScript/src/FScript.Language/FScript.Language.fsproj"],"OutDir":["Some","/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist"],"FableLib":null,"FableLibDir":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist/fable_modules/fable-library-js.5.24.0","FableModulesDir":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist/fable_modules","OutputType":["Library"],"TargetFramework":["Some","netstandard2.1"],"Configuration":"Release","Exclude":[],"Replace":{},"SourceMaps":false,"SourceMapsRoot":null,"TreatWarningsAsErrors":true}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magnusopera/fscript",
3
- "version": "0.86.1",
3
+ "version": "0.86.2",
4
4
  "description": "Embeddable FScript language engine: parser, type inference, and evaluator.",
5
5
  "type": "module",
6
6
  "main": "./dist/Library.js",
@@ -1,163 +0,0 @@
1
- import { OperationCanceledException, Trampoline } from "./AsyncBuilder.js";
2
- import { CancellationToken } from "./AsyncBuilder.js";
3
- import { protectedCont, protectedBind, protectedReturn } from "./AsyncBuilder.js";
4
- import { Choice_makeChoice1Of2, Choice_makeChoice2Of2 } from "./Choice.js";
5
- import { TimeoutException_$ctor } from "./System.js";
6
- import { Exception } from "./Util.js";
7
- function emptyContinuation(_x) {
8
- // NOP
9
- }
10
- // MakeAsync: body:(AsyncActivation<'T> -> AsyncReturn) -> Async<'T>
11
- export function makeAsync(body) {
12
- return body;
13
- }
14
- // Invoke: computation: Async<'T> -> ctxt:AsyncActivation<'T> -> AsyncReturn
15
- export function invoke(computation, ctx) {
16
- return computation(ctx);
17
- }
18
- // CallThenInvoke: ctxt:AsyncActivation<'T> -> result1:'U -> part2:('U -> Async<'T>) -> AsyncReturn
19
- export function callThenInvoke(ctx, result1, part2) {
20
- return part2(result1)(ctx);
21
- }
22
- // Bind: ctxt:AsyncActivation<'T> -> part1:Async<'U> -> part2:('U -> Async<'T>) -> AsyncReturn
23
- export function bind(ctx, part1, part2) {
24
- return protectedBind(part1, part2)(ctx);
25
- }
26
- export function createCancellationToken(arg) {
27
- const token = new CancellationToken(typeof arg === "boolean" ? arg : false);
28
- if (typeof arg === "number") {
29
- setTimeout(() => { token.cancel(); }, arg);
30
- }
31
- return token;
32
- }
33
- export function cancel(token) {
34
- token.cancel();
35
- }
36
- export function cancelAfter(token, ms) {
37
- setTimeout(() => { token.cancel(); }, ms);
38
- }
39
- export function isCancellationRequested(token) {
40
- return token != null && token.isCancelled;
41
- }
42
- export function throwIfCancellationRequested(token) {
43
- if (token != null && token.isCancelled) {
44
- throw new Exception("Operation is cancelled");
45
- }
46
- }
47
- export function startChild(computation, ms) {
48
- return protectedCont((ctx) => {
49
- // Share the parent's cancellation token so cancelling the parent
50
- // cancels the child, like .NET Async.StartChild
51
- const promise = startAsPromise(computation, ctx.cancelToken);
52
- let promiseToRun = promise;
53
- if (ms) {
54
- // Race the computation against a timeout: whichever settles first wins.
55
- promiseToRun = new Promise((resolve, reject) => {
56
- const timeoutId = setTimeout(() => reject(TimeoutException_$ctor()), ms);
57
- promise.then(value => { clearTimeout(timeoutId); resolve(value); }, error => { clearTimeout(timeoutId); reject(error); });
58
- });
59
- }
60
- // Prevent an unhandled rejection when the child is cancelled or fails
61
- // while nobody awaits it (in F# an unobserved child's cancellation or
62
- // failure is simply not propagated). awaitPromise attaches its own
63
- // handlers to the same promise, so awaiting still observes the result.
64
- promiseToRun.catch(emptyContinuation);
65
- // JS Promises are hot, computation has already started
66
- // but we delay returning the result
67
- protectedReturn(awaitPromise(promiseToRun))(ctx);
68
- });
69
- }
70
- export function awaitPromise(p) {
71
- return fromContinuations((conts) => p.then(conts[0]).catch((err) => (err instanceof OperationCanceledException
72
- ? conts[2] : conts[1])(err)));
73
- }
74
- export function awaitEvent(event, cancelAction) {
75
- return protectedCont((ctx) => {
76
- let tokenId;
77
- const handler = ((_sender, arg) => {
78
- ctx.cancelToken.removeListener(tokenId);
79
- event.RemoveHandler(handler);
80
- ctx.onSuccess(arg);
81
- });
82
- tokenId = ctx.cancelToken.addListener(() => {
83
- event.RemoveHandler(handler);
84
- if (cancelAction != null) {
85
- cancelAction();
86
- }
87
- ctx.onCancel(new OperationCanceledException());
88
- });
89
- event.AddHandler(handler);
90
- });
91
- }
92
- export function cancellationToken() {
93
- return protectedCont((ctx) => ctx.onSuccess(ctx.cancelToken));
94
- }
95
- export const defaultCancellationToken = new CancellationToken();
96
- export function catchAsync(work) {
97
- return protectedCont((ctx) => {
98
- work({
99
- onSuccess: (x) => ctx.onSuccess(Choice_makeChoice1Of2(x)),
100
- onError: (ex) => ctx.onSuccess(Choice_makeChoice2Of2(ex)),
101
- onCancel: ctx.onCancel,
102
- cancelToken: ctx.cancelToken,
103
- trampoline: ctx.trampoline,
104
- });
105
- });
106
- }
107
- export function fromContinuations(f) {
108
- return protectedCont((ctx) => f([ctx.onSuccess, ctx.onError, ctx.onCancel]));
109
- }
110
- export function ignore(computation) {
111
- return protectedBind(computation, (_x) => protectedReturn(void 0));
112
- }
113
- export function parallel(computations) {
114
- // Children share the parent's cancellation token, like .NET Async.Parallel
115
- return protectedCont((ctx) => awaitPromise(Promise.all(Array.from(computations, (w) => startAsPromise(w, ctx.cancelToken))))(ctx));
116
- }
117
- export function sequential(computations) {
118
- function _sequential(computations, cancelToken) {
119
- let pr = Promise.resolve([]);
120
- for (const c of computations) {
121
- pr = pr.then(results => startAsPromise(c, cancelToken).then(r => results.concat([r])));
122
- }
123
- return pr;
124
- }
125
- // Children share the parent's cancellation token, like .NET Async.Sequential
126
- return protectedCont((ctx) => awaitPromise(_sequential(computations, ctx.cancelToken))(ctx));
127
- }
128
- export function sleep(millisecondsDueTime) {
129
- return protectedCont((ctx) => {
130
- let tokenId;
131
- const timeoutId = setTimeout(() => {
132
- ctx.cancelToken.removeListener(tokenId);
133
- ctx.onSuccess(void 0);
134
- }, millisecondsDueTime);
135
- tokenId = ctx.cancelToken.addListener(() => {
136
- clearTimeout(timeoutId);
137
- ctx.onCancel(new OperationCanceledException());
138
- });
139
- });
140
- }
141
- export function start(computation, cancellationToken) {
142
- return startWithContinuations(computation, emptyContinuation, function (err) { throw err; }, emptyContinuation, cancellationToken);
143
- }
144
- export function startImmediate(computation, cancellationToken) {
145
- return start(computation, cancellationToken);
146
- }
147
- export function startWithContinuations(computation, continuation, exceptionContinuation, cancellationContinuation, cancelToken) {
148
- const trampoline = new Trampoline();
149
- // Mark the computation completed as soon as a terminal continuation is entered
150
- // so protectedCont lets exceptions from continuation code propagate instead of
151
- // routing them to onError (see Trampoline.completed).
152
- const done = (cont) => (x) => { trampoline.completed = true; return cont(x); };
153
- computation({
154
- onSuccess: done(continuation ? continuation : emptyContinuation),
155
- onError: done(exceptionContinuation),
156
- onCancel: done(cancellationContinuation),
157
- cancelToken: cancelToken ? cancelToken : defaultCancellationToken,
158
- trampoline,
159
- });
160
- }
161
- export function startAsPromise(computation, cancellationToken) {
162
- return new Promise((resolve, reject) => startWithContinuations(computation, resolve, reject, reject, cancellationToken ? cancellationToken : defaultCancellationToken));
163
- }