You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
undefined; is there because at the moment empty statements are parsed into ['stmt', ['get', 'undefined']]. We should probably have a separate type for those
; after the very last statement gets dropped completely. This is because curlyTrans rule in BSJSTranslator simply joins all statements with rs.join(';'). Another consequence of joining is pervasive ; even after statements that didn't have semicolons after them in the original source. Latter is mostly problematic if we want to preserve the code-style of the origin (more or less). Esprima + Escodegen do the right thing here.
The text was updated successfully, but these errors were encountered:
BSJS grammars seem to be quite frivolous with how they parse and particularly generate JS code.
Of interest are
;
beforereturn
and the one before the last}
. Parsing and then generating JS using ometa BSJS grammars will produce:undefined;
is there because at the moment empty statements are parsed into['stmt', ['get', 'undefined']]
. We should probably have a separate type for those;
after the very last statement gets dropped completely. This is becausecurlyTrans
rule inBSJSTranslator
simply joins all statements withrs.join(';')
. Another consequence of joining is pervasive;
even after statements that didn't have semicolons after them in the original source. Latter is mostly problematic if we want to preserve the code-style of the origin (more or less). Esprima + Escodegen do the right thing here.The text was updated successfully, but these errors were encountered: