Help Command
coco help [command]
The help
command prints the commands and options, when [command] is passed, the help for specific command is printed.
Version Command
coco version
The version
command prints the current version of the Cocolang installation.
Optional Flags
flag | description | supported values |
-s, --supress-banner | suppress the cocolang figlet banner | n/a |
Nut Command
coco nut init <module_name>
The nut
command manages coco.nut
file, the manifest file for a module of .coco
source file(s). Currently, the only subcommand is `ìnit`, that creates a new coco.nut
file in the current folder, with the following contents:
[coco]
version = "0.3.0"
[module]
name = "Module"
version = "0.0.1"
license = ""
repository = ""
authors = ""
[target]
os = "MOI"
arch = "PISA"
[target.moi]
format = "YAML"
output = "module"
[target.pisa]
format = "BIN"
While all fields in the coco.nut
file are mandatory, the only currently supported target is MOI Manifests (os = “MOI”) for the PISA runtime (arch = “PISA”), so only [target.moi] and [target.pisa] parameter values affect compilation. Allowed values for these parameters are:
[target.moi]
// output format, the output file extension will be
// .yaml, .json or .polo, respectively
format = "YAML", "JSON" or "POLO"
// output file name (without extension) - by default, it's lowercase module name
output = "module"
[target.pisa]
// format of executable code in PISA manifest
// "ASM" and "HEX" supported from Coco compiler release v0.3.1
format = "BIN", "ASM" or "HEX"
Optional Flags
flag | description | supported values |
-f, --force | allow overwriting coco.nut file in the current folder, if it exists | n/a |
Compile Command
coco compile [path_to_coco.nut]
The compile
command compiles a .coco
source(s) of a module into a target artifact as defined in the coco.nut
file. When called without specified path to a coco.nut
file, the file in the current folder is used and the target artifact is created in the current folder. When path is specified, the artifact is created in the same folder, as coco.nut
file.
Source .coco
files can have any file names, but only the ones with coco <module_name>
that matches module.name
in the coco.nut
file are used for compilation. Multiple source files for a single module are supported from v0.3.2.
Optional Flags
flag | description | supported values |
--debug | print disassembled PISA binary to standard output for all functions in the module | n/a |
Labtest Command
coco labtest <module_name>
The labtest
command compiles and runs the module as a Logic with the LogicLab utility for MOI. When test cases are written into file (see logiclab testing for more), it compares the output with the expected results and reports success/failure. The <module_name>
can be written with or without .coco extension (as with the compile
command), but if it’s completely omitted, tests will be run for all .coco files in the current folder
Optional Flags
flag | description | supported values |
-l, --logiclab <path_to_logiclab_executable> | if logiclab is not in the PATH , a path to logiclab executable file may be needed when running labtest | any valid filepath |