@plylang/plylang 1.0.27 → 1.1.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/README.md +21 -8
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -309,13 +309,13 @@ A module names what it publishes with one `@` list. The list may stand anywhere
|
|
|
309
309
|
@ Maybe, Nothing, Just, fromMaybe
|
|
310
310
|
```
|
|
311
311
|
|
|
312
|
-
Imports stay together and come before the first `:`, `;`, `-`, `&`, `#`, or `=`. A path inside this package is written from the source directory. A path into another package is a package specifier. The names after the path are what this file uses. `: Alias` brings every published name as `Alias:name`, and a call is `Alias:send`. `send : busSend` brings `send` as `busSend`. A bare path brings instances and no names. Writing the local name again in the `@` list publishes it. A colon in column 0 still starts a word.
|
|
312
|
+
Imports stay together and come before the first `:`, `;`, `-`, `&`, `#`, `?`, or `=`. A path inside this package is written from the source directory. A path into another package is a package specifier. The names after the path are what this file uses. `: Alias` brings every published name as `Alias:name`, and a call is `Alias:send`. `send : busSend` brings `send` as `busSend`. A bare path brings instances and no names. Writing the local name again in the `@` list publishes it. A colon in column 0 still starts a word.
|
|
313
313
|
|
|
314
|
-
A
|
|
314
|
+
A word `main` with scheme `( -- Unit )` may stay off the list. Node still runs it when it starts that file.
|
|
315
315
|
|
|
316
|
-
A comment runs from `.` to the end of the line, when the dot is not inside `()`. `..` in column 0, directly above `:`, `;`, `-`, `&`, or `=`, is the text of that declaration. One space after `..` is not part of the text. A type has one text for all of its constructors.
|
|
316
|
+
A comment runs from `.` to the end of the line, when the dot is not inside `()`. `..` in column 0, directly above `:`, `;`, `-`, `&`, `?`, or `=`, is the text of that declaration. One space after `..` is not part of the text. A line that is only `..` keeps a paragraph break. A type has one text for all of its constructors. The lines above `&` are the text of the class. A `..` line at the start of an indented line, directly above a method, is the text of that method. A method without that line keeps the class text in the hover. A `..` line above `#` does not attach to the declaration.
|
|
317
317
|
|
|
318
|
-
A declaration stands in column 0 and starts with `@`, `:`, `;`, `-`, `&`, `#`, `~`, or `=`.
|
|
318
|
+
A declaration stands in column 0 and starts with `@`, `:`, `;`, `-`, `&`, `#`, `?`, `~`, or `=`.
|
|
319
319
|
|
|
320
320
|
A place is one value the module keeps off the stack. `= base Num` declares it. The program under that line has scheme `( -- Num )` and runs once, when the module loads. After that, `base` reads the current frame `( -- Num )`. `=base` writes the top value `( Num -- )`. `=>base` runs the quotation under a new frame and restores the previous frame afterwards, including when the quotation throws: `( ..s Num ( ..s -- ..t ) -- ..t )`. The stored type is monomorphic. Importing `base` also opens `=base` and `=>base`. The program that fills the place does not read or write it.
|
|
321
321
|
|
|
@@ -345,7 +345,7 @@ The foreign directory is `foreign` when that directory exists, or the string `pl
|
|
|
345
345
|
|
|
346
346
|
```text
|
|
347
347
|
plylang check [dir]
|
|
348
|
-
plylang build [dir] [--exports] [--entry <module>] [--out <dir>] [--foreign <dir>]
|
|
348
|
+
plylang build [dir] [--exports [--all] [--check] [<module>...]] [--watch] [--entry <module>] [--out <dir>] [--foreign <dir>]
|
|
349
349
|
plylang compile [dir] [--entry <module>] [--out <file>] [--foreign <dir>]
|
|
350
350
|
plylang test [pattern]
|
|
351
351
|
plylang docs [dir] [--out <file>]
|
|
@@ -353,13 +353,26 @@ plylang check --parse <file>
|
|
|
353
353
|
plylang check --js <file>
|
|
354
354
|
```
|
|
355
355
|
|
|
356
|
-
`plylang check` checks
|
|
356
|
+
`plylang check` checks every file under the source directory, the imports, `foreign`, and each `?` check. It writes no files. The default directory is the current one. `plylang build` checks the modules and writes them into the output directory. It leaves each `?` check out of that typecheck and out of both files. An import is written when the built program uses that name, or when `@` re-exports it. A `.js` file is written when the module has a JavaScript export, `main`, a place, or is `ply.entry`. A `.d.ply` file is written when `@` names something. A file with an empty `@` and no `main`, place, or entry writes nothing, and a file already at that path is removed. `build` does not change `exports`. `plylang build --exports` refreshes the `ply` and `import` paths of modules already listed in `exports`. A source file is added when its name is passed, as in `plylang build --exports Data/Sheet`, or when `--all` is passed. `--all` adds each source module whose `@` names something. Several names may follow `--exports`. A name that is not a source file is an error, and this run writes nothing. Names that stay out of the list are printed under `not exported`. `plylang build --exports --check` prints that report and leaves `package.json` unchanged. The modules are still written. The exit code is 1 when a path would change, an entry names a module that is gone, or `--all` would add a module whose `@` names something. `not exported` by itself leaves the exit code at 0. `--all` together with a module name is rejected. `--watch` cannot be combined with `--exports`. A module whose file is gone is removed when its entry has a `ply` field. A key that does not name a module of this package stays as written. On a module that stays, the `ply` and `import` strings are updated and the other fields stay. A module with no `.js` keeps `ply` and has no `import`. `.` follows `ply.entry` from the file on disk when that module is listed or is being added. With no `ply.entry`, a hand-written `.` stays. Each written path uses `ply.out` from that file. `--entry`, `--out`, and `--foreign` apply to this run and stay out of `package.json`. A module of this package is imported by its path under the source directory, whether or not `exports` lists it. Another package finds the module through the `exports` entry.
|
|
357
357
|
|
|
358
|
-
|
|
358
|
+
A check stands in column 0.
|
|
359
|
+
|
|
360
|
+
```ply
|
|
361
|
+
? "seed stays" < 0 > [
|
|
362
|
+
< 2 10 Occurrence > streamFrom
|
|
363
|
+
0 stepper
|
|
364
|
+
0 runAt
|
|
365
|
+
1 valueAt
|
|
366
|
+
]
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
The name is a string literal. The picture is the stack from the bottom upward. The quotation is the program, and it starts from an empty stack. `< 1 2 >` is two values. `<>` is an empty stack. The quotation calls words of this file, including a word that stays off the `@` list. A word the check alone needs is written inside the quotation. The check is not a published name.
|
|
370
|
+
|
|
371
|
+
`plylang test` builds the package, then finds `?` in source files that match one pattern. The pattern is relative to the source directory. The default is `**/*.ply`. `*` matches inside one path segment. `**` matches across directories. Quote the pattern so the shell does not expand `*`. A file with no `?` is left out. The runner typechecks each check and runs it. The comparison is structural. A failure prints the name, `file:line`, and both stack pictures. One failed check still lets the other checks in that file run. A throw is a failure of that named check. One file that does not compile still lets the other files run. The runner writes the check into a temporary directory inside the package and deletes that directory when the run ends, including when a check fails to compile. The modules in the output directory stay, and they contain no check. A source file cannot import a package that is only a `devDependency`. A failed check, a compile error, or a throw exits 1. No file matched exits 1 with `no tests matched`. Color is used when stdout is a terminal and `NO_COLOR` is unset.
|
|
359
372
|
|
|
360
373
|
A word named `main` whose scheme is `( -- Unit )` is the program of that module. It may stay off the `@` list. `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. `plylang compile` also writes those modules, then the page script. `--out` names that file. Otherwise it is `script.js` beside the modules. `--entry` names the module for this run, instead of `ply.entry`. The root is `main` when that module defines `main` of scheme `( -- Unit )`, and the script calls `main()`. A module with no `main` and at least one place roots the script at those places, and the script does not call `main`. A module with neither is an error. A binding is inlined when the root can call it. The modules themselves still carry the Node guard. `compile` does not rewrite `exports`. `--foreign` names the foreign directory for this run. A relative `--out` or `--foreign` stays inside the package.
|
|
361
374
|
|
|
362
|
-
`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. A head whose type is defined in another module of this package is listed there too.
|
|
375
|
+
`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. A method is a heading after its class. The class heading carries the class text. The method heading carries that method's text. `Instances` is a list of `#` heads, with no comment and no method bindings. A head whose type is defined in another module of this package is listed there too.
|
|
363
376
|
|
|
364
377
|
`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.
|
|
365
378
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plylang/plylang",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Ply compiler",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Algosail",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"bin/native.js"
|
|
31
31
|
],
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@plylang/plylang-darwin-arm64": "1.0
|
|
34
|
-
"@plylang/plylang-darwin-x64": "1.0
|
|
35
|
-
"@plylang/plylang-linux-arm64": "1.0
|
|
36
|
-
"@plylang/plylang-linux-x64": "1.0
|
|
37
|
-
"@plylang/plylang-win32-arm64": "1.0
|
|
38
|
-
"@plylang/plylang-win32-x64": "1.0
|
|
33
|
+
"@plylang/plylang-darwin-arm64": "1.1.0",
|
|
34
|
+
"@plylang/plylang-darwin-x64": "1.1.0",
|
|
35
|
+
"@plylang/plylang-linux-arm64": "1.1.0",
|
|
36
|
+
"@plylang/plylang-linux-x64": "1.1.0",
|
|
37
|
+
"@plylang/plylang-win32-arm64": "1.1.0",
|
|
38
|
+
"@plylang/plylang-win32-x64": "1.1.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "cargo build --release",
|