Restructure includes and type definition files so that mscript runs

This commit is contained in:
Matthew McWilliams 2022-08-07 22:18:58 -04:00
parent 6601c030f7
commit 72b5077356
8 changed files with 15 additions and 9 deletions

View File

@ -3,7 +3,7 @@ interface RGB extends Array<number> {
[index: number]: number;
}
/** class Mscript */
export declare class Mscript {
export default class Mscript {
output: any;
lines: string[];
cam: number;

View File

@ -1,6 +1,5 @@
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.Mscript = void 0;
const BLACK = '0,0,0';
const WHITE = '255,255,255';
const CMD = [
@ -969,6 +968,6 @@ class Mscript {
return arr.some(r => arr2.includes(r));
}
}
exports.Mscript = Mscript;
exports.default = Mscript;
module.exports = Mscript;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,10 @@
'use strict';
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/// <reference path ="jquery.d.ts"/>
const mscript_1 = require("mscript");
const mscript_1 = __importDefault(require("mscript"));
/******
Mscript GUI
*******/
@ -136,7 +139,7 @@ PF 1`;
**/
compile() {
const data = this.editor.getValue();
const mscript = new mscript_1.Mscript();
const mscript = new mscript_1.default();
const output = mscript.interpret(data);
const len = output.arr.length;
const cam2 = typeof output.cam2 !== 'undefined' ? `, CAM2 : ${output.cam2}` : '';
@ -267,6 +270,7 @@ class MscriptConsole {
let current = (this.elem.val() + '');
let height;
current += str;
current += '\n';
mse.console.elem.val(current);
mse.console.elem.focus();
this.newLine();

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
/// <reference path ="jquery.d.ts"/>
import { Mscript } from 'mscript';
import Mscript from 'mscript';
declare var nav : any;
declare var gui : any;
@ -305,6 +305,7 @@ class MscriptConsole {
let current : string = (this.elem.val() + '');
let height : number;
current += str;
current += '\n';
mse.console.elem.val(current);
mse.console.elem.focus();

View File

@ -258,6 +258,8 @@ CF 10`
})
})
//secondary
/*describe('mscript - Variables', () => {
const script1 =
`@LIGHT=200,200,200

View File

@ -101,7 +101,7 @@ function startsWith (str : string, target : string, position? : number) : boolea
}
/** class Mscript */
export class Mscript {
export default class Mscript {
output : any;
lines : string[];
cam : number;