@glutinum/cli 0.7.0 → 0.8.0
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/Glutinum.Converter/FsharpAST.js +26 -8
- package/dist/Glutinum.Converter/FsharpAST.js.map +1 -1
- package/dist/Glutinum.Converter/GlueAST.js +38 -6
- package/dist/Glutinum.Converter/GlueAST.js.map +1 -1
- package/dist/Glutinum.Converter/Printer.js +82 -38
- package/dist/Glutinum.Converter/Printer.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +3 -3
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Declaration.js +19 -5
- package/dist/Glutinum.Converter/Reader/Declaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +3 -2
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/TypeNode.js +29 -28
- package/dist/Glutinum.Converter/Reader/TypeNode.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Utils.js +21 -1
- package/dist/Glutinum.Converter/Reader/Utils.js.map +1 -1
- package/dist/Glutinum.Converter/Transform.js +202 -102
- package/dist/Glutinum.Converter/Transform.js.map +1 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +57 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js +105 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +1 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +20 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs +766 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +218 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +1 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +31 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +20 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +1 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Array.d.ts +123 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Array.js +1242 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Async.d.ts +32 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Async.js +158 -0
- package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.d.ts +59 -0
- package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.js +183 -0
- package/dist/fable_modules/fable-library-js.4.14.0/BigInt.d.ts +115 -0
- package/dist/fable_modules/fable-library-js.4.14.0/BigInt.js +282 -0
- package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.d.ts +27 -0
- package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.js +138 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Boolean.d.ts +3 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Boolean.js +21 -0
- package/dist/fable_modules/fable-library-js.4.14.0/CHANGELOG.md +37 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Char.d.ts +65 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Char.js +169 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Choice.d.ts +121 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Choice.js +184 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Date.d.ts +70 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Date.js +749 -0
- package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.d.ts +63 -0
- package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.js +268 -0
- package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.d.ts +18 -0
- package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.js +124 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Decimal.d.ts +45 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Decimal.js +212 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Double.d.ts +11 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Double.js +46 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Encoding.d.ts +12 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Encoding.js +173 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Event.d.ts +31 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Event.js +93 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.d.ts +7 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.js +27 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.d.ts +12 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.js +27 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.d.ts +17 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.js +69 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Global.d.ts +24 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Global.js +8 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Guid.d.ts +10 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Guid.js +142 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Int32.d.ts +28 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Int32.js +135 -0
- package/dist/fable_modules/fable-library-js.4.14.0/List.d.ts +143 -0
- package/dist/fable_modules/fable-library-js.4.14.0/List.js +1273 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Long.d.ts +3 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Long.js +46 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.d.ts +25 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.js +93 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Map.d.ts +178 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Map.js +1396 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.d.ts +10 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.js +112 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.d.ts +52 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.js +327 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.d.ts +39 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.js +233 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Native.d.ts +2 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Native.js +8 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Numeric.d.ts +19 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Numeric.js +71 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Observable.d.ts +32 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Observable.js +113 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Option.d.ts +28 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Option.js +96 -0
- package/dist/fable_modules/fable-library-js.4.14.0/README.md +3 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Random.d.ts +37 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Random.js +170 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Range.d.ts +12 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Range.js +45 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Reflection.d.ts +119 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Reflection.js +461 -0
- package/dist/fable_modules/fable-library-js.4.14.0/RegExp.d.ts +10 -0
- package/dist/fable_modules/fable-library-js.4.14.0/RegExp.js +132 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Result.d.ts +37 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Result.js +165 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Seq.d.ts +165 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Seq.js +1379 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Seq2.d.ts +18 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Seq2.js +111 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Set.d.ts +190 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Set.js +1789 -0
- package/dist/fable_modules/fable-library-js.4.14.0/String.d.ts +50 -0
- package/dist/fable_modules/fable-library-js.4.14.0/String.js +543 -0
- package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.d.ts +79 -0
- package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.js +317 -0
- package/dist/fable_modules/fable-library-js.4.14.0/System.Text.d.ts +38 -0
- package/dist/fable_modules/fable-library-js.4.14.0/System.Text.js +162 -0
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.d.ts +5 -0
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.js +5 -0
- package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.d.ts +15 -0
- package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.js +122 -0
- package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.d.ts +34 -0
- package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.js +177 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Timer.d.ts +19 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Timer.js +67 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Types.d.ts +58 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Types.js +208 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.d.ts +2 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.js +4 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Uri.d.ts +29 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Uri.js +142 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Util.d.ts +207 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Util.js +770 -0
- package/dist/fable_modules/fable-library-js.4.14.0/big.d.ts +338 -0
- package/dist/fable_modules/fable-library-js.4.14.0/lib/big.d.ts +5 -0
- package/dist/fable_modules/fable-library-js.4.14.0/lib/big.js +826 -0
- package/dist/fable_modules/fable-library-js.4.14.0/package.json +24 -0
- package/dist/fable_modules/project_cracked.json +1 -0
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { printf, toFail, interpolate, toText, join, trimStart } from "../fable_modules/fable-library-js.4.14.0/String.js";
|
|
2
2
|
import { record_type, list_type, class_type } from "../fable_modules/fable-library-js.4.14.0/Reflection.js";
|
|
3
3
|
import { Record } from "../fable_modules/fable-library-js.4.14.0/Types.js";
|
|
4
|
-
import { FSharpTypeParameter_Create_Z6CFD3565, FSharpTypeAlias, FSharpEnum, FSharpEnumCase, FSharpStaticMemberInfo, FSharpAccessor, FSharpMapped, FSharpMember, FSharpMemberInfo, FSharpInterface, FSharpClass, FSharpConstructor, FSharpAccessibility, FSharpExplicitField, FSharpParameter, FSharpFunctionType, FSharpTypeReference, FSharpUnion, FSharpUnionCase, FSharpPrimitive, FSharpLiteral, FSharpCommentTypeParam, FSharpCommentParam, FSharpXmlDoc, FSharpAttribute, FSharpType, FSharpModule, FSharpXmlDoc_$reflection, FSharpAttribute_$reflection } from "./FsharpAST.js";
|
|
4
|
+
import { FSharpTypeParameter_Create_Z6CFD3565, FSharpTypeAlias, FSharpEnum, FSharpEnumCase, FSharpStaticMemberInfo, FSharpAccessor, FSharpMapped, FSharpMember, FSharpMemberInfo, FSharpMemberInfoBody, FSharpInterface, FSharpClass, FSharpConstructor, FSharpAccessibility, FSharpExplicitField, FSharpParameter, FSharpFunctionType, FSharpTypeReference, FSharpUnion, FSharpUnionCase, FSharpPrimitive, FSharpLiteral, FSharpCommentTypeParam, FSharpCommentParam, FSharpXmlDoc, FSharpAttribute, FSharpType, FSharpModule, FSharpXmlDoc_$reflection, FSharpAttribute_$reflection } from "./FsharpAST.js";
|
|
5
5
|
import { empty as empty_1, singleton as singleton_1, collect, append, delay, toList } from "../fable_modules/fable-library-js.4.14.0/Seq.js";
|
|
6
|
-
import { exists, filter, choose, collect as collect_1, ofArray, forAll, length, partition, sortBy, map, append as append_1, head as head_1, tail, singleton, empty, isEmpty } from "../fable_modules/fable-library-js.4.14.0/List.js";
|
|
6
|
+
import { exists, filter, tryFind, choose, collect as collect_1, ofArray, forAll, length, partition, sortBy, map, append as append_1, head as head_1, tail, singleton, empty, isEmpty } from "../fable_modules/fable-library-js.4.14.0/List.js";
|
|
7
7
|
import { sanitizeNameWithResult, removeSurroundingQuotes, mapTypeNameToFableCoreAwareName, sanitizeName } from "./Utils/Naming.js";
|
|
8
8
|
import { unwrap, value as value_4, map as map_1, defaultArg } from "../fable_modules/fable-library-js.4.14.0/Option.js";
|
|
9
9
|
import { int32ToString, safeHash, equals, comparePrimitives } from "../fable_modules/fable-library-js.4.14.0/Util.js";
|
|
10
|
-
import { GlueType, GlueTypeUnion, GlueConstructor, GlueType__get_Name } from "./GlueAST.js";
|
|
10
|
+
import { GlueType, GlueTypeUnion, GlueMember, GlueProperty, GlueAccessor, GlueConstructor, GlueType__get_Name } from "./GlueAST.js";
|
|
11
11
|
import { warn, error } from "./Log.js";
|
|
12
12
|
import { List_distinct } from "../fable_modules/fable-library-js.4.14.0/Seq2.js";
|
|
13
13
|
|
|
@@ -156,7 +156,7 @@ function transformComment(comment) {
|
|
|
156
156
|
Remarks: empty(),
|
|
157
157
|
Throws: empty(),
|
|
158
158
|
}, comment);
|
|
159
|
-
const obsoleteAttributes = map((Item) => (new FSharpAttribute(
|
|
159
|
+
const obsoleteAttributes = map((Item) => (new FSharpAttribute(9, [Item])), categories.Deprecated);
|
|
160
160
|
const remarks = (!isEmpty(categories.Remarks) ? true : !isEmpty(categories.Throws)) ? (new FSharpXmlDoc(3, [join("\n", toList(delay(() => append(categories.Remarks, delay(() => append(!isEmpty(categories.Throws) ? append(!isEmpty(categories.Remarks) ? singleton_1("") : empty_1(), delay(() => append(singleton_1("Throws:"), delay(() => singleton_1("-------"))))) : empty_1(), delay(() => collect((throws) => append(singleton_1(""), delay(() => singleton_1(throws))), categories.Throws))))))))])) : void 0;
|
|
161
161
|
const others = map((comment_2) => {
|
|
162
162
|
switch (comment_2.tag) {
|
|
@@ -249,6 +249,7 @@ function transformTupleType(context, glueTypes) {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
function transformType(context_mut, glueType_mut) {
|
|
252
|
+
let originalInterface;
|
|
252
253
|
transformType:
|
|
253
254
|
while (true) {
|
|
254
255
|
const context = context_mut, glueType = glueType_mut;
|
|
@@ -320,11 +321,13 @@ function transformType(context_mut, glueType_mut) {
|
|
|
320
321
|
const typeLiteralInfo = glueType.fields[0];
|
|
321
322
|
if (forAll((_arg) => {
|
|
322
323
|
switch (_arg.tag) {
|
|
323
|
-
case
|
|
324
|
+
case 6:
|
|
324
325
|
case 1:
|
|
325
326
|
case 2:
|
|
327
|
+
case 3:
|
|
328
|
+
case 4:
|
|
326
329
|
case 0:
|
|
327
|
-
case
|
|
330
|
+
case 7:
|
|
328
331
|
return true;
|
|
329
332
|
default:
|
|
330
333
|
return false;
|
|
@@ -342,10 +345,10 @@ function transformType(context_mut, glueType_mut) {
|
|
|
342
345
|
Compare: comparePrimitives,
|
|
343
346
|
});
|
|
344
347
|
const explicitFields = map((parameter_2) => (new FSharpExplicitField(parameter_2.Name, parameter_2.IsOptional ? (new FSharpType(2, [parameter_2.Type])) : parameter_2.Type)), typeLiteralParameters);
|
|
345
|
-
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(16, [new FSharpClass(ofArray([new FSharpAttribute(
|
|
348
|
+
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(16, [new FSharpClass(ofArray([new FSharpAttribute(17, []), new FSharpAttribute(8, [])]), TransformContext__get_CurrentScopeName(context), empty(), new FSharpConstructor(typeLiteralParameters, ofArray([new FSharpAttribute(18, []), new FSharpAttribute(2, [])]), new FSharpAccessibility(0, [])), empty(), explicitFields)]));
|
|
346
349
|
}
|
|
347
350
|
else {
|
|
348
|
-
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(4, [new FSharpInterface(ofArray([new FSharpAttribute(
|
|
351
|
+
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(4, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), TransformContext__get_CurrentScopeName(context), "", empty(), TransformMembers_toFSharpMember(context, typeLiteralInfo.Members), empty())]));
|
|
349
352
|
}
|
|
350
353
|
return new FSharpType(10, [new FSharpTypeReference(TransformContext__get_FullName(context), TransformContext__get_FullName(context), empty(), new FSharpType(9, []))]);
|
|
351
354
|
}
|
|
@@ -374,13 +377,17 @@ function transformType(context_mut, glueType_mut) {
|
|
|
374
377
|
glueType_mut = glueType.fields[0].Type;
|
|
375
378
|
continue transformType;
|
|
376
379
|
}
|
|
380
|
+
case 14: {
|
|
381
|
+
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(4, [(originalInterface = transformInterface(context, glueType.fields[0]), Interface_makePartial(TransformContext__get_CurrentScopeName(context), originalInterface))]));
|
|
382
|
+
return new FSharpType(10, [new FSharpTypeReference(TransformContext__get_FullName(context), TransformContext__get_FullName(context), empty(), new FSharpType(9, []))]);
|
|
383
|
+
}
|
|
384
|
+
case 0:
|
|
385
|
+
return new FSharpType(17, []);
|
|
377
386
|
case 11:
|
|
378
387
|
case 10:
|
|
379
388
|
case 8:
|
|
380
389
|
case 4:
|
|
381
390
|
case 5:
|
|
382
|
-
case 0:
|
|
383
|
-
case 14:
|
|
384
391
|
case 21:
|
|
385
392
|
case 6: {
|
|
386
393
|
error(toText(interpolate("Could not transform type: %A%P()", [glueType])));
|
|
@@ -395,21 +402,21 @@ function transformType(context_mut, glueType_mut) {
|
|
|
395
402
|
|
|
396
403
|
function transformExports(context, isTopLevel, exports) {
|
|
397
404
|
const context_1 = TransformContext__PushScope_Z721C83C5(context, "Exports");
|
|
398
|
-
return new FSharpType(4, [new FSharpInterface(
|
|
405
|
+
return new FSharpType(4, [new FSharpInterface(ofArray([new FSharpAttribute(7, []), new FSharpAttribute(6, [])]), "Exports", "Exports", empty(), collect_1((_arg) => {
|
|
399
406
|
let Attributes_1, Parameters_1;
|
|
400
407
|
switch (_arg.tag) {
|
|
401
408
|
case 2: {
|
|
402
409
|
const info = _arg.fields[0];
|
|
403
410
|
const patternInput = sanitizeNameAndPushScope(info.Name, context_1);
|
|
404
411
|
const xmlDocInfo = transformComment(info.Documentation);
|
|
405
|
-
return singleton(new FSharpMember(1, [new FSharpMemberInfo(toList(delay(() => append(singleton_1(new FSharpAttribute(3, [info.Name, "REPLACE_ME_WITH_MODULE_NAME"])), delay(() => xmlDocInfo.ObsoleteAttributes)))), patternInput[0], info.Name, empty(), empty(), transformType(patternInput[1], info.Type), false, true, void 0, new FSharpAccessibility(0, []), xmlDocInfo.XmlDoc)]));
|
|
412
|
+
return singleton(new FSharpMember(1, [new FSharpMemberInfo(toList(delay(() => append(singleton_1(new FSharpAttribute(3, [info.Name, "REPLACE_ME_WITH_MODULE_NAME"])), delay(() => xmlDocInfo.ObsoleteAttributes)))), patternInput[0], info.Name, empty(), empty(), transformType(patternInput[1], info.Type), false, true, void 0, new FSharpAccessibility(0, []), xmlDocInfo.XmlDoc, new FSharpMemberInfoBody(0, []))]));
|
|
406
413
|
}
|
|
407
414
|
case 6: {
|
|
408
415
|
const info_1 = _arg.fields[0];
|
|
409
416
|
const patternInput_1 = sanitizeNameAndPushScope(info_1.Name, context_1);
|
|
410
417
|
const context_3 = patternInput_1[1];
|
|
411
418
|
const xmlDocInfo_1 = transformComment(info_1.Documentation);
|
|
412
|
-
return singleton(new FSharpMember(0, [(Attributes_1 = toList(delay(() => append(singleton_1(new FSharpAttribute(3, [info_1.Name, "REPLACE_ME_WITH_MODULE_NAME"])), delay(() => xmlDocInfo_1.ObsoleteAttributes)))), (Parameters_1 = map((parameter) => transformParameter(context_3, parameter), info_1.Parameters), new FSharpMemberInfo(Attributes_1, patternInput_1[0], info_1.Name, transformTypeParameters(context_3, info_1.TypeParameters), Parameters_1, transformType(context_3, info_1.Type), false,
|
|
419
|
+
return singleton(new FSharpMember(0, [(Attributes_1 = toList(delay(() => append(isTopLevel ? singleton_1(new FSharpAttribute(3, [info_1.Name, "REPLACE_ME_WITH_MODULE_NAME"])) : singleton_1(new FSharpAttribute(15, [info_1.Name])), delay(() => xmlDocInfo_1.ObsoleteAttributes)))), (Parameters_1 = map((parameter) => transformParameter(context_3, parameter), info_1.Parameters), new FSharpMemberInfo(Attributes_1, patternInput_1[0], info_1.Name, transformTypeParameters(context_3, info_1.TypeParameters), Parameters_1, transformType(context_3, info_1.Type), false, isTopLevel, void 0, new FSharpAccessibility(0, []), xmlDocInfo_1.XmlDoc, new FSharpMemberInfoBody(0, []))))]));
|
|
413
420
|
}
|
|
414
421
|
case 12: {
|
|
415
422
|
const info_2 = _arg.fields[0];
|
|
@@ -418,36 +425,38 @@ function transformExports(context, isTopLevel, exports) {
|
|
|
418
425
|
return map((constructorInfo) => {
|
|
419
426
|
let Attributes_2, Parameters_2;
|
|
420
427
|
const xmlDocInfo_2 = transformComment(constructorInfo.Documentation);
|
|
421
|
-
return new FSharpMember(0, [(Attributes_2 = toList(delay(() => append(isTopLevel ? append(singleton_1(new FSharpAttribute(3, [info_2.Name, "REPLACE_ME_WITH_MODULE_NAME"])), delay(() => singleton_1(new FSharpAttribute(
|
|
428
|
+
return new FSharpMember(0, [(Attributes_2 = toList(delay(() => append(isTopLevel ? append(singleton_1(new FSharpAttribute(3, [info_2.Name, "REPLACE_ME_WITH_MODULE_NAME"])), delay(() => singleton_1(new FSharpAttribute(13, [])))) : singleton_1(new FSharpAttribute(14, [info_2.Name])), delay(() => xmlDocInfo_2.ObsoleteAttributes)))), (Parameters_2 = map((parameter_1) => transformParameter(context_4, parameter_1), constructorInfo.Parameters), new FSharpMemberInfo(Attributes_2, patternInput_2[0], info_2.Name, transformTypeParameters(context_4, info_2.TypeParameters), Parameters_2, new FSharpType(6, [new FSharpMapped(sanitizeName(info_2.Name), empty(), transformTypeParameters(context_4, info_2.TypeParameters))]), false, isTopLevel, void 0, new FSharpAccessibility(0, []), xmlDocInfo_2.XmlDoc, new FSharpMemberInfoBody(0, []))))]);
|
|
422
429
|
}, isEmpty(info_2.Constructors) ? singleton(new GlueConstructor(empty(), empty())) : info_2.Constructors);
|
|
423
430
|
}
|
|
424
431
|
case 11: {
|
|
425
432
|
const moduleDeclaration = _arg.fields[0];
|
|
426
433
|
return choose((typ) => {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
434
|
+
switch (typ.tag) {
|
|
435
|
+
case 12:
|
|
436
|
+
return new FSharpMember(1, [new FSharpMemberInfo(ofArray([new FSharpAttribute(4, ["REPLACE_ME_WITH_MODULE_NAME"]), new FSharpAttribute(0, [`Emit("$0.${moduleDeclaration.Name}")`])]), moduleDeclaration.Name + "_", moduleDeclaration.Name, empty(), empty(), new FSharpType(6, [new FSharpMapped(`${moduleDeclaration.Name}.Exports`, empty(), empty())]), false, true, new FSharpAccessor(0, []), new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]);
|
|
437
|
+
case 6:
|
|
438
|
+
return new FSharpMember(1, [new FSharpMemberInfo(ofArray([new FSharpAttribute(4, ["REPLACE_ME_WITH_MODULE_NAME"]), new FSharpAttribute(0, [`Emit("$0.${moduleDeclaration.Name}")`])]), moduleDeclaration.Name + "_", `${moduleDeclaration.Name}.Exports`, empty(), empty(), new FSharpType(6, [new FSharpMapped(`${moduleDeclaration.Name}.Exports`, empty(), empty())]), false, isTopLevel, new FSharpAccessor(0, []), new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]);
|
|
439
|
+
default:
|
|
440
|
+
return void 0;
|
|
432
441
|
}
|
|
433
442
|
}, moduleDeclaration.Types);
|
|
434
443
|
}
|
|
435
444
|
case 25: {
|
|
436
445
|
const glueType = _arg.fields[0];
|
|
437
446
|
const patternInput_3 = sanitizeNameAndPushScope(GlueType__get_Name(glueType), context_1);
|
|
438
|
-
return singleton(new FSharpMember(1, [new FSharpMemberInfo(singleton(new FSharpAttribute(5, ["REPLACE_ME_WITH_MODULE_NAME"])), patternInput_3[0], GlueType__get_Name(glueType), empty(), empty(), transformType(patternInput_3[1], glueType), false, true, void 0, new FSharpAccessibility(0, []), empty())]));
|
|
447
|
+
return singleton(new FSharpMember(1, [new FSharpMemberInfo(singleton(new FSharpAttribute(5, ["REPLACE_ME_WITH_MODULE_NAME"])), patternInput_3[0], GlueType__get_Name(glueType), empty(), empty(), transformType(patternInput_3[1], glueType), false, true, void 0, new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]));
|
|
439
448
|
}
|
|
440
449
|
default:
|
|
441
450
|
return toFail(printf("Could not generate exportMembers for: %A"))(_arg);
|
|
442
451
|
}
|
|
443
|
-
}, exports))]);
|
|
452
|
+
}, exports), empty())]);
|
|
444
453
|
}
|
|
445
454
|
|
|
446
455
|
function transformParameter(context, parameter) {
|
|
447
456
|
let typ;
|
|
448
457
|
const computedType = transformType(TransformContext__PushScope_Z721C83C5(context, parameter.Name), parameter.Type);
|
|
449
458
|
typ = (parameter.IsSpread ? ((computedType.tag === 13) ? computedType.fields[0] : computedType) : computedType);
|
|
450
|
-
return new FSharpParameter(toList(delay(() => (parameter.IsSpread ? singleton_1(new FSharpAttribute(
|
|
459
|
+
return new FSharpParameter(toList(delay(() => (parameter.IsSpread ? singleton_1(new FSharpAttribute(19, [])) : empty_1()))), sanitizeName(parameter.Name), parameter.IsOptional, typ);
|
|
451
460
|
}
|
|
452
461
|
|
|
453
462
|
function transformAccessor(accessor) {
|
|
@@ -462,16 +471,16 @@ function transformAccessor(accessor) {
|
|
|
462
471
|
}
|
|
463
472
|
|
|
464
473
|
function TransformMembers_toFSharpMember(context, members) {
|
|
465
|
-
return choose((
|
|
466
|
-
switch (
|
|
467
|
-
case
|
|
468
|
-
const callSignatureInfo =
|
|
474
|
+
return choose((_arg_3) => {
|
|
475
|
+
switch (_arg_3.tag) {
|
|
476
|
+
case 4: {
|
|
477
|
+
const callSignatureInfo = _arg_3.fields[0];
|
|
469
478
|
const patternInput_1 = sanitizeNameAndPushScope("Invoke", context);
|
|
470
479
|
const context_2 = patternInput_1[1];
|
|
471
|
-
return new FSharpMember(0, [new FSharpMemberInfo(singleton(new FSharpAttribute(1, [])), patternInput_1[0], "Invoke", empty(), map((parameter_2) => transformParameter(context_2, parameter_2), callSignatureInfo.Parameters), transformType(context_2, callSignatureInfo.Type), false, false, void 0, new FSharpAccessibility(0, []), empty())]);
|
|
480
|
+
return new FSharpMember(0, [new FSharpMemberInfo(singleton(new FSharpAttribute(1, [])), patternInput_1[0], "Invoke", empty(), map((parameter_2) => transformParameter(context_2, parameter_2), callSignatureInfo.Parameters), transformType(context_2, callSignatureInfo.Type), false, false, void 0, new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]);
|
|
472
481
|
}
|
|
473
482
|
case 1: {
|
|
474
|
-
const propertyInfo =
|
|
483
|
+
const propertyInfo = _arg_3.fields[0];
|
|
475
484
|
const patternInput_2 = sanitizeNameAndPushScope(propertyInfo.Name, context);
|
|
476
485
|
const xmlDocInfo = transformComment(propertyInfo.Documentation);
|
|
477
486
|
if (propertyInfo.IsPrivate && !propertyInfo.IsStatic) {
|
|
@@ -481,30 +490,42 @@ function TransformMembers_toFSharpMember(context, members) {
|
|
|
481
490
|
let typ;
|
|
482
491
|
const typ$0027 = transformType(patternInput_2[1], propertyInfo.Type);
|
|
483
492
|
typ = (propertyInfo.IsOptional ? ((typ$0027.tag === 2) ? typ$0027.fields[0] : typ$0027) : typ$0027);
|
|
484
|
-
return new FSharpMember(1, [new FSharpMemberInfo(toList(delay(() => xmlDocInfo.ObsoleteAttributes)), patternInput_2[0], propertyInfo.Name, empty(), empty(), typ, propertyInfo.IsOptional, propertyInfo.IsStatic, transformAccessor(propertyInfo.Accessor), propertyInfo.IsPrivate ? (new FSharpAccessibility(1, [])) : (new FSharpAccessibility(0, [])), xmlDocInfo.XmlDoc)]);
|
|
493
|
+
return new FSharpMember(1, [new FSharpMemberInfo(toList(delay(() => xmlDocInfo.ObsoleteAttributes)), patternInput_2[0], propertyInfo.Name, empty(), empty(), typ, propertyInfo.IsOptional, propertyInfo.IsStatic, transformAccessor(propertyInfo.Accessor), propertyInfo.IsPrivate ? (new FSharpAccessibility(1, [])) : (new FSharpAccessibility(0, [])), xmlDocInfo.XmlDoc, new FSharpMemberInfoBody(1, []))]);
|
|
485
494
|
}
|
|
486
495
|
}
|
|
487
|
-
case
|
|
488
|
-
const
|
|
489
|
-
const patternInput_3 = sanitizeNameAndPushScope(
|
|
490
|
-
const
|
|
491
|
-
return new FSharpMember(1, [new FSharpMemberInfo(
|
|
496
|
+
case 2: {
|
|
497
|
+
const getAccessorInfo_1 = _arg_3.fields[0];
|
|
498
|
+
const patternInput_3 = sanitizeNameAndPushScope(getAccessorInfo_1.Name, context);
|
|
499
|
+
const xmlDocInfo_1 = transformComment(getAccessorInfo_1.Documentation);
|
|
500
|
+
return new FSharpMember(1, [new FSharpMemberInfo(toList(delay(() => xmlDocInfo_1.ObsoleteAttributes)), patternInput_3[0], getAccessorInfo_1.Name, empty(), empty(), transformType(patternInput_3[1], getAccessorInfo_1.Type), false, getAccessorInfo_1.IsStatic, new FSharpAccessor(0, []), new FSharpAccessibility(0, []), xmlDocInfo_1.XmlDoc, new FSharpMemberInfoBody(0, []))]);
|
|
492
501
|
}
|
|
493
|
-
case
|
|
494
|
-
const
|
|
495
|
-
const patternInput_4 = sanitizeNameAndPushScope(
|
|
496
|
-
const
|
|
497
|
-
|
|
498
|
-
return new FSharpMember(0, [new FSharpMemberInfo(toList(delay(() => xmlDocInfo_1.ObsoleteAttributes)), patternInput_4[0], methodSignature.Name, empty(), map((parameter_4) => transformParameter(context_5, parameter_4), methodSignature.Parameters), transformType(context_5, methodSignature.Type), false, false, void 0, new FSharpAccessibility(0, []), xmlDocInfo_1.XmlDoc)]);
|
|
502
|
+
case 3: {
|
|
503
|
+
const setAccessorInfo_1 = _arg_3.fields[0];
|
|
504
|
+
const patternInput_4 = sanitizeNameAndPushScope(setAccessorInfo_1.Name, context);
|
|
505
|
+
const xmlDocInfo_2 = transformComment(setAccessorInfo_1.Documentation);
|
|
506
|
+
return new FSharpMember(1, [new FSharpMemberInfo(toList(delay(() => xmlDocInfo_2.ObsoleteAttributes)), patternInput_4[0], setAccessorInfo_1.Name, empty(), empty(), transformType(patternInput_4[1], setAccessorInfo_1.ArgumentType), false, setAccessorInfo_1.IsStatic, new FSharpAccessor(1, []), new FSharpAccessibility(0, []), xmlDocInfo_2.XmlDoc, new FSharpMemberInfoBody(0, []))]);
|
|
499
507
|
}
|
|
500
508
|
case 5: {
|
|
501
|
-
const
|
|
502
|
-
const patternInput_5 = sanitizeNameAndPushScope("
|
|
509
|
+
const indexSignature = _arg_3.fields[0];
|
|
510
|
+
const patternInput_5 = sanitizeNameAndPushScope("Item", context);
|
|
503
511
|
const context_6 = patternInput_5[1];
|
|
504
|
-
return new FSharpMember(
|
|
512
|
+
return new FSharpMember(1, [new FSharpMemberInfo(singleton(new FSharpAttribute(16, [])), patternInput_5[0], "Item", empty(), map((parameter_3) => transformParameter(context_6, parameter_3), indexSignature.Parameters), transformType(context_6, indexSignature.Type), false, false, new FSharpAccessor(2, []), new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]);
|
|
513
|
+
}
|
|
514
|
+
case 6: {
|
|
515
|
+
const methodSignature = _arg_3.fields[0];
|
|
516
|
+
const patternInput_6 = sanitizeNameAndPushScope(methodSignature.Name, context);
|
|
517
|
+
const context_7 = patternInput_6[1];
|
|
518
|
+
const xmlDocInfo_3 = transformComment(methodSignature.Documentation);
|
|
519
|
+
return new FSharpMember(0, [new FSharpMemberInfo(toList(delay(() => xmlDocInfo_3.ObsoleteAttributes)), patternInput_6[0], methodSignature.Name, empty(), map((parameter_4) => transformParameter(context_7, parameter_4), methodSignature.Parameters), transformType(context_7, methodSignature.Type), false, false, void 0, new FSharpAccessibility(0, []), xmlDocInfo_3.XmlDoc, new FSharpMemberInfoBody(0, []))]);
|
|
520
|
+
}
|
|
521
|
+
case 7: {
|
|
522
|
+
const constructSignature = _arg_3.fields[0];
|
|
523
|
+
const patternInput_7 = sanitizeNameAndPushScope("Create", context);
|
|
524
|
+
const context_8 = patternInput_7[1];
|
|
525
|
+
return new FSharpMember(0, [new FSharpMemberInfo(singleton(new FSharpAttribute(13, [])), patternInput_7[0], "Create", empty(), map((parameter_5) => transformParameter(context_8, parameter_5), constructSignature.Parameters), transformType(context_8, constructSignature.Type), false, false, void 0, new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]);
|
|
505
526
|
}
|
|
506
527
|
default: {
|
|
507
|
-
const methodInfo =
|
|
528
|
+
const methodInfo = _arg_3.fields[0];
|
|
508
529
|
const patternInput = sanitizeNameAndPushScope(methodInfo.Name, context);
|
|
509
530
|
const name = patternInput[0];
|
|
510
531
|
const context_1 = patternInput[1];
|
|
@@ -512,11 +533,59 @@ function TransformMembers_toFSharpMember(context, members) {
|
|
|
512
533
|
return new FSharpMember(2, [new FSharpStaticMemberInfo(empty(), name, methodInfo.Name, empty(), map((parameter) => transformParameter(context_1, parameter), methodInfo.Parameters), transformType(context_1, methodInfo.Type), methodInfo.IsOptional, void 0, new FSharpAccessibility(0, []))]);
|
|
513
534
|
}
|
|
514
535
|
else {
|
|
515
|
-
return new FSharpMember(0, [new FSharpMemberInfo(empty(), name, methodInfo.Name, empty(), map((parameter_1) => transformParameter(context_1, parameter_1), methodInfo.Parameters), transformType(context_1, methodInfo.Type), methodInfo.IsOptional, methodInfo.IsStatic, void 0, new FSharpAccessibility(0, []), empty())]);
|
|
536
|
+
return new FSharpMember(0, [new FSharpMemberInfo(empty(), name, methodInfo.Name, empty(), map((parameter_1) => transformParameter(context_1, parameter_1), methodInfo.Parameters), transformType(context_1, methodInfo.Type), methodInfo.IsOptional, methodInfo.IsStatic, void 0, new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]);
|
|
516
537
|
}
|
|
517
538
|
}
|
|
518
539
|
}
|
|
519
|
-
},
|
|
540
|
+
}, choose((_arg) => {
|
|
541
|
+
switch (_arg.tag) {
|
|
542
|
+
case 3: {
|
|
543
|
+
const associatedGetAccessor = tryFind((_arg_2) => {
|
|
544
|
+
if (_arg_2.tag === 2) {
|
|
545
|
+
return _arg.fields[0].Name === _arg_2.fields[0].Name;
|
|
546
|
+
}
|
|
547
|
+
else {
|
|
548
|
+
return false;
|
|
549
|
+
}
|
|
550
|
+
}, members);
|
|
551
|
+
if (associatedGetAccessor == null) {
|
|
552
|
+
return _arg;
|
|
553
|
+
}
|
|
554
|
+
else {
|
|
555
|
+
return void 0;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
case 4:
|
|
559
|
+
return _arg;
|
|
560
|
+
case 0:
|
|
561
|
+
return _arg;
|
|
562
|
+
case 1:
|
|
563
|
+
return _arg;
|
|
564
|
+
case 5:
|
|
565
|
+
return _arg;
|
|
566
|
+
case 6:
|
|
567
|
+
return _arg;
|
|
568
|
+
case 7:
|
|
569
|
+
return _arg;
|
|
570
|
+
default: {
|
|
571
|
+
const getAccessorInfo = _arg.fields[0];
|
|
572
|
+
const associatedSetAccessor = tryFind((_arg_1) => {
|
|
573
|
+
if (_arg_1.tag === 3) {
|
|
574
|
+
return getAccessorInfo.Name === _arg_1.fields[0].Name;
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
return false;
|
|
578
|
+
}
|
|
579
|
+
}, members);
|
|
580
|
+
if (associatedSetAccessor == null) {
|
|
581
|
+
return _arg;
|
|
582
|
+
}
|
|
583
|
+
else {
|
|
584
|
+
return new GlueMember(1, [new GlueProperty(getAccessorInfo.Name, getAccessorInfo.Documentation, getAccessorInfo.Type, getAccessorInfo.IsStatic, false, new GlueAccessor(2, []), getAccessorInfo.IsPrivate)]);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}, members));
|
|
520
589
|
}
|
|
521
590
|
|
|
522
591
|
function TransformMembers_toFSharpParameters(context, members) {
|
|
@@ -527,22 +596,32 @@ function TransformMembers_toFSharpParameters(context, members) {
|
|
|
527
596
|
const patternInput_1 = sanitizeNameAndPushScope(propertyInfo.Name, context);
|
|
528
597
|
return new FSharpParameter(empty(), patternInput_1[0], propertyInfo.IsOptional, transformType(patternInput_1[1], propertyInfo.Type));
|
|
529
598
|
}
|
|
599
|
+
case 2: {
|
|
600
|
+
const getAccessorInfo = _arg.fields[0];
|
|
601
|
+
const patternInput_2 = sanitizeNameAndPushScope(getAccessorInfo.Name, context);
|
|
602
|
+
return new FSharpParameter(empty(), patternInput_2[0], false, transformType(patternInput_2[1], getAccessorInfo.Type));
|
|
603
|
+
}
|
|
530
604
|
case 3: {
|
|
531
|
-
const
|
|
532
|
-
|
|
605
|
+
const setAccessorInfo = _arg.fields[0];
|
|
606
|
+
const patternInput_3 = sanitizeNameAndPushScope(setAccessorInfo.Name, context);
|
|
607
|
+
return new FSharpParameter(empty(), patternInput_3[0], false, transformType(patternInput_3[1], setAccessorInfo.ArgumentType));
|
|
533
608
|
}
|
|
534
|
-
case
|
|
609
|
+
case 5: {
|
|
610
|
+
const patternInput_4 = sanitizeNameAndPushScope("Item", context);
|
|
611
|
+
return new FSharpParameter(empty(), patternInput_4[0], false, transformType(patternInput_4[1], _arg.fields[0].Type));
|
|
612
|
+
}
|
|
613
|
+
case 6: {
|
|
535
614
|
const methodSignature = _arg.fields[0];
|
|
536
|
-
const
|
|
537
|
-
return new FSharpParameter(empty(),
|
|
615
|
+
const patternInput_5 = sanitizeNameAndPushScope(methodSignature.Name, context);
|
|
616
|
+
return new FSharpParameter(empty(), patternInput_5[0], false, transformType(patternInput_5[1], methodSignature.Type));
|
|
538
617
|
}
|
|
539
|
-
case
|
|
540
|
-
const
|
|
541
|
-
return new FSharpParameter(empty(),
|
|
618
|
+
case 4: {
|
|
619
|
+
const patternInput_6 = sanitizeNameAndPushScope("Invoke", context);
|
|
620
|
+
return new FSharpParameter(empty(), patternInput_6[0], false, transformType(patternInput_6[1], _arg.fields[0].Type));
|
|
542
621
|
}
|
|
543
|
-
case
|
|
544
|
-
const
|
|
545
|
-
return new FSharpParameter(empty(),
|
|
622
|
+
case 7: {
|
|
623
|
+
const patternInput_7 = sanitizeNameAndPushScope("Create", context);
|
|
624
|
+
return new FSharpParameter(empty(), patternInput_7[0], false, transformType(patternInput_7[1], _arg.fields[0].Type));
|
|
546
625
|
}
|
|
547
626
|
default: {
|
|
548
627
|
const methodInfo = _arg.fields[0];
|
|
@@ -557,7 +636,26 @@ function transformInterface(context, info) {
|
|
|
557
636
|
const patternInput = sanitizeNameAndPushScope(info.Name, context);
|
|
558
637
|
const context_1 = patternInput[1];
|
|
559
638
|
const Members = TransformMembers_toFSharpMember(context_1, info.Members);
|
|
560
|
-
return new FSharpInterface(ofArray([new FSharpAttribute(
|
|
639
|
+
return new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), patternInput[0], info.Name, transformTypeParameters(context_1, info.TypeParameters), Members, map((glueType) => transformType(context_1, glueType), info.HeritageClauses));
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export function Interface_makePartial(name, originalInterface) {
|
|
643
|
+
return new FSharpInterface(originalInterface.Attributes, name, originalInterface.OriginalName, originalInterface.TypeParameters, map((m) => {
|
|
644
|
+
switch (m.tag) {
|
|
645
|
+
case 1: {
|
|
646
|
+
const property = m.fields[0];
|
|
647
|
+
return new FSharpMember(1, [new FSharpMemberInfo(property.Attributes, property.Name, property.OriginalName, property.TypeParameters, property.Parameters, property.Type, true, property.IsStatic, property.Accessor, property.Accessibility, property.XmlDoc, property.Body)]);
|
|
648
|
+
}
|
|
649
|
+
case 2: {
|
|
650
|
+
const staticMember = m.fields[0];
|
|
651
|
+
return new FSharpMember(2, [new FSharpStaticMemberInfo(staticMember.Attributes, staticMember.Name, staticMember.OriginalName, staticMember.TypeParameters, staticMember.Parameters, staticMember.Type, true, staticMember.Accessor, staticMember.Accessibility)]);
|
|
652
|
+
}
|
|
653
|
+
default: {
|
|
654
|
+
const method = m.fields[0];
|
|
655
|
+
return new FSharpMember(0, [new FSharpMemberInfo(method.Attributes, method.Name, method.OriginalName, method.TypeParameters, method.Parameters, method.Type, true, method.IsStatic, method.Accessor, method.Accessibility, method.XmlDoc, method.Body)]);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}, originalInterface.Members), originalInterface.Inheritance);
|
|
561
659
|
}
|
|
562
660
|
|
|
563
661
|
function transformEnum(glueEnum) {
|
|
@@ -585,7 +683,7 @@ function transformEnum(glueEnum) {
|
|
|
585
683
|
throw new Error(`Empty enum: ${glueEnum.Name}`);
|
|
586
684
|
}
|
|
587
685
|
else {
|
|
588
|
-
return new FSharpType(1, [new FSharpUnion(ofArray([new FSharpAttribute(
|
|
686
|
+
return new FSharpType(1, [new FSharpUnion(ofArray([new FSharpAttribute(12, []), new FSharpAttribute(10, [0])]), sanitizeName(glueEnum.Name), List_distinct(map((glueMember_1) => {
|
|
589
687
|
let caseValue;
|
|
590
688
|
const matchValue_3 = glueMember_1.Value;
|
|
591
689
|
if (matchValue_3.tag === 0) {
|
|
@@ -595,7 +693,7 @@ function transformEnum(glueEnum) {
|
|
|
595
693
|
throw new Error("Should not happen");
|
|
596
694
|
}
|
|
597
695
|
const caseName = sanitizeName(glueMember_1.Name);
|
|
598
|
-
return new FSharpUnionCase(toList(delay(() => ((caseName !== caseValue) ? singleton_1(new FSharpAttribute(
|
|
696
|
+
return new FSharpUnionCase(toList(delay(() => ((caseName !== caseValue) ? singleton_1(new FSharpAttribute(11, [removeSurroundingQuotes(caseValue)])) : empty_1()))), caseName);
|
|
599
697
|
}, stringValues), {
|
|
600
698
|
Equals: equals,
|
|
601
699
|
GetHashCode: safeHash,
|
|
@@ -621,13 +719,13 @@ export function TypeAliasDeclaration_tryTransformKeyOf(aliasName, glueType) {
|
|
|
621
719
|
let sanitizeResult;
|
|
622
720
|
let matchResult, caseName;
|
|
623
721
|
switch (m.tag) {
|
|
624
|
-
case
|
|
625
|
-
case
|
|
626
|
-
case
|
|
722
|
+
case 4:
|
|
723
|
+
case 7:
|
|
724
|
+
case 5: {
|
|
627
725
|
matchResult = 1;
|
|
628
726
|
break;
|
|
629
727
|
}
|
|
630
|
-
case
|
|
728
|
+
case 6: {
|
|
631
729
|
matchResult = 0;
|
|
632
730
|
caseName = m.fields[0].Name;
|
|
633
731
|
break;
|
|
@@ -637,6 +735,16 @@ export function TypeAliasDeclaration_tryTransformKeyOf(aliasName, glueType) {
|
|
|
637
735
|
caseName = m.fields[0].Name;
|
|
638
736
|
break;
|
|
639
737
|
}
|
|
738
|
+
case 2: {
|
|
739
|
+
matchResult = 0;
|
|
740
|
+
caseName = m.fields[0].Name;
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
case 3: {
|
|
744
|
+
matchResult = 0;
|
|
745
|
+
caseName = m.fields[0].Name;
|
|
746
|
+
break;
|
|
747
|
+
}
|
|
640
748
|
default: {
|
|
641
749
|
matchResult = 0;
|
|
642
750
|
caseName = m.fields[0].Name;
|
|
@@ -644,7 +752,7 @@ export function TypeAliasDeclaration_tryTransformKeyOf(aliasName, glueType) {
|
|
|
644
752
|
}
|
|
645
753
|
switch (matchResult) {
|
|
646
754
|
case 0:
|
|
647
|
-
return (sanitizeResult = sanitizeNameWithResult(caseName), new FSharpUnionCase(toList(delay(() => (sanitizeResult.IsDifferent ? singleton_1(new FSharpAttribute(
|
|
755
|
+
return (sanitizeResult = sanitizeNameWithResult(caseName), new FSharpUnionCase(toList(delay(() => (sanitizeResult.IsDifferent ? singleton_1(new FSharpAttribute(11, [removeSurroundingQuotes(caseName)])) : empty_1()))), sanitizeResult.Name));
|
|
648
756
|
default:
|
|
649
757
|
return void 0;
|
|
650
758
|
}
|
|
@@ -653,7 +761,7 @@ export function TypeAliasDeclaration_tryTransformKeyOf(aliasName, glueType) {
|
|
|
653
761
|
return void 0;
|
|
654
762
|
}
|
|
655
763
|
else {
|
|
656
|
-
return new FSharpType(1, [new FSharpUnion(ofArray([new FSharpAttribute(
|
|
764
|
+
return new FSharpType(1, [new FSharpUnion(ofArray([new FSharpAttribute(12, []), new FSharpAttribute(10, [0])]), sanitizeName(aliasName), cases, false)]);
|
|
657
765
|
}
|
|
658
766
|
}
|
|
659
767
|
|
|
@@ -680,7 +788,7 @@ export function TypeAliasDeclaration_transformLiteral(xmlDoc, typeAliasName, lit
|
|
|
680
788
|
case 4:
|
|
681
789
|
return makeTypeAlias(new FSharpPrimitive(6, []));
|
|
682
790
|
default:
|
|
683
|
-
return new FSharpType(1, [new FSharpUnion(ofArray([new FSharpAttribute(
|
|
791
|
+
return new FSharpType(1, [new FSharpUnion(ofArray([new FSharpAttribute(12, []), new FSharpAttribute(10, [0])]), typeAliasName, singleton(new FSharpUnionCase(empty(), sanitizeName(literalInfo.fields[0]))), false)]);
|
|
684
792
|
}
|
|
685
793
|
}
|
|
686
794
|
|
|
@@ -750,7 +858,7 @@ function tryOptimizeUnionType(context, typeName, cases) {
|
|
|
750
858
|
}
|
|
751
859
|
}, flattenedCases);
|
|
752
860
|
if (isStringOnly) {
|
|
753
|
-
return new FSharpType(1, [new FSharpUnion(ofArray([new FSharpAttribute(
|
|
861
|
+
return new FSharpType(1, [new FSharpUnion(ofArray([new FSharpAttribute(12, []), new FSharpAttribute(10, [0])]), typeName, List_distinct(map((value) => {
|
|
754
862
|
let matchResult_2, value_1;
|
|
755
863
|
if (value.tag === 8) {
|
|
756
864
|
if (value.fields[0].tag === 0) {
|
|
@@ -767,7 +875,7 @@ function tryOptimizeUnionType(context, typeName, cases) {
|
|
|
767
875
|
switch (matchResult_2) {
|
|
768
876
|
case 0: {
|
|
769
877
|
const sanitizeResult = sanitizeNameWithResult(value_1);
|
|
770
|
-
return new FSharpUnionCase(toList(delay(() => (sanitizeResult.IsDifferent ? singleton_1(new FSharpAttribute(
|
|
878
|
+
return new FSharpUnionCase(toList(delay(() => (sanitizeResult.IsDifferent ? singleton_1(new FSharpAttribute(11, [removeSurroundingQuotes(value_1)])) : empty_1()))), sanitizeResult.Name);
|
|
771
879
|
}
|
|
772
880
|
default:
|
|
773
881
|
throw new Error("Should not happen");
|
|
@@ -819,7 +927,7 @@ function tryOptimizeUnionType(context, typeName, cases) {
|
|
|
819
927
|
return empty();
|
|
820
928
|
}
|
|
821
929
|
}, cases);
|
|
822
|
-
return new FSharpType(4, [new FSharpInterface(ofArray([new FSharpAttribute(
|
|
930
|
+
return new FSharpType(4, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), typeName, TransformContext__get_CurrentScopeName(context), empty(), members, empty())]);
|
|
823
931
|
}
|
|
824
932
|
else {
|
|
825
933
|
return void 0;
|
|
@@ -851,15 +959,23 @@ function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
|
851
959
|
typ_1 = m.fields[0].Type;
|
|
852
960
|
break;
|
|
853
961
|
}
|
|
854
|
-
case
|
|
855
|
-
typ_1 = m.fields[0].
|
|
962
|
+
case 3: {
|
|
963
|
+
typ_1 = m.fields[0].ArgumentType;
|
|
856
964
|
break;
|
|
857
965
|
}
|
|
858
966
|
case 4: {
|
|
859
967
|
typ_1 = m.fields[0].Type;
|
|
860
968
|
break;
|
|
861
969
|
}
|
|
862
|
-
case
|
|
970
|
+
case 7: {
|
|
971
|
+
typ_1 = m.fields[0].Type;
|
|
972
|
+
break;
|
|
973
|
+
}
|
|
974
|
+
case 6: {
|
|
975
|
+
typ_1 = m.fields[0].Type;
|
|
976
|
+
break;
|
|
977
|
+
}
|
|
978
|
+
case 5: {
|
|
863
979
|
typ_1 = m.fields[0].Type;
|
|
864
980
|
break;
|
|
865
981
|
}
|
|
@@ -907,7 +1023,7 @@ function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
|
907
1023
|
switch (matchResult_1) {
|
|
908
1024
|
case 0:
|
|
909
1025
|
if (head.tag === 21) {
|
|
910
|
-
const makeInterfaceTyp = (name) => (new FSharpInterface(ofArray([new FSharpAttribute(
|
|
1026
|
+
const makeInterfaceTyp = (name) => (new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), name, glueTypeAliasDeclaration.Name, empty(), TransformMembers_toFSharpMember(context_2, head.fields[0]), empty()));
|
|
911
1027
|
const exposedType = makeInterfaceTyp("ReturnType");
|
|
912
1028
|
const typeArgument = makeInterfaceTyp(TransformContext__get_FullName(context_2) + ".ReturnType");
|
|
913
1029
|
TransformContext__ExposeType_Z1D58A540(TransformContext__PushScope_Z721C83C5(context_2, typeReference.Name), new FSharpType(4, [exposedType]));
|
|
@@ -922,35 +1038,18 @@ function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
|
922
1038
|
}
|
|
923
1039
|
case 15:
|
|
924
1040
|
return new FSharpType(8, [new FSharpTypeAlias(toList(delay(() => xmlDoc.ObsoleteAttributes)), typeAliasName, xmlDoc.XmlDoc, transformType(context_1, new GlueType(15, [matchValue.fields[0]])), transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters))]);
|
|
925
|
-
case 14:
|
|
926
|
-
|
|
927
|
-
return new FSharpType(4, [new FSharpInterface(originalInterface.Attributes, typeAliasName, originalInterface.OriginalName, originalInterface.TypeParameters, map((m_1) => {
|
|
928
|
-
switch (m_1.tag) {
|
|
929
|
-
case 1: {
|
|
930
|
-
const property = m_1.fields[0];
|
|
931
|
-
return new FSharpMember(1, [new FSharpMemberInfo(property.Attributes, property.Name, property.OriginalName, property.TypeParameters, property.Parameters, property.Type, true, property.IsStatic, property.Accessor, property.Accessibility, property.XmlDoc)]);
|
|
932
|
-
}
|
|
933
|
-
case 2: {
|
|
934
|
-
const staticMember = m_1.fields[0];
|
|
935
|
-
return new FSharpMember(2, [new FSharpStaticMemberInfo(staticMember.Attributes, staticMember.Name, staticMember.OriginalName, staticMember.TypeParameters, staticMember.Parameters, staticMember.Type, true, staticMember.Accessor, staticMember.Accessibility)]);
|
|
936
|
-
}
|
|
937
|
-
default: {
|
|
938
|
-
const method = m_1.fields[0];
|
|
939
|
-
return new FSharpMember(0, [new FSharpMemberInfo(method.Attributes, method.Name, method.OriginalName, method.TypeParameters, method.Parameters, method.Type, true, method.IsStatic, method.Accessor, method.Accessibility, method.XmlDoc)]);
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
}, originalInterface.Members))]);
|
|
943
|
-
}
|
|
1041
|
+
case 14:
|
|
1042
|
+
return new FSharpType(4, [Interface_makePartial(typeAliasName, transformInterface(context_1, matchValue.fields[0]))]);
|
|
944
1043
|
case 16: {
|
|
945
1044
|
const functionType = matchValue.fields[0];
|
|
946
|
-
return new FSharpType(4, [new FSharpInterface(ofArray([new FSharpAttribute(
|
|
1045
|
+
return new FSharpType(4, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), typeAliasName, glueTypeAliasDeclaration.Name, transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters), singleton(new FSharpMember(0, [new FSharpMemberInfo(singleton(new FSharpAttribute(1, [])), "Invoke", "Invoke", empty(), map((parameter) => transformParameter(context_1, parameter), functionType.Parameters), transformType(context_1, functionType.Type), false, false, void 0, new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))])), empty())]);
|
|
947
1046
|
}
|
|
948
1047
|
case 19:
|
|
949
1048
|
return new FSharpType(8, [new FSharpTypeAlias(toList(delay(() => xmlDoc.ObsoleteAttributes)), typeAliasName, xmlDoc.XmlDoc, transformTupleType(context_1, matchValue.fields[0]), transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters))]);
|
|
950
1049
|
case 21:
|
|
951
|
-
return new FSharpType(4, [new FSharpInterface(ofArray([new FSharpAttribute(
|
|
1050
|
+
return new FSharpType(4, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), typeAliasName, glueTypeAliasDeclaration.Name, transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters), TransformMembers_toFSharpMember(context_1, matchValue.fields[0]), empty())]);
|
|
952
1051
|
case 22:
|
|
953
|
-
return new FSharpType(4, [new FSharpInterface(ofArray([new FSharpAttribute(
|
|
1052
|
+
return new FSharpType(4, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), typeAliasName, glueTypeAliasDeclaration.Name, transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters), TransformMembers_toFSharpMember(context_1, matchValue.fields[0].Members), empty())]);
|
|
954
1053
|
case 24:
|
|
955
1054
|
return new FSharpType(8, [new FSharpTypeAlias(toList(delay(() => xmlDoc.ObsoleteAttributes)), typeAliasName, xmlDoc.XmlDoc, new FSharpType(17, []), transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters))]);
|
|
956
1055
|
case 17:
|
|
@@ -988,7 +1087,7 @@ function transformClassDeclaration(context, classDeclaration) {
|
|
|
988
1087
|
let Members;
|
|
989
1088
|
const patternInput = sanitizeNameAndPushScope(classDeclaration.Name, context);
|
|
990
1089
|
const context_1 = patternInput[1];
|
|
991
|
-
return new FSharpType(4, [(Members = TransformMembers_toFSharpMember(context_1, classDeclaration.Members), new FSharpInterface(ofArray([new FSharpAttribute(
|
|
1090
|
+
return new FSharpType(4, [(Members = TransformMembers_toFSharpMember(context_1, classDeclaration.Members), new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), patternInput[0], classDeclaration.Name, transformTypeParameters(context_1, classDeclaration.TypeParameters), Members, map((glueType) => transformType(context_1, glueType), classDeclaration.HeritageClauses)))]);
|
|
992
1091
|
}
|
|
993
1092
|
|
|
994
1093
|
function transformToFsharp(context, glueTypes) {
|
|
@@ -1062,11 +1161,12 @@ export function transform(isTopLevel, glueAst) {
|
|
|
1062
1161
|
return true;
|
|
1063
1162
|
case 11:
|
|
1064
1163
|
return exists((glueType_2) => {
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1164
|
+
switch (glueType_2.tag) {
|
|
1165
|
+
case 12:
|
|
1166
|
+
case 6:
|
|
1167
|
+
return true;
|
|
1168
|
+
default:
|
|
1169
|
+
return false;
|
|
1070
1170
|
}
|
|
1071
1171
|
}, glueType_1.fields[0].Types);
|
|
1072
1172
|
case 25:
|