@mojir/lits 2.5.2 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/cli/cli.js +726 -481
- package/dist/cli/reference/api.d.ts +9 -7
- package/dist/cli/reference/index.d.ts +133 -132
- package/dist/cli/src/builtin/bindingNode.d.ts +5 -0
- package/dist/cli/src/builtin/core/assertion.d.ts +2 -0
- package/dist/cli/src/builtin/index.d.ts +2 -2
- package/dist/cli/src/builtin/interface.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressionTypes.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/match.d.ts +7 -0
- package/dist/cli/src/parser/subParsers/parseBindingTarget.d.ts +4 -2
- package/dist/cli/src/parser/subParsers/parseMatch.d.ts +4 -0
- package/dist/cli/src/parser/types.d.ts +5 -1
- package/dist/full.esm.js +1 -1
- package/dist/full.esm.js.map +1 -1
- package/dist/full.js +1 -1
- package/dist/full.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +1 -1
- package/dist/lits.iife.js.map +1 -1
- package/dist/modules/assertion.esm.js +2 -0
- package/dist/modules/assertion.esm.js.map +1 -0
- package/dist/modules/assertion.js +2 -0
- package/dist/modules/assertion.js.map +1 -0
- package/dist/modules/reference/api.d.ts +9 -7
- package/dist/modules/reference/index.d.ts +133 -132
- package/dist/modules/src/builtin/bindingNode.d.ts +5 -0
- package/dist/modules/src/builtin/core/assertion.d.ts +2 -0
- package/dist/modules/src/builtin/index.d.ts +2 -2
- package/dist/modules/src/builtin/interface.d.ts +1 -1
- package/dist/modules/src/builtin/specialExpressionTypes.d.ts +1 -1
- package/dist/modules/src/builtin/specialExpressions/match.d.ts +7 -0
- package/dist/modules/src/full.d.ts +1 -1
- package/dist/modules/src/modules/{assert.d.ts → assertion.d.ts} +1 -1
- package/dist/modules/src/parser/subParsers/parseBindingTarget.d.ts +4 -2
- package/dist/modules/src/parser/subParsers/parseMatch.d.ts +4 -0
- package/dist/modules/src/parser/types.d.ts +5 -1
- package/dist/reference/api.d.ts +9 -7
- package/dist/reference/index.d.ts +133 -132
- package/dist/src/builtin/bindingNode.d.ts +5 -0
- package/dist/src/builtin/core/assertion.d.ts +2 -0
- package/dist/src/builtin/index.d.ts +2 -2
- package/dist/src/builtin/interface.d.ts +1 -1
- package/dist/src/builtin/specialExpressionTypes.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/match.d.ts +7 -0
- package/dist/src/full.d.ts +1 -1
- package/dist/src/modules/{assert.d.ts → assertion.d.ts} +1 -1
- package/dist/src/parser/subParsers/parseBindingTarget.d.ts +4 -2
- package/dist/src/parser/subParsers/parseMatch.d.ts +4 -0
- package/dist/src/parser/types.d.ts +5 -1
- package/dist/testFramework.esm.js +1 -1
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +1 -1
- package/dist/testFramework.js.map +1 -1
- package/package.json +5 -5
- package/dist/cli/src/builtin/specialExpressions/switch.d.ts +0 -6
- package/dist/cli/src/parser/subParsers/parseSwitch.d.ts +0 -4
- package/dist/modules/assert.esm.js +0 -2
- package/dist/modules/assert.esm.js.map +0 -1
- package/dist/modules/assert.js +0 -2
- package/dist/modules/assert.js.map +0 -1
- package/dist/modules/src/builtin/specialExpressions/switch.d.ts +0 -6
- package/dist/modules/src/parser/subParsers/parseSwitch.d.ts +0 -4
- package/dist/src/builtin/specialExpressions/switch.d.ts +0 -6
- package/dist/src/parser/subParsers/parseSwitch.d.ts +0 -4
- /package/dist/cli/src/builtin/modules/{assert → assertion}/docs.d.ts +0 -0
- /package/dist/cli/src/builtin/modules/{assert → assertion}/index.d.ts +0 -0
- /package/dist/modules/src/builtin/modules/{assert → assertion}/docs.d.ts +0 -0
- /package/dist/modules/src/builtin/modules/{assert → assertion}/index.d.ts +0 -0
- /package/dist/src/builtin/modules/{assert → assertion}/docs.d.ts +0 -0
- /package/dist/src/builtin/modules/{assert → assertion}/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -631,26 +631,26 @@ end;
|
|
|
631
631
|
// => "high"
|
|
632
632
|
```
|
|
633
633
|
|
|
634
|
-
####
|
|
634
|
+
#### Match
|
|
635
635
|
|
|
636
636
|
```lits
|
|
637
637
|
let x = 1;
|
|
638
638
|
|
|
639
|
-
//
|
|
640
|
-
|
|
639
|
+
// Match on value
|
|
640
|
+
match x
|
|
641
641
|
case 0 then "zero"
|
|
642
642
|
case 1 then "one"
|
|
643
643
|
case 2 then "two"
|
|
644
644
|
end;
|
|
645
645
|
// => "one"
|
|
646
646
|
|
|
647
|
-
//
|
|
647
|
+
// Match with multiple cases
|
|
648
648
|
let userInput = "help";
|
|
649
649
|
let exit = () -> "exiting";
|
|
650
650
|
let showHelp = () -> "showing help";
|
|
651
651
|
let saveData = () -> "saving data";
|
|
652
652
|
|
|
653
|
-
|
|
653
|
+
match userInput
|
|
654
654
|
case "quit" then exit()
|
|
655
655
|
case "help" then showHelp()
|
|
656
656
|
case "save" then saveData()
|
|
@@ -1514,7 +1514,7 @@ import { matrixModule } from '@mojir/lits/modules/matrix';
|
|
|
1514
1514
|
import { linearAlgebraModule } from '@mojir/lits/modules/linearAlgebra';
|
|
1515
1515
|
import { gridModule } from '@mojir/lits/modules/grid';
|
|
1516
1516
|
import { randomModule } from '@mojir/lits/modules/random';
|
|
1517
|
-
import { assertModule } from '@mojir/lits/modules/
|
|
1517
|
+
import { assertModule } from '@mojir/lits/modules/assertion';
|
|
1518
1518
|
import { numberTheoryModule } from '@mojir/lits/modules/numberTheory';
|
|
1519
1519
|
```
|
|
1520
1520
|
|