Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was 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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.