A kinda crappy pre-processor aimed at Second Life scripting
- LSL
- SLua
- Adds compile time require support
local lib = require("./other")will look for.luaufile endings automatically if not specified.- All preproc commands need to be prefixed with
--- e.g.
--#include ../defines.luau
- e.g.
- Output format for the SL External Editor extension
- Basic preproc commands
#include <file_name>Include a file (Relative to current file only for now, so./../file.luauor so)#define NAME valuedefine a value#ifdef NAMEcheck ifNAMEis defined and advance to#elseor#endifif it isn't#ifndef NAMEcheck ifNAMEis not defined and advance to#elseor#endifif it is#elseelse forifdefandifndef#endifendif
Recommended to be used with the above extension, in fact it will offer it as a default download at some point.
Download the dsl_preproc for your platform and either add to your path or work
in the same folder as it
dls_preproc --file <filename>
It also supports the following arguments
--lang [lsl/slua]override the automatic language detection
.luaurcsupport for finding includes for require starting with@--root <directory>argument to set the directory to use as root for/includes.