bson-transpilers
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -331,7 +331,8 @@ /* eslint camelcase: 0 complexity: 0*/ | ||
if (op === '==' || op === '!=' || op === 'is' || op === 'isnot') { | ||
skip = true; | ||
if (this.Syntax.equality) { | ||
return `${str}${this.Syntax.equality.template( | ||
this.visit(arr[i - 1]), op, '')}`; | ||
this.visit(arr[i - 1]), op, this.visit(arr[i + 1]))}`; | ||
} | ||
return `${str} === ${this.visit(arr[i - 1])} ${op} `; | ||
return `${str} === ${this.visit(arr[i - 1])} ${op} ${this.visit(arr[i + 1])}`; | ||
} | ||
@@ -338,0 +339,0 @@ if (op === 'in' || op === 'notin') { |
@@ -62,3 +62,3 @@ /* eslint-disable no-sync */ | ||
const inputLangs = ['javascript', 'shell', 'python']; | ||
const outputLangs = ['java', 'shell', 'python', 'csharp', 'javascript', 'object']; | ||
const outputLangs = ['java', 'shell', 'python', 'csharp', 'javascript', 'object', 'ruby']; | ||
if (!fs.existsSync(dir)) { | ||
@@ -65,0 +65,0 @@ fs.mkdirSync(dir); |
@@ -19,2 +19,7 @@ # Contributing to bson-transpilers | ||
Make sure you have run the following from the root directory: | ||
```shell | ||
$ npm run bootstrap | ||
``` | ||
Then compile and run tests locally with: | ||
@@ -330,3 +335,5 @@ ```shell | ||
``` | ||
Make sure to add your output language in the outputLanguages array at the beginning | ||
of `run-yaml.test.js`, and to the list near the end of `functions.test.js`. | ||
## Adding an Input Language | ||
TODO! |
22
index.js
@@ -29,2 +29,3 @@ const antlr4 = require('antlr4'); | ||
const getObjectGenerator = require('./codegeneration/object/Generator'); | ||
const getRubyGenerator = require('./codegeneration/ruby/Generator.js'); | ||
@@ -36,2 +37,3 @@ const javascriptjavasymbols = require('./lib/symbol-table/javascripttojava'); | ||
const javascriptobjectsymbols = require('./lib/symbol-table/javascripttoobject'); | ||
const javascriptrubysymbols = require('./lib/symbol-table/javascripttoruby'); | ||
@@ -43,2 +45,3 @@ const shelljavasymbols = require('./lib/symbol-table/shelltojava'); | ||
const shellobjectsymbols = require('./lib/symbol-table/shelltoobject'); | ||
const shellrubysymbols = require('./lib/symbol-table/shelltoruby'); | ||
@@ -50,2 +53,3 @@ const pythonjavasymbols = require('./lib/symbol-table/pythontojava'); | ||
const pythonobjectsymbols = require('./lib/symbol-table/pythontoobject'); | ||
const pythonrubysymbols = require('./lib/symbol-table/pythontoruby'); | ||
@@ -210,2 +214,8 @@ /** | ||
javascriptobjectsymbols | ||
), | ||
ruby: getTranspiler( | ||
loadJSTree, | ||
getJavascriptVisitor(getCodeGenerationVisitor(JavascriptANTLRVisitor)), | ||
getRubyGenerator, | ||
javascriptrubysymbols | ||
) | ||
@@ -243,2 +253,8 @@ }, | ||
shellobjectsymbols | ||
), | ||
ruby: getTranspiler( | ||
loadJSTree, | ||
getShellVisitor(getJavascriptVisitor(getCodeGenerationVisitor(JavascriptANTLRVisitor))), | ||
getRubyGenerator, | ||
shellrubysymbols | ||
) | ||
@@ -276,2 +292,8 @@ }, | ||
pythonobjectsymbols | ||
), | ||
ruby: getTranspiler( | ||
loadPyTree, | ||
getPythonVisitor(getCodeGenerationVisitor(PythonANTLRVisitor)), | ||
getRubyGenerator, | ||
pythonrubysymbols | ||
) | ||
@@ -278,0 +300,0 @@ }, |
{ | ||
"name": "bson-transpilers", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"apiVersion": "0.0.1", | ||
@@ -55,3 +55,3 @@ "productName": "BSON Transpilers", | ||
}, | ||
"gitHead": "77166e3754e36e95c7ff7efb5a0ce5e0990b0ff7" | ||
"gitHead": "6563679c816fa44691a53b7e27fa0cb5539e0854" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2420540
454
60
30879
1
15
20
7
181
26