added consistent _main
This commit is contained in:
@@ -84,13 +84,12 @@ This will build the `clyx` executable.
|
||||
|
||||
Note: this section describes how to run the interpreter itself. For the language manual, refer to [Clyx Reference Manual](clyx_manual.md).
|
||||
|
||||
All core implementations must accept a `.clx` file to run (either via command line or via library call parameter). The REPL is implemented in Clyx itself and resides in the [clyx_repl.clx](clyx_repl.clx) file.
|
||||
All core implementations must accept one or more `.clx` files to run (either via command line or via library call parameter). If multiple files are passed, they are executed in sequence. If a `_main` word is defined in the workspace after running all source files, it is automatically executed as the entry point. The REPL is implemented in Clyx itself and resides in the [clyx_repl.clx](clyx_repl.clx) file.
|
||||
|
||||
### Running the reference Python implementation
|
||||
If Clyx is installed as a PyPi package, use `clyx [prog1.clx prog2.clx ...]` to run the REPL or one or more programs.
|
||||
|
||||
If Clyx is installed as a PyPi package, just use `clyx [prog.clx]` to run the REPL or a program.
|
||||
|
||||
Otherwise, to run the REPL, run `[micro]python clyx.py` command from the directory created by `./dist-python.sh`. Pass a `.clx` file additionally to run a Clyx program directly.
|
||||
Otherwise, to run the REPL, run `[micro]python clyx.py` command from the directory created by `./dist-python.sh`. Pass one or more `.clx` files additionally to run them directly.
|
||||
|
||||
### Running as a T-DeckARD applet
|
||||
|
||||
@@ -114,10 +113,10 @@ To run the REPL, execute the compiled `clyx` binary without arguments:
|
||||
./clyx
|
||||
```
|
||||
|
||||
To run a program directly, pass the path to the `.clx` file as an argument:
|
||||
To run programs directly, pass the path to the `.clx` files as arguments:
|
||||
|
||||
```sh
|
||||
./clyx path/to/program.clx
|
||||
./clyx path/to/program1.clx path/to/program2.clx
|
||||
```
|
||||
|
||||
### Self-contained Packaging (Compilation)
|
||||
|
||||
Reference in New Issue
Block a user