Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Migration

Daniel Wirtz edited this page Aug 22, 2014 · 2 revisions

While MetaScript provides much more than just what a preprocessor offers, migration from Preprocessor.js or a similar tool is pretty much straight forward.

include

Preprocessor (always absolute to base directory)

// #include "path/to/file.js"

MetaScript (relative to the current file's directory)

//? include("path/to/file.js");

ifdef, ifndef, if

Preprocessor

// #ifdef FULL
console.log("Including extension");
// #else
console.log("Not including extension");
// #endif

MetaScript

//? if (typeof FULL !== 'undefined') {
console.log("Including extension");
//? } else {
console.log("Not including extension");
//? }

define

Preprocessor

// #define PI=Math.PI

MetaScript

//? PI = Math.PI;

put

Preprocessor

var version = // #put '"'+VERSION+'";"'

MetaScript

var version = /*?== VERSION */;

See: MetaScript API

Clone this wiki locally