fix replasing

This commit is contained in:
Aleksey Chichenkov 2019-01-30 17:13:54 +03:00
parent a596a9a200
commit 233a3609f0
1 changed files with 2 additions and 0 deletions

View File

@ -30,6 +30,8 @@ var post_process_lexer = function (_string) {
_string = _string.replace(/\*\((.*?)\);/gm, "this._string[($1)];"); // замена разыменовываний
_string = _string.replace(/\*(.* ?);/gm, "this._string[$1];"); // замена разыменовываний
_string = _string.replace(/\*(.* ?)\)/gm, "this._string[$1])"); // замена разыменовываний
_string = _string.replace(/switch \(\(yych = \*this\._yy_cursor\)\) \{/gm, "this._yy_char = this._string[this._yy_cursor]; \nswitch(this._yy_char) {"); // замена разыменовываний
_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