From 8f0f841191e2682e647f272638a5cb46142eea78 Mon Sep 17 00:00:00 2001 From: Aleksey Chichenkov Date: Wed, 30 Jan 2019 17:54:19 +0300 Subject: [PATCH] sdaf --- main.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/main.js b/main.js index 9711169..671cd72 100644 --- a/main.js +++ b/main.js @@ -28,12 +28,10 @@ var post_process_lexer = function (_string) { _string = _string.replace(/(yych = \*this._yy_cursor);\n/gm, "\tcase 1:\n yych = this._string[this._yy_cursor];\n"); // insert "case 1:" before; _string = _string.replace(/switch \(\(yych = \*this\._yy_cursor\)\) \{/gm, "this._yy_char = this._string[this._yy_cursor]; \n switch (yych) {"); // замена разыменовываний - _string = _string.replace(/\*\((.*?)\);/gm, "this._string[($1)];"); // замена разыменовываний _string = _string.replace(/\*(.* ?);/gm, "this._string[$1];"); // замена разыменовываний _string = _string.replace(/\*(.* ?)\)/gm, "this._string[$1])"); // замена разыменовываний - _string = _string.replace(/^yy(\d*?):/gm, "case $1:"); // replace goto marker onto case _string = _string.replace(/\) goto yy(\d*?);/gm, ") { id = $1; break; }"); // replace goto inside if _string = _string.replace(/goto yy(\d*?);/gm, "id = $1; break;"); // replace goto outside if @@ -41,7 +39,6 @@ var post_process_lexer = function (_string) { _string = _string.replace(/\{ (unknownSymbol.*break;) \}/gm, "$1"); // replace unknownSymbol _string = _string.replace(/0x00/gm, 'undefined'); // replace 0x00 - // black magic _string = _string.replace(/(switch \(yych\) \{[\s\S]*?})/gm, "(function(){$1}.bind(this))(); break;"); // добавим замыкание что бы обработать свиче в свиче _string = _string.replace(/switch\((id)\)/gm, "switch(this._state)"); // replace id to this._state @@ -50,7 +47,6 @@ var post_process_lexer = function (_string) { _string = _string.replace(/yyaccept/gm, "this._yy_accept"); // replace yyaccept to this._yy_accept _string = _string.replace(/yych/gm, "this._yy_char"); // replace yych to this._yy_char - if(args["t"] !== undefined) { switch (args["t"]) { case "web":