MetaScript.js
function include(filename, absolute) {
            filename = absolute
                ? filename
                : __dirname + '/' + filename;
            var _program  = __program,  // Previous meta program
                _source   = __source,   // Previous source
                _filename = __filename, // Previous source file
                _dirname  = __dirname,  // Previous source directory
                _indent   = __;         // Previous indentation level
            var files;
            if (/(?:^|[^\\])\*/.test(filename)) {
                files = require("glob").sync(filename, { cwd : __dirname, nosort: true });
                files.sort(naturalCompare); // Sort these naturally (e.g. int8 < int16)
            } else {
                files = [filename];
            }
            files.forEach(function(file) {
                var source = require("fs").readFileSync(file)+"";
                __program = MetaScript.compile(indent(source, __));
                __source = source;
                __filename = file;
                __dirname = dirname(__filename);
                __runProgram();
                __program = _program;
                __source = _source;
                __filename = _filename;
                __dirname = _dirname;
                __ = _indent;
            });
        }
function include(filename, absolute) {
            filename = absolute
                ? filename
                : __dirname + '/' + filename;
            var _program  = __program,  // Previous meta program
                _source   = __source,   // Previous source
                _filename = __filename, // Previous source file
                _dirname  = __dirname,  // Previous source directory
                _indent   = __;         // Previous indentation level
            var files;
            if (/(?:^|[^\\])\*/.test(filename)) {
                files = require("glob").sync(filename, { cwd : __dirname, nosort: true });
                files.sort(naturalCompare); // Sort these naturally (e.g. int8 < int16)
            } else {
                files = [filename];
            }
            files.forEach(function(file) {
                var source = require("fs").readFileSync(file)+"";
                __program = MetaScript.compile(indent(source, __));
                __source = source;
                __filename = file;
                __dirname = dirname(__filename);
                __runProgram();
                __program = _program;
                __source = _source;
                __filename = _filename;
                __dirname = _dirname;
                __ = _indent;
            });
        }
function include ( filename , absolute ) { filename = absolute ? filename : __dirname + '/' + filename ; var _program = __program , // Previous meta program _source = __source , // Previous source _filename = __filename , // Previous source file _dirname = __dirname , // Previous source directory _indent = __ ; // Previous indentation level var files ; if ( / (?:^|[^\\])\* / . test ( filename ) ) { files = require ( "glob" ) . sync ( filename , { cwd : __dirname , nosort : true } ) ; files . sort ( naturalCompare ) ; // Sort these naturally (e.g. int8 < int16) } else { files = [ filename ] ; } files . forEach ( function ( file ) { var source = require ( "fs" ) . readFileSync ( file ) + "" ; __program = MetaScript . compile ( indent ( source , __ ) ) ; __source = source ; __filename = file ; __dirname = dirname ( __filename ) ; __runProgram ( ) ; __program = _program ; __source = _source ; __filename = _filename ; __dirname = _dirname ; __ = _indent ; } ) ; }
Includes another source file.
@function include
@param {string} filename File to include. May be a glob expression on node.js.
@param {boolean} absolute Whether the path is absolute, defaults to `false` for a relative path
Includes another source file .