@plylang/plylang 1.0.1 → 1.0.3
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 +5 -3
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -39,11 +39,11 @@ Five built-in types and two constructors of arity 1 are visible in every module.
|
|
|
39
39
|
| `Int` | `0n`, `42n`, `-42n` | `bigint` |
|
|
40
40
|
| `Str` | `"hi"`, `"a\nb"` | string |
|
|
41
41
|
| `Bool` | `true`, `false` | boolean |
|
|
42
|
-
| `
|
|
42
|
+
| `Unit` | the word `Unit` | `undefined` |
|
|
43
43
|
|
|
44
44
|
`(Array a)` is an array. `(StrMap a)` is a dictionary with a string key. Bare digits are `Num`, an ordinary number in JavaScript. `Int` is written with the suffix `n` and becomes a `bigint`. In the examples below a number is `Num`. `1.0` is a number. `1.` is the number `1` and a separate dot. A string accepts `\\`, `\"`, `\n`, `\t`, and `\r`.
|
|
45
45
|
|
|
46
|
-
`
|
|
46
|
+
`Unit` is both a type and a word. The word puts the single value of that type.
|
|
47
47
|
|
|
48
48
|
Operations on these values are imported. This text does not list them.
|
|
49
49
|
|
|
@@ -287,7 +287,7 @@ The order in the example is the dictionary, the key, and the value on top.
|
|
|
287
287
|
|
|
288
288
|
The instance for numbers is declared in the `Num` module. `()` brings the instances of that module and brings no names. The empty import of `Num` gives `same` that instance.
|
|
289
289
|
|
|
290
|
-
A hand-written instance is a word for each method. A module may write one when it defines the class, the type, or the wrapper in the head, or when the head contains a built-in constructor `Int`, `Num`, `Bool`, `Str`, `
|
|
290
|
+
A hand-written instance is a word for each method. A module may write one when it defines the class, the type, or the wrapper in the head, or when the head contains a built-in constructor `Int`, `Num`, `Bool`, `Str`, `Unit`, `Array`, or `StrMap`.
|
|
291
291
|
|
|
292
292
|
```ply
|
|
293
293
|
& Equal a
|
|
@@ -366,6 +366,8 @@ plylang check --js <file>
|
|
|
366
366
|
|
|
367
367
|
`plylang check` checks a package the same way `build` does: every file under `ply.source`, the imports, and `foreign`. It writes no files. The default directory is the current one. After the same check, `plylang build` writes a `.js` file and a `.d.ply` interface into `ply.out`. `plylang build --exports` replaces the `exports` field of `package.json` with entries for the built modules. A key is `./` followed by the module path. `ply` points at the `.d.ply`, and `import` points at the `.js`. The other fields of the file stay as they were. With this flag an import of the package's own module succeeds even when that entry was not there yet. Without the flag the entry must already be present in `exports`.
|
|
368
368
|
|
|
369
|
+
A word named `main` whose scheme is `( -- Unit )` is the program of that module. It may be `private`. `build` calls it at the bottom of that module's `.js`, and only when Node started that file. `node dist/App.js` runs the program. An import of the module does not. A `package.json` script can name that file. Several modules may each have a `main`. A module without one is a library. Any other scheme on the name `main` is an error.
|
|
370
|
+
|
|
369
371
|
`plylang docs` writes `DOCS.md` at the package root. `--out` names another file. A module heading is the string used to import it: the package name and the path, or only the path when there is no name. The prose comes from `..`. Inside a module the sections are `Types`, `Classes`, `Instances`, and `Words`. An empty section is left out. The name of a type, a class, or a word is a heading under its section. `Instances` is a list of `#` heads, with no comment and no method bindings.
|
|
370
372
|
|
|
371
373
|
`plylang check --parse` prints how one file was parsed, and it does not check types. `plylang check --js` prints the JavaScript that `build` would write for that file. Outside a package that is the JavaScript of the one file, and imports are not resolved.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plylang/plylang",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Ply compiler and language server",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Algosail",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"bin/native.js"
|
|
34
34
|
],
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@plylang/plylang-darwin-arm64": "1.0.
|
|
37
|
-
"@plylang/plylang-darwin-x64": "1.0.
|
|
38
|
-
"@plylang/plylang-linux-arm64": "1.0.
|
|
39
|
-
"@plylang/plylang-linux-x64": "1.0.
|
|
40
|
-
"@plylang/plylang-win32-arm64": "1.0.
|
|
41
|
-
"@plylang/plylang-win32-x64": "1.0.
|
|
36
|
+
"@plylang/plylang-darwin-arm64": "1.0.3",
|
|
37
|
+
"@plylang/plylang-darwin-x64": "1.0.3",
|
|
38
|
+
"@plylang/plylang-linux-arm64": "1.0.3",
|
|
39
|
+
"@plylang/plylang-linux-x64": "1.0.3",
|
|
40
|
+
"@plylang/plylang-win32-arm64": "1.0.3",
|
|
41
|
+
"@plylang/plylang-win32-x64": "1.0.3"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "cargo build --release",
|