@danielx/civet 0.3.4 → 0.3.5
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/README.md +1 -1
- package/dist/browser.js +149 -35
- package/dist/browser.js.map +2 -2
- package/dist/civet +8 -8
- package/dist/cli.js.map +3 -3
- package/dist/main.js +149 -35
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -497,6 +497,8 @@ var require_parser = __commonJS({
|
|
|
497
497
|
PropertyDefinition,
|
|
498
498
|
PropertyName,
|
|
499
499
|
MethodDefinition,
|
|
500
|
+
MethodModifier,
|
|
501
|
+
MethodSignature,
|
|
500
502
|
ClassElementName,
|
|
501
503
|
PrivateIdentifier,
|
|
502
504
|
GeneratorMethod,
|
|
@@ -623,11 +625,19 @@ var require_parser = __commonJS({
|
|
|
623
625
|
JSXText,
|
|
624
626
|
JSXChildExpression,
|
|
625
627
|
TypeDeclaration,
|
|
628
|
+
TypeDeclarationModifier,
|
|
629
|
+
TypeDeclarationRest,
|
|
630
|
+
TypeKeyword,
|
|
631
|
+
Interface,
|
|
632
|
+
Namespace,
|
|
626
633
|
InterfaceBlock,
|
|
627
634
|
NestedInterfaceProperties,
|
|
628
635
|
NestedInterfaceProperty,
|
|
629
636
|
InterfaceProperty,
|
|
630
637
|
InterfacePropertyDelimiter,
|
|
638
|
+
NamespaceBlock,
|
|
639
|
+
NestedTypeDeclarations,
|
|
640
|
+
NestedTypeDeclaration,
|
|
631
641
|
TypeIndexSignature,
|
|
632
642
|
TypeIndex,
|
|
633
643
|
TypeSuffix,
|
|
@@ -799,13 +809,17 @@ var require_parser = __commonJS({
|
|
|
799
809
|
var $L125 = $L("</");
|
|
800
810
|
var $L126 = $L("<>");
|
|
801
811
|
var $L127 = $L("</>");
|
|
802
|
-
var $L128 = $L("
|
|
803
|
-
var $L129 = $L("
|
|
804
|
-
var $L130 = $L("
|
|
805
|
-
var $L131 = $L("
|
|
806
|
-
var $L132 = $L("
|
|
807
|
-
var $L133 = $L("
|
|
808
|
-
var $L134 = $L("
|
|
812
|
+
var $L128 = $L("declare");
|
|
813
|
+
var $L129 = $L("type");
|
|
814
|
+
var $L130 = $L("interface");
|
|
815
|
+
var $L131 = $L("namespace");
|
|
816
|
+
var $L132 = $L("readonly");
|
|
817
|
+
var $L133 = $L("asserts");
|
|
818
|
+
var $L134 = $L("keyof");
|
|
819
|
+
var $L135 = $L("infer");
|
|
820
|
+
var $L136 = $L("[]");
|
|
821
|
+
var $L137 = $L(" ");
|
|
822
|
+
var $L138 = $L(" ");
|
|
809
823
|
var $R0 = $R(new RegExp("(of)(?!\\p{ID_Continue})", "suy"));
|
|
810
824
|
var $R1 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
|
|
811
825
|
var $R2 = $R(new RegExp("[!~+-]", "suy"));
|
|
@@ -836,14 +850,12 @@ var require_parser = __commonJS({
|
|
|
836
850
|
var $R27 = $R(new RegExp('"[^"]*"', "suy"));
|
|
837
851
|
var $R28 = $R(new RegExp("'[^']*'", "suy"));
|
|
838
852
|
var $R29 = $R(new RegExp("[^{}<>]+", "suy"));
|
|
839
|
-
var $R30 = $R(new RegExp("
|
|
840
|
-
var $R31 = $R(new RegExp("
|
|
841
|
-
var $R32 = $R(new RegExp("[
|
|
842
|
-
var $R33 = $R(new RegExp("[
|
|
843
|
-
var $R34 = $R(new RegExp("
|
|
844
|
-
var $R35 = $R(new RegExp("
|
|
845
|
-
var $R36 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
|
|
846
|
-
var $R37 = $R(new RegExp("$", "suy"));
|
|
853
|
+
var $R30 = $R(new RegExp("[+-]?", "suy"));
|
|
854
|
+
var $R31 = $R(new RegExp("[+-]", "suy"));
|
|
855
|
+
var $R32 = $R(new RegExp("#![^\\r\\n]*", "suy"));
|
|
856
|
+
var $R33 = $R(new RegExp("[\\t ]*", "suy"));
|
|
857
|
+
var $R34 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
|
|
858
|
+
var $R35 = $R(new RegExp("$", "suy"));
|
|
847
859
|
var Program$0 = $S(Init, __, $Q(TopLevelStatement), __);
|
|
848
860
|
function Program(state) {
|
|
849
861
|
if (state.verbose)
|
|
@@ -1897,6 +1909,26 @@ var require_parser = __commonJS({
|
|
|
1897
1909
|
return MethodDefinition$0(state) || MethodDefinition$1(state) || MethodDefinition$2(state) || MethodDefinition$3(state) || MethodDefinition$4(state) || MethodDefinition$5(state);
|
|
1898
1910
|
}
|
|
1899
1911
|
}
|
|
1912
|
+
var MethodModifier$0 = $S($C($EXPECT($L39, fail, 'MethodModifier "get"'), $EXPECT($L40, fail, 'MethodModifier "set"')), NonIdContinue, $Q(TrailingComment));
|
|
1913
|
+
function MethodModifier(state) {
|
|
1914
|
+
if (state.verbose)
|
|
1915
|
+
console.log("ENTER:", "MethodModifier");
|
|
1916
|
+
if (state.tokenize) {
|
|
1917
|
+
return $TOKEN("MethodModifier", state, MethodModifier$0(state));
|
|
1918
|
+
} else {
|
|
1919
|
+
return MethodModifier$0(state);
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
var MethodSignature$0 = $S($E(MethodModifier), ClassElementName, $Q(_), Parameters);
|
|
1923
|
+
function MethodSignature(state) {
|
|
1924
|
+
if (state.verbose)
|
|
1925
|
+
console.log("ENTER:", "MethodSignature");
|
|
1926
|
+
if (state.tokenize) {
|
|
1927
|
+
return $TOKEN("MethodSignature", state, MethodSignature$0(state));
|
|
1928
|
+
} else {
|
|
1929
|
+
return MethodSignature$0(state);
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1900
1932
|
var ClassElementName$0 = PropertyName;
|
|
1901
1933
|
var ClassElementName$1 = PrivateIdentifier;
|
|
1902
1934
|
function ClassElementName(state) {
|
|
@@ -3311,17 +3343,65 @@ var require_parser = __commonJS({
|
|
|
3311
3343
|
return JSXChildExpression$0(state);
|
|
3312
3344
|
}
|
|
3313
3345
|
}
|
|
3314
|
-
var TypeDeclaration$0 = $T($S($
|
|
3315
|
-
return { "ts": true, "children": value };
|
|
3316
|
-
});
|
|
3317
|
-
var TypeDeclaration$1 = $T($S($EXPECT($R31, fail, "TypeDeclaration /interface(?!\\p{ID_Continue})/"), $Q(TrailingComment), IdentifierName, InterfaceBlock), function(value) {
|
|
3346
|
+
var TypeDeclaration$0 = $T($S($Q($S(TypeDeclarationModifier, $Q(TrailingComment))), TypeDeclarationRest), function(value) {
|
|
3318
3347
|
return { "ts": true, "children": value };
|
|
3319
3348
|
});
|
|
3320
3349
|
function TypeDeclaration(state) {
|
|
3350
|
+
if (state.verbose)
|
|
3351
|
+
console.log("ENTER:", "TypeDeclaration");
|
|
3321
3352
|
if (state.tokenize) {
|
|
3322
|
-
return $TOKEN("TypeDeclaration", state, TypeDeclaration$0(state)
|
|
3353
|
+
return $TOKEN("TypeDeclaration", state, TypeDeclaration$0(state));
|
|
3323
3354
|
} else {
|
|
3324
|
-
return TypeDeclaration$0(state)
|
|
3355
|
+
return TypeDeclaration$0(state);
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
var TypeDeclarationModifier$0 = $S($EXPECT($L128, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
|
|
3359
|
+
var TypeDeclarationModifier$1 = $S($EXPECT($L113, fail, 'TypeDeclarationModifier "export"'), NonIdContinue);
|
|
3360
|
+
function TypeDeclarationModifier(state) {
|
|
3361
|
+
if (state.tokenize) {
|
|
3362
|
+
return $TOKEN("TypeDeclarationModifier", state, TypeDeclarationModifier$0(state) || TypeDeclarationModifier$1(state));
|
|
3363
|
+
} else {
|
|
3364
|
+
return TypeDeclarationModifier$0(state) || TypeDeclarationModifier$1(state);
|
|
3365
|
+
}
|
|
3366
|
+
}
|
|
3367
|
+
var TypeDeclarationRest$0 = $S(TypeKeyword, $Q(TrailingComment), IdentifierName, $E(TypeParameters), __, $EXPECT($L56, fail, 'TypeDeclarationRest "="'), __, Type);
|
|
3368
|
+
var TypeDeclarationRest$1 = $S(Interface, $Q(TrailingComment), IdentifierName, InterfaceBlock);
|
|
3369
|
+
var TypeDeclarationRest$2 = $S(Namespace, $Q(TrailingComment), IdentifierName, NamespaceBlock);
|
|
3370
|
+
function TypeDeclarationRest(state) {
|
|
3371
|
+
if (state.tokenize) {
|
|
3372
|
+
return $TOKEN("TypeDeclarationRest", state, TypeDeclarationRest$0(state) || TypeDeclarationRest$1(state) || TypeDeclarationRest$2(state));
|
|
3373
|
+
} else {
|
|
3374
|
+
return TypeDeclarationRest$0(state) || TypeDeclarationRest$1(state) || TypeDeclarationRest$2(state);
|
|
3375
|
+
}
|
|
3376
|
+
}
|
|
3377
|
+
var TypeKeyword$0 = $S($EXPECT($L129, fail, 'TypeKeyword "type"'), NonIdContinue);
|
|
3378
|
+
function TypeKeyword(state) {
|
|
3379
|
+
if (state.verbose)
|
|
3380
|
+
console.log("ENTER:", "TypeKeyword");
|
|
3381
|
+
if (state.tokenize) {
|
|
3382
|
+
return $TOKEN("TypeKeyword", state, TypeKeyword$0(state));
|
|
3383
|
+
} else {
|
|
3384
|
+
return TypeKeyword$0(state);
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3387
|
+
var Interface$0 = $S($EXPECT($L130, fail, 'Interface "interface"'), NonIdContinue);
|
|
3388
|
+
function Interface(state) {
|
|
3389
|
+
if (state.verbose)
|
|
3390
|
+
console.log("ENTER:", "Interface");
|
|
3391
|
+
if (state.tokenize) {
|
|
3392
|
+
return $TOKEN("Interface", state, Interface$0(state));
|
|
3393
|
+
} else {
|
|
3394
|
+
return Interface$0(state);
|
|
3395
|
+
}
|
|
3396
|
+
}
|
|
3397
|
+
var Namespace$0 = $S($EXPECT($L131, fail, 'Namespace "namespace"'), NonIdContinue);
|
|
3398
|
+
function Namespace(state) {
|
|
3399
|
+
if (state.verbose)
|
|
3400
|
+
console.log("ENTER:", "Namespace");
|
|
3401
|
+
if (state.tokenize) {
|
|
3402
|
+
return $TOKEN("Namespace", state, Namespace$0(state));
|
|
3403
|
+
} else {
|
|
3404
|
+
return Namespace$0(state);
|
|
3325
3405
|
}
|
|
3326
3406
|
}
|
|
3327
3407
|
var InterfaceBlock$0 = $S(__, $EXPECT($L12, fail, 'InterfaceBlock "{"'), EOS, NestedInterfaceProperties, __, $EXPECT($L13, fail, 'InterfaceBlock "}"'));
|
|
@@ -3360,13 +3440,12 @@ var require_parser = __commonJS({
|
|
|
3360
3440
|
}
|
|
3361
3441
|
}
|
|
3362
3442
|
var InterfaceProperty$0 = $S($C(TypeIndexSignature, PropertyName), TypeSuffix, InterfacePropertyDelimiter);
|
|
3443
|
+
var InterfaceProperty$1 = $S(MethodSignature, $E(TypeSuffix));
|
|
3363
3444
|
function InterfaceProperty(state) {
|
|
3364
|
-
if (state.verbose)
|
|
3365
|
-
console.log("ENTER:", "InterfaceProperty");
|
|
3366
3445
|
if (state.tokenize) {
|
|
3367
|
-
return $TOKEN("InterfaceProperty", state, InterfaceProperty$0(state));
|
|
3446
|
+
return $TOKEN("InterfaceProperty", state, InterfaceProperty$0(state) || InterfaceProperty$1(state));
|
|
3368
3447
|
} else {
|
|
3369
|
-
return InterfaceProperty$0(state);
|
|
3448
|
+
return InterfaceProperty$0(state) || InterfaceProperty$1(state);
|
|
3370
3449
|
}
|
|
3371
3450
|
}
|
|
3372
3451
|
var InterfacePropertyDelimiter$0 = $S($Q(_), $EXPECT($L88, fail, 'InterfacePropertyDelimiter ";"'));
|
|
@@ -3384,7 +3463,42 @@ var require_parser = __commonJS({
|
|
|
3384
3463
|
return InterfacePropertyDelimiter$0(state) || InterfacePropertyDelimiter$1(state) || InterfacePropertyDelimiter$2(state) || InterfacePropertyDelimiter$3(state);
|
|
3385
3464
|
}
|
|
3386
3465
|
}
|
|
3387
|
-
var
|
|
3466
|
+
var NamespaceBlock$0 = $S(__, $EXPECT($L12, fail, 'NamespaceBlock "{"'), EOS, NestedTypeDeclarations, __, $EXPECT($L13, fail, 'NamespaceBlock "}"'));
|
|
3467
|
+
var NamespaceBlock$1 = $S(__, $EXPECT($L12, fail, 'NamespaceBlock "{"'), $Q($S(__, TypeDeclaration, InterfacePropertyDelimiter)), __, $EXPECT($L13, fail, 'NamespaceBlock "}"'));
|
|
3468
|
+
var NamespaceBlock$2 = $S(InsertOpenBrace, EOS, NestedTypeDeclarations, InsertNewline, InsertIndent, InsertCloseBrace);
|
|
3469
|
+
function NamespaceBlock(state) {
|
|
3470
|
+
if (state.tokenize) {
|
|
3471
|
+
return $TOKEN("NamespaceBlock", state, NamespaceBlock$0(state) || NamespaceBlock$1(state) || NamespaceBlock$2(state));
|
|
3472
|
+
} else {
|
|
3473
|
+
return NamespaceBlock$0(state) || NamespaceBlock$1(state) || NamespaceBlock$2(state);
|
|
3474
|
+
}
|
|
3475
|
+
}
|
|
3476
|
+
var NestedTypeDeclarations$0 = $TS($S(PushIndent, $Q(NestedTypeDeclaration), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
3477
|
+
var decs = $2;
|
|
3478
|
+
if (decs.length)
|
|
3479
|
+
return decs;
|
|
3480
|
+
return $skip;
|
|
3481
|
+
});
|
|
3482
|
+
function NestedTypeDeclarations(state) {
|
|
3483
|
+
if (state.verbose)
|
|
3484
|
+
console.log("ENTER:", "NestedTypeDeclarations");
|
|
3485
|
+
if (state.tokenize) {
|
|
3486
|
+
return $TOKEN("NestedTypeDeclarations", state, NestedTypeDeclarations$0(state));
|
|
3487
|
+
} else {
|
|
3488
|
+
return NestedTypeDeclarations$0(state);
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
var NestedTypeDeclaration$0 = $S(Nested, TypeDeclaration, InterfacePropertyDelimiter);
|
|
3492
|
+
function NestedTypeDeclaration(state) {
|
|
3493
|
+
if (state.verbose)
|
|
3494
|
+
console.log("ENTER:", "NestedTypeDeclaration");
|
|
3495
|
+
if (state.tokenize) {
|
|
3496
|
+
return $TOKEN("NestedTypeDeclaration", state, NestedTypeDeclaration$0(state));
|
|
3497
|
+
} else {
|
|
3498
|
+
return NestedTypeDeclaration$0(state);
|
|
3499
|
+
}
|
|
3500
|
+
}
|
|
3501
|
+
var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R30, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L132, fail, 'TypeIndexSignature "readonly"'), __)), $EXPECT($L26, fail, 'TypeIndexSignature "["'), TypeIndex, $EXPECT($L27, fail, 'TypeIndexSignature "]"'), $E($S(__, $R$0($EXPECT($R31, fail, "TypeIndexSignature /[+-]/")), $EXPECT($L3, fail, 'TypeIndexSignature "?"'))));
|
|
3388
3502
|
function TypeIndexSignature(state) {
|
|
3389
3503
|
if (state.verbose)
|
|
3390
3504
|
console.log("ENTER:", "TypeIndexSignature");
|
|
@@ -3415,7 +3529,7 @@ var require_parser = __commonJS({
|
|
|
3415
3529
|
return TypeSuffix$0(state);
|
|
3416
3530
|
}
|
|
3417
3531
|
}
|
|
3418
|
-
var ReturnTypeSuffix$0 = $T($S(__, $EXPECT($L14, fail, 'ReturnTypeSuffix ":"'), $E($S(__, $EXPECT($
|
|
3532
|
+
var ReturnTypeSuffix$0 = $T($S(__, $EXPECT($L14, fail, 'ReturnTypeSuffix ":"'), $E($S(__, $EXPECT($L133, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function(value) {
|
|
3419
3533
|
return { "ts": true, "children": value };
|
|
3420
3534
|
});
|
|
3421
3535
|
function ReturnTypeSuffix(state) {
|
|
@@ -3477,9 +3591,9 @@ var require_parser = __commonJS({
|
|
|
3477
3591
|
return TypeUnarySuffix$0(state);
|
|
3478
3592
|
}
|
|
3479
3593
|
}
|
|
3480
|
-
var TypeUnaryOp$0 = $EXPECT($
|
|
3594
|
+
var TypeUnaryOp$0 = $EXPECT($L134, fail, 'TypeUnaryOp "keyof"');
|
|
3481
3595
|
var TypeUnaryOp$1 = $EXPECT($L85, fail, 'TypeUnaryOp "typeof"');
|
|
3482
|
-
var TypeUnaryOp$2 = $EXPECT($
|
|
3596
|
+
var TypeUnaryOp$2 = $EXPECT($L135, fail, 'TypeUnaryOp "infer"');
|
|
3483
3597
|
function TypeUnaryOp(state) {
|
|
3484
3598
|
if (state.tokenize) {
|
|
3485
3599
|
return $TOKEN("TypeUnaryOp", state, TypeUnaryOp$0(state) || TypeUnaryOp$1(state) || TypeUnaryOp$2(state));
|
|
@@ -3521,7 +3635,7 @@ var require_parser = __commonJS({
|
|
|
3521
3635
|
}
|
|
3522
3636
|
var TypeLiteral$0 = Literal;
|
|
3523
3637
|
var TypeLiteral$1 = $EXPECT($L84, fail, 'TypeLiteral "void"');
|
|
3524
|
-
var TypeLiteral$2 = $EXPECT($
|
|
3638
|
+
var TypeLiteral$2 = $EXPECT($L136, fail, 'TypeLiteral "[]"');
|
|
3525
3639
|
function TypeLiteral(state) {
|
|
3526
3640
|
if (state.tokenize) {
|
|
3527
3641
|
return $TOKEN("TypeLiteral", state, TypeLiteral$0(state) || TypeLiteral$1(state) || TypeLiteral$2(state));
|
|
@@ -3603,7 +3717,7 @@ var require_parser = __commonJS({
|
|
|
3603
3717
|
return TypeParameterDelimiter$0(state) || TypeParameterDelimiter$1(state) || TypeParameterDelimiter$2(state) || TypeParameterDelimiter$3(state);
|
|
3604
3718
|
}
|
|
3605
3719
|
}
|
|
3606
|
-
var Shebang$0 = $R$0($EXPECT($
|
|
3720
|
+
var Shebang$0 = $R$0($EXPECT($R32, fail, "Shebang /#![^\\r\\n]*/"));
|
|
3607
3721
|
function Shebang(state) {
|
|
3608
3722
|
if (state.verbose)
|
|
3609
3723
|
console.log("ENTER:", "Shebang");
|
|
@@ -3613,7 +3727,7 @@ var require_parser = __commonJS({
|
|
|
3613
3727
|
return Shebang$0(state);
|
|
3614
3728
|
}
|
|
3615
3729
|
}
|
|
3616
|
-
var DirectivePrologue$0 = $TV($Q($S($TEXT($EXPECT($
|
|
3730
|
+
var DirectivePrologue$0 = $TV($Q($S($TEXT($EXPECT($R33, fail, "DirectivePrologue /[\\t ]*/")), $TEXT(StringLiteral), $TEXT(StatementDelimiter), $TEXT(EOS))), function($skip, $loc, $0, $1) {
|
|
3617
3731
|
return $0.map((p) => p.join(""));
|
|
3618
3732
|
});
|
|
3619
3733
|
function DirectivePrologue(state) {
|
|
@@ -3635,7 +3749,7 @@ var require_parser = __commonJS({
|
|
|
3635
3749
|
return EOS$0(state);
|
|
3636
3750
|
}
|
|
3637
3751
|
}
|
|
3638
|
-
var EOL$0 = $R$0($EXPECT($
|
|
3752
|
+
var EOL$0 = $R$0($EXPECT($R34, fail, "EOL /\\r\\n|\\n|\\r|$/"));
|
|
3639
3753
|
function EOL(state) {
|
|
3640
3754
|
if (state.verbose)
|
|
3641
3755
|
console.log("ENTER:", "EOL");
|
|
@@ -3645,7 +3759,7 @@ var require_parser = __commonJS({
|
|
|
3645
3759
|
return EOL$0(state);
|
|
3646
3760
|
}
|
|
3647
3761
|
}
|
|
3648
|
-
var EOF$0 = $R$0($EXPECT($
|
|
3762
|
+
var EOF$0 = $R$0($EXPECT($R35, fail, "EOF /$/"));
|
|
3649
3763
|
function EOF(state) {
|
|
3650
3764
|
if (state.verbose)
|
|
3651
3765
|
console.log("ENTER:", "EOF");
|
|
@@ -3803,7 +3917,7 @@ var require_parser = __commonJS({
|
|
|
3803
3917
|
return Init$0(state);
|
|
3804
3918
|
}
|
|
3805
3919
|
}
|
|
3806
|
-
var Indent$0 = $TV($Q($C($EXPECT($
|
|
3920
|
+
var Indent$0 = $TV($Q($C($EXPECT($L137, fail, 'Indent " "'), $EXPECT($L138, fail, 'Indent "\\\\t"'))), function($skip, $loc, $0, $1) {
|
|
3807
3921
|
return $1.length;
|
|
3808
3922
|
});
|
|
3809
3923
|
function Indent(state) {
|