Restructure includes and type definition files so that mscript runs
This commit is contained in:
parent
6601c030f7
commit
72b5077356
|
@ -3,7 +3,7 @@ interface RGB extends Array<number> {
|
||||||
[index: number]: number;
|
[index: number]: number;
|
||||||
}
|
}
|
||||||
/** class Mscript */
|
/** class Mscript */
|
||||||
export declare class Mscript {
|
export default class Mscript {
|
||||||
output: any;
|
output: any;
|
||||||
lines: string[];
|
lines: string[];
|
||||||
cam: number;
|
cam: number;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.Mscript = void 0;
|
|
||||||
const BLACK = '0,0,0';
|
const BLACK = '0,0,0';
|
||||||
const WHITE = '255,255,255';
|
const WHITE = '255,255,255';
|
||||||
const CMD = [
|
const CMD = [
|
||||||
|
@ -969,6 +968,6 @@ class Mscript {
|
||||||
return arr.some(r => arr2.includes(r));
|
return arr.some(r => arr2.includes(r));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.Mscript = Mscript;
|
exports.default = Mscript;
|
||||||
module.exports = Mscript;
|
module.exports = Mscript;
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,10 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
/// <reference path ="jquery.d.ts"/>
|
/// <reference path ="jquery.d.ts"/>
|
||||||
const mscript_1 = require("mscript");
|
const mscript_1 = __importDefault(require("mscript"));
|
||||||
/******
|
/******
|
||||||
Mscript GUI
|
Mscript GUI
|
||||||
*******/
|
*******/
|
||||||
|
@ -136,7 +139,7 @@ PF 1`;
|
||||||
**/
|
**/
|
||||||
compile() {
|
compile() {
|
||||||
const data = this.editor.getValue();
|
const data = this.editor.getValue();
|
||||||
const mscript = new mscript_1.Mscript();
|
const mscript = new mscript_1.default();
|
||||||
const output = mscript.interpret(data);
|
const output = mscript.interpret(data);
|
||||||
const len = output.arr.length;
|
const len = output.arr.length;
|
||||||
const cam2 = typeof output.cam2 !== 'undefined' ? `, CAM2 : ${output.cam2}` : '';
|
const cam2 = typeof output.cam2 !== 'undefined' ? `, CAM2 : ${output.cam2}` : '';
|
||||||
|
@ -267,6 +270,7 @@ class MscriptConsole {
|
||||||
let current = (this.elem.val() + '');
|
let current = (this.elem.val() + '');
|
||||||
let height;
|
let height;
|
||||||
current += str;
|
current += str;
|
||||||
|
current += '\n';
|
||||||
mse.console.elem.val(current);
|
mse.console.elem.val(current);
|
||||||
mse.console.elem.focus();
|
mse.console.elem.focus();
|
||||||
this.newLine();
|
this.newLine();
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/// <reference path ="jquery.d.ts"/>
|
/// <reference path ="jquery.d.ts"/>
|
||||||
|
|
||||||
import { Mscript } from 'mscript';
|
import Mscript from 'mscript';
|
||||||
|
|
||||||
declare var nav : any;
|
declare var nav : any;
|
||||||
declare var gui : any;
|
declare var gui : any;
|
||||||
|
@ -305,6 +305,7 @@ class MscriptConsole {
|
||||||
let current : string = (this.elem.val() + '');
|
let current : string = (this.elem.val() + '');
|
||||||
let height : number;
|
let height : number;
|
||||||
current += str;
|
current += str;
|
||||||
|
current += '\n';
|
||||||
mse.console.elem.val(current);
|
mse.console.elem.val(current);
|
||||||
mse.console.elem.focus();
|
mse.console.elem.focus();
|
||||||
|
|
||||||
|
|
|
@ -258,6 +258,8 @@ CF 10`
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//secondary
|
||||||
|
|
||||||
/*describe('mscript - Variables', () => {
|
/*describe('mscript - Variables', () => {
|
||||||
const script1 =
|
const script1 =
|
||||||
`@LIGHT=200,200,200
|
`@LIGHT=200,200,200
|
||||||
|
|
|
@ -101,7 +101,7 @@ function startsWith (str : string, target : string, position? : number) : boolea
|
||||||
}
|
}
|
||||||
|
|
||||||
/** class Mscript */
|
/** class Mscript */
|
||||||
export class Mscript {
|
export default class Mscript {
|
||||||
output : any;
|
output : any;
|
||||||
lines : string[];
|
lines : string[];
|
||||||
cam : number;
|
cam : number;
|
||||||
|
|
Loading…
Reference in New Issue