Sorry, but my code have two bugs. I correct it in this mail. Sławomir Lach.
W dniu 17.04.2017, pon o godzinie 10∶20 +0200, użytkownik Sławomir Lach napisał: > Hi. > > I am Lach Sławomir from Poland, Bytom. I am beginner developer in > C/C++, Python, TypeScript, EcmaScript, etc. > > I'm wonder how wonderful stuff can be done if GNU Compilers > Collection > allow developers to use JavaScript inside other language code as > preprocessor. > > - Developer could use arrays > - Developer could use more generalized functions > - Developer could use custom code analyze (as compiler extensions) > - JavaScript will be ran in sandbox, so maybe use it instead > configure > scripts and instead make? > - Developer could use JavaScript regular expressions to replace text > in > files > - Possible many others > > I think, you could use modified version of node.js as C/other > language > preprocessor. I don't have idea how things should be done yet, but > I'm > ready for discussions. > > One example: > #JS_DEFINE("UNPACK",['string','string'], function(a, b) > { > unpacked_symbols[unpacked_symbols.length] = b; > document.write("#define b a . b"); > }) > > #JS_DEFINE("}", [], function() { > > for (a in unpacked_symbols) > { > document.write("#undef" + a); > } > delete unpacked_symbols; > document.write("}"); > } > > That's very simple example. Could it be useful? > > Best regards, > Lach Sławomir.