transpiler

How to preserve variable name in Cheerp (a C++ to JavaScript transpiler)

耗尽温柔 提交于 2020-06-25 21:48:58
问题 I'm using Cheerp (https://www.leaningtech.com/cheerp/) to transpile some C++ code into JavaScript. Is there any option to preserve variable names? Looks like the names get always mangled Original C++ code: void myClass::myMethod(int32_T myParam, boolean_T *rty_Result) { switch (myParam) { case Mycase1: case Mycase2: case Mycase3: case Mycase4: case Mycase5: *rty_Result = true; break; case Mycase6: *rty_Result = (filter.field1.field2 == 1); break; default: *rty_Result = false; break; } }

How to preserve variable name in Cheerp (a C++ to JavaScript transpiler)

与世无争的帅哥 提交于 2020-06-25 21:47:43
问题 I'm using Cheerp (https://www.leaningtech.com/cheerp/) to transpile some C++ code into JavaScript. Is there any option to preserve variable names? Looks like the names get always mangled Original C++ code: void myClass::myMethod(int32_T myParam, boolean_T *rty_Result) { switch (myParam) { case Mycase1: case Mycase2: case Mycase3: case Mycase4: case Mycase5: *rty_Result = true; break; case Mycase6: *rty_Result = (filter.field1.field2 == 1); break; default: *rty_Result = false; break; } }

Maintain src/ folder structure when building to dist/ folder with Typescript 3

安稳与你 提交于 2020-02-23 09:07:56
问题 I have a typescript nodejs server with this structure: tsconfig.json package.json src/ middleware/ utils/ index.ts dist/ middleware/ utils/ index.ts When using Typescript 2, I was able to transpile my project from the src/ to a dist/ folder and have a mirror image of my directory structure to work with. With the release of Typescript 3 they have introduced project references and changed the way code is transpiled into an output directory. Now tsc outputs to the dist/ folder in a nested way

Maintain src/ folder structure when building to dist/ folder with Typescript 3

只谈情不闲聊 提交于 2020-02-23 09:06:23
问题 I have a typescript nodejs server with this structure: tsconfig.json package.json src/ middleware/ utils/ index.ts dist/ middleware/ utils/ index.ts When using Typescript 2, I was able to transpile my project from the src/ to a dist/ folder and have a mirror image of my directory structure to work with. With the release of Typescript 3 they have introduced project references and changed the way code is transpiled into an output directory. Now tsc outputs to the dist/ folder in a nested way

How to make a vuejs application work with IE 11 when using feathersjs

南楼画角 提交于 2020-01-14 03:01:10
问题 When creating a standard vue app (using vue-cli v3.0) and including @feathersjs/feathers in order to implement a connection with a feathers API, I get an error with Internet Explorer 11 ( SCRIPT1010: Expected identifier ) The bottom line is to find an easy way to solve issues like this, because on bigger projects one could easily find lots of library issues and sometimes is necessary to support at least one version of Internet Explorer (at least from the business point of view) I read on

How to write a Typescript plugin?

萝らか妹 提交于 2020-01-13 20:17:25
问题 Are there any docs / examples of writing a Typescript plugin? For the last time I am very inspired with the idea of bringing Typescript into my projects. However, currently I see this is not possible because of my failed attempts to find any docs about writing a Typescript plugin . I need this plugin for combining classes metadata during compilation and then generating an asset. It was not that easy but I've already written such for babel and now I am interested if it is possible to do the

Converting Python Code to PHP

走远了吗. 提交于 2019-12-30 04:01:14
问题 Is there a software converter out there that can automatically convert this python code to PHP? #!/usr/bin/python import math def calcNumEntropyBits(s): if len(s) <= 0: return 0.0 symCount = {} for c in s: if c not in symCount: symCount[c] = 1 else: symCount[c] += 1 entropy = 0.0 for c,n in symCount.iteritems(): prob = n / float(len(s)) entropy += prob * (math.log(prob)/math.log(2)) if entropy >= 0.0: return 0.0 else: return -(entropy*len(s)) def testEntropy(s): print "Bits of entropy in '%s'

How do I use ES6 (ES2015) in a ruby on rails app?

寵の児 提交于 2019-12-30 01:43:08
问题 I have a 4.2 rails app and am considering slowly converting the JS to ES6. Right now I'm using the standard rails manifest file from the asset pipeline to pre-process my js. I'm not sure how to go about starting to use ES6 (adding a transpile step) in my rails app. Is there a built-in method, or a recommended tool or workflow? 回答1: At present unfortunately there isn't really a 'standard' way of doing this - a lot of it depends on the requirements of your app and if you are able to upgrade

Webpack with babel-loader not recognizing import keyword

丶灬走出姿态 提交于 2019-12-29 04:12:08
问题 I have this webpack.config.js : module.exports = { entry: './src/admin/client/index.jsx', output: { filename: './src/admin/client/static/js/app.js' }, loaders: [ { test: /\.jsx?$/, loader: 'babel', exclude: /node_modules/, query: { optional: ['runtime'] } } ], resolve: { extensions: ['', '.js', '.jsx'] } }; ...yet I still get this error: $ webpack -v Hash: 2a9a40224beb025cb433 Version: webpack 1.10.5 Time: 44ms [0] ./src/admin/client/index.jsx 0 bytes [built] [failed] ERROR in ./src/admin