@mojir/lits 2.1.34 → 2.1.35
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 +108 -99
- package/dist/cli/cli.js +69 -69
- package/dist/index.esm.js +68 -68
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +68 -68
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +68 -68
- package/dist/lits.iife.js.map +1 -1
- package/dist/testFramework.esm.js +68 -68
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +68 -68
- package/dist/testFramework.js.map +1 -1
- package/package.json +1 -1
|
@@ -14596,8 +14596,7 @@ var Parser = /** @class */ (function () {
|
|
|
14596
14596
|
};
|
|
14597
14597
|
Parser.prototype.parseTry = function (token) {
|
|
14598
14598
|
this.advance();
|
|
14599
|
-
var tryExpression = this.
|
|
14600
|
-
assertReservedSymbolToken(this.peek(), 'catch');
|
|
14599
|
+
var tryExpression = this.parseImplicitBlock(['catch']);
|
|
14601
14600
|
this.advance();
|
|
14602
14601
|
var errorSymbol;
|
|
14603
14602
|
if (isLParenToken(this.peek())) {
|
|
@@ -14606,7 +14605,8 @@ var Parser = /** @class */ (function () {
|
|
|
14606
14605
|
assertRParenToken(this.peek());
|
|
14607
14606
|
this.advance();
|
|
14608
14607
|
}
|
|
14609
|
-
var catchExpression = this.
|
|
14608
|
+
var catchExpression = this.parseImplicitBlock(['end']);
|
|
14609
|
+
this.advance();
|
|
14610
14610
|
return withSourceCodeInfo([NodeTypes.SpecialExpression, [specialExpressionTypes.try, tryExpression, errorSymbol, catchExpression]], token[2]);
|
|
14611
14611
|
};
|
|
14612
14612
|
Parser.prototype.parseForOrDoseq = function (firstToken) {
|
|
@@ -15711,7 +15711,7 @@ var assertReference = {
|
|
|
15711
15711
|
{ argumentNames: ['value', 'message'] },
|
|
15712
15712
|
],
|
|
15713
15713
|
description: 'If $value is falsy it throws `AssertionError` with $message. If no $message is provided, message is set to $value.',
|
|
15714
|
-
examples: ['try
|
|
15714
|
+
examples: ['try assert(0, "Expected a positive value") catch (e) e.message end'],
|
|
15715
15715
|
noOperatorDocumentation: true,
|
|
15716
15716
|
},
|
|
15717
15717
|
'assert!=': {
|
|
@@ -15729,10 +15729,10 @@ var assertReference = {
|
|
|
15729
15729
|
],
|
|
15730
15730
|
description: 'If $a is the same as $b it throws `AssertionError`.',
|
|
15731
15731
|
examples: [
|
|
15732
|
-
'try
|
|
15733
|
-
'try
|
|
15734
|
-
'try
|
|
15735
|
-
'try
|
|
15732
|
+
'try assert!=(0, 0, "Expected different values") catch (e) e.message end',
|
|
15733
|
+
'try assert!=(0, 0) catch (e) e.message end',
|
|
15734
|
+
'try 0 assert!= 0 catch (e) e.message end',
|
|
15735
|
+
'try assert!=(0, 1) catch (e) e.message end',
|
|
15736
15736
|
],
|
|
15737
15737
|
noOperatorDocumentation: true,
|
|
15738
15738
|
},
|
|
@@ -15751,9 +15751,9 @@ var assertReference = {
|
|
|
15751
15751
|
],
|
|
15752
15752
|
description: 'If $a is not structural equal to $b it throws `AssertionError`.',
|
|
15753
15753
|
examples: [
|
|
15754
|
-
'try
|
|
15755
|
-
'try
|
|
15756
|
-
'try
|
|
15754
|
+
'try assert=({ "a": 1 }, { "a": 2 }, "Expected equal values") catch (e) e.message end',
|
|
15755
|
+
'try assert=({ "a": 1 }, { "a": 2 }) catch (e) e.message end',
|
|
15756
|
+
'try assert=({ "a": 1 }, { "a": 1 }) catch (e) e.message end',
|
|
15757
15757
|
],
|
|
15758
15758
|
noOperatorDocumentation: true,
|
|
15759
15759
|
},
|
|
@@ -15772,9 +15772,9 @@ var assertReference = {
|
|
|
15772
15772
|
],
|
|
15773
15773
|
description: 'If $a is not greater than $b it throws `AssertionError`.',
|
|
15774
15774
|
examples: [
|
|
15775
|
-
'try
|
|
15776
|
-
'try
|
|
15777
|
-
'try
|
|
15775
|
+
'try assert-gt(0, 1, "Expected greater value") catch (e) e.message end',
|
|
15776
|
+
'try assert-gt(0, 0) catch (e) e.message end',
|
|
15777
|
+
'try assert-gt(1, 0) catch (e) e.message end',
|
|
15778
15778
|
],
|
|
15779
15779
|
noOperatorDocumentation: true,
|
|
15780
15780
|
},
|
|
@@ -15793,9 +15793,9 @@ var assertReference = {
|
|
|
15793
15793
|
],
|
|
15794
15794
|
description: 'If $a is not less than $b it throws `AssertionError`.',
|
|
15795
15795
|
examples: [
|
|
15796
|
-
'try
|
|
15797
|
-
'try
|
|
15798
|
-
'try
|
|
15796
|
+
'try assert-lte(1, 0, "Expected smaller value value") catch (e) e.message end',
|
|
15797
|
+
'try assert-lte(1, 1) catch (e) e.message end',
|
|
15798
|
+
'try assert-lte(0, 1) catch (e) e.message end',
|
|
15799
15799
|
],
|
|
15800
15800
|
noOperatorDocumentation: true,
|
|
15801
15801
|
},
|
|
@@ -15814,9 +15814,9 @@ var assertReference = {
|
|
|
15814
15814
|
],
|
|
15815
15815
|
description: 'If $a is less than $b it throws `AssertionError`.',
|
|
15816
15816
|
examples: [
|
|
15817
|
-
'try
|
|
15818
|
-
'try
|
|
15819
|
-
'try
|
|
15817
|
+
'try assert-gte(0, 1, "Expected greater value") catch (e) e.message end',
|
|
15818
|
+
'try assert-gte(0, 1) catch (e) e.message end',
|
|
15819
|
+
'try assert-gte(1, 1) catch (e) e.message end',
|
|
15820
15820
|
],
|
|
15821
15821
|
noOperatorDocumentation: true,
|
|
15822
15822
|
},
|
|
@@ -15835,9 +15835,9 @@ var assertReference = {
|
|
|
15835
15835
|
],
|
|
15836
15836
|
description: 'If $a is grater than $b it throws `AssertionError`.',
|
|
15837
15837
|
examples: [
|
|
15838
|
-
'try
|
|
15839
|
-
'try
|
|
15840
|
-
'try
|
|
15838
|
+
'try assert-lte(1, 0, "Expected smaller value value") catch (e) e.message end',
|
|
15839
|
+
'try assert-lte(1, 0) catch (e) e.message end',
|
|
15840
|
+
'try assert-lte(1, 1) catch (e) e.message end',
|
|
15841
15841
|
],
|
|
15842
15842
|
noOperatorDocumentation: true,
|
|
15843
15843
|
},
|
|
@@ -15861,9 +15861,9 @@ var assertReference = {
|
|
|
15861
15861
|
],
|
|
15862
15862
|
description: 'If $value is not `true` it throws `AssertionError`.',
|
|
15863
15863
|
examples: [
|
|
15864
|
-
'try
|
|
15865
|
-
'try
|
|
15866
|
-
'try
|
|
15864
|
+
'try assert-true(false, "Expected true") catch (e) e.message end',
|
|
15865
|
+
'try assert-true(false) catch (e) e.message end',
|
|
15866
|
+
'try assert-true(true) catch (e) e.message end',
|
|
15867
15867
|
],
|
|
15868
15868
|
noOperatorDocumentation: true,
|
|
15869
15869
|
},
|
|
@@ -15887,9 +15887,9 @@ var assertReference = {
|
|
|
15887
15887
|
],
|
|
15888
15888
|
description: 'If $value is not `false` it throws `AssertionError`.',
|
|
15889
15889
|
examples: [
|
|
15890
|
-
'try
|
|
15891
|
-
'try
|
|
15892
|
-
'try
|
|
15890
|
+
'try assert-false(true, "Expected false") catch (e) e.message end',
|
|
15891
|
+
'try assert-false(true) catch (e) e.message end',
|
|
15892
|
+
'try assert-false(false) catch (e) e.message end',
|
|
15893
15893
|
],
|
|
15894
15894
|
noOperatorDocumentation: true,
|
|
15895
15895
|
},
|
|
@@ -15913,16 +15913,16 @@ var assertReference = {
|
|
|
15913
15913
|
],
|
|
15914
15914
|
description: 'If $value is not `truthy` it throws `AssertionError`.',
|
|
15915
15915
|
examples: [
|
|
15916
|
-
'try
|
|
15917
|
-
'try
|
|
15918
|
-
'try
|
|
15919
|
-
'try
|
|
15920
|
-
'try
|
|
15921
|
-
'try
|
|
15922
|
-
'try
|
|
15923
|
-
'try
|
|
15924
|
-
'try
|
|
15925
|
-
'try
|
|
15916
|
+
'try assert-truthy(false, "Expected truthy") catch (e) e.message end',
|
|
15917
|
+
'try assert-truthy(false) catch (e) e.message end',
|
|
15918
|
+
'try assert-truthy(0) catch (e) e.message end',
|
|
15919
|
+
'try assert-truthy(null) catch (e) e.message end',
|
|
15920
|
+
'try assert-truthy("") catch (e) e.message end',
|
|
15921
|
+
'try assert-truthy(true) catch (e) e.message end',
|
|
15922
|
+
'try assert-truthy(1) catch (e) e.message end',
|
|
15923
|
+
'try assert-truthy("x") catch (e) e.message end',
|
|
15924
|
+
'try assert-truthy([]) catch (e) e.message end',
|
|
15925
|
+
'try assert-truthy(nd) catch (e) e.message end',
|
|
15926
15926
|
],
|
|
15927
15927
|
noOperatorDocumentation: true,
|
|
15928
15928
|
},
|
|
@@ -15946,15 +15946,15 @@ var assertReference = {
|
|
|
15946
15946
|
],
|
|
15947
15947
|
description: 'If $value is not `falsy` it throws `AssertionError`.',
|
|
15948
15948
|
examples: [
|
|
15949
|
-
'try
|
|
15950
|
-
'try
|
|
15951
|
-
'try
|
|
15952
|
-
'try
|
|
15953
|
-
'try
|
|
15954
|
-
'try
|
|
15955
|
-
'try
|
|
15956
|
-
'try
|
|
15957
|
-
'try
|
|
15949
|
+
'try assert-falsy(true, "Expected falsy") catch (e) e.message end',
|
|
15950
|
+
'try assert-falsy("x") catch (e) e.message end',
|
|
15951
|
+
'try assert-falsy([]) catch (e) e.message end',
|
|
15952
|
+
'try assert-falsy(nd) catch (e) e.message end',
|
|
15953
|
+
'try assert-falsy(1) catch (e) e.message end',
|
|
15954
|
+
'try assert-falsy(false) catch (e) e.message end',
|
|
15955
|
+
'try assert-falsy(0) catch (e) e.message end',
|
|
15956
|
+
'try assert-falsy(null) catch (e) e.message end',
|
|
15957
|
+
'try assert-falsy("") catch (e) e.message end',
|
|
15958
15958
|
],
|
|
15959
15959
|
noOperatorDocumentation: true,
|
|
15960
15960
|
},
|
|
@@ -15978,15 +15978,15 @@ var assertReference = {
|
|
|
15978
15978
|
],
|
|
15979
15979
|
description: 'If $value is not `null` it throws `AssertionError`.',
|
|
15980
15980
|
examples: [
|
|
15981
|
-
'try
|
|
15982
|
-
'try
|
|
15983
|
-
'try
|
|
15984
|
-
'try
|
|
15985
|
-
'try
|
|
15986
|
-
'try
|
|
15987
|
-
'try
|
|
15988
|
-
'try
|
|
15989
|
-
'try
|
|
15981
|
+
'try assert-null(null) catch (e) e.message end',
|
|
15982
|
+
'try assert-null(true, "Expected null") catch (e) e.message end',
|
|
15983
|
+
'try assert-null("x") catch (e) e.message end',
|
|
15984
|
+
'try assert-null([]) catch (e) e.message end',
|
|
15985
|
+
'try assert-null(nd) catch (e) e.message end',
|
|
15986
|
+
'try assert-null(1) catch (e) e.message end',
|
|
15987
|
+
'try assert-null(false) catch (e) e.message end',
|
|
15988
|
+
'try assert-null(0) catch (e) e.message end',
|
|
15989
|
+
'try assert-null("") catch (e) e.message end',
|
|
15990
15990
|
],
|
|
15991
15991
|
noOperatorDocumentation: true,
|
|
15992
15992
|
},
|
|
@@ -16011,7 +16011,7 @@ var assertReference = {
|
|
|
16011
16011
|
description: 'If $fun does not throw, it throws `AssertionError`.',
|
|
16012
16012
|
examples: [
|
|
16013
16013
|
'assert-throws(-> throw("Error"))',
|
|
16014
|
-
'try
|
|
16014
|
+
'try assert-throws(-> identity("Error")) catch (e) e.message end',
|
|
16015
16015
|
],
|
|
16016
16016
|
noOperatorDocumentation: true,
|
|
16017
16017
|
},
|
|
@@ -16038,8 +16038,8 @@ var assertReference = {
|
|
|
16038
16038
|
],
|
|
16039
16039
|
description: 'If $fun does not throw $error-message, it throws `AssertionError`.',
|
|
16040
16040
|
examples: [
|
|
16041
|
-
'try
|
|
16042
|
-
'try
|
|
16041
|
+
'try assert-throws-error(-> throw("Error"), "Error") catch (e) e.message end',
|
|
16042
|
+
'try assert-throws-error(-> identity("Error"), "Error") catch (e) e.message end',
|
|
16043
16043
|
],
|
|
16044
16044
|
noOperatorDocumentation: true,
|
|
16045
16045
|
},
|
|
@@ -16063,8 +16063,8 @@ var assertReference = {
|
|
|
16063
16063
|
],
|
|
16064
16064
|
description: 'If $fun throws, it throws `AssertionError`.',
|
|
16065
16065
|
examples: [
|
|
16066
|
-
'try
|
|
16067
|
-
'try
|
|
16066
|
+
'try assert-not-throws(-> identity("Error")) catch (e) e.message end',
|
|
16067
|
+
'try assert-not-throws(-> throw("Error")) catch (e) e.message end',
|
|
16068
16068
|
],
|
|
16069
16069
|
noOperatorDocumentation: true,
|
|
16070
16070
|
},
|
|
@@ -26755,9 +26755,9 @@ var specialExpressionsReference = {
|
|
|
26755
26755
|
],
|
|
26756
26756
|
description: 'Executes `try-body`. If that throws, the `catch-body` gets executed. See examples for details.',
|
|
26757
26757
|
examples: [
|
|
26758
|
-
"\ntry
|
|
26759
|
-
"\ntry
|
|
26760
|
-
"\ntry
|
|
26758
|
+
"\ntry\n 2 / 4\ncatch\n \"Oops!\"\nend",
|
|
26759
|
+
"\ntry\n foo()\ncatch(error)\n \"Error: \" ++ error.message\nend",
|
|
26760
|
+
"\ntry\n foo()\ncatch\n 42\nend",
|
|
26761
26761
|
],
|
|
26762
26762
|
},
|
|
26763
26763
|
'throw': {
|
|
@@ -26776,8 +26776,8 @@ var specialExpressionsReference = {
|
|
|
26776
26776
|
],
|
|
26777
26777
|
description: 'Throws `UserDefinedError` with message set to $expr evaluated. $expr must evaluate to a string.',
|
|
26778
26778
|
examples: [
|
|
26779
|
-
'try
|
|
26780
|
-
'try
|
|
26779
|
+
'try throw("You shall not pass!") catch(error) "Error: " ++ error.message end',
|
|
26780
|
+
'try throw(slice("You shall not pass!", 0, 3)) catch(error) "Error: " ++ error.message end',
|
|
26781
26781
|
],
|
|
26782
26782
|
},
|
|
26783
26783
|
'if': {
|
|
@@ -30923,7 +30923,7 @@ var datatype = {
|
|
|
30923
30923
|
title: 'never',
|
|
30924
30924
|
category: 'Datatype',
|
|
30925
30925
|
description: 'A value that can never be created',
|
|
30926
|
-
examples: ["\n// throw(\"error\") will never return a value\ntry
|
|
30926
|
+
examples: ["\n// throw(\"error\") will never return a value\ntry throw(\"error\") catch \"never\" end",
|
|
30927
30927
|
],
|
|
30928
30928
|
},
|
|
30929
30929
|
};
|