fix replacing

This commit is contained in:
Aleksey Chichenkov 2019-01-30 17:25:00 +03:00
parent c9157f8a9c
commit 549b481bba
1 changed files with 1 additions and 1 deletions

View File

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