Skip to content
Markos-Th09 edited this page Aug 17, 2022 · 17 revisions

image

Welcome to the Clue documentation.

This wiki documents all changes from Lua and additions that Clue has.

It will also assume that you already know Lua and will not explain Lua itself.

For a general introduction on Clue itself, read the readme.

How to install

Using PowerShell (admin perms required)

  1. Paste and run the below line in your PowerShell
md $Env:ProgramFiles\Clue -f >$null&&iwr((iwr https://api.github.com/repos/ClueLang/Clue/releases?per_page=1).Content|ConvertFrom-Json).assets[0].browser_download_url -o "$Env:ProgramFiles\Clue\clue.exe"&&[Environment]::SetEnvironmentVariable('Path',$Env:PATH+";$Env:ProgramFiles\Clue",'Machine')
  1. Type clue in your PowerShell to run the compiler, it will explain the rest

Linux (cargo required)

  1. Paste and run this command in the console: git clone https://github.com/ClueLang/Clue.git && cd Clue && cargo install --path .
  2. Type clue in the console to run the compiler, it will explain the rest

Manual installation

  1. Download the latest release and save it somewhere
  2. Open your system environment variables
  3. Add the path to the directory that contains clue.exe in the PATH variable
  4. Type clue in your cmd/PowerShell to run the compiler, it will explain the rest

General syntax differences

  • Code blocks are now inside {} instead of then/do/repeat and end/until
  • Comments are made with // ... or /* ... */

Compiling multiple files

Clue will always output a single file: if more .clue files are compiled at once they will be merged together in main.lua, the output of these files will be stored as functions inside the table _modules (which should not be edited).

If multiple files are compiled Clue will make the Lua code start from main.clue, as such that file must be present and it should handle loading the other files.

To load a files you can use the import function, read more about it here

Clone this wiki locally