melody-compiler
Advanced tools
Comparing version 1.4.0 to 1.5.0
{ | ||
"name": "melody-compiler", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "", | ||
@@ -17,3 +17,3 @@ "main": "./lib/index.js", | ||
"lodash": "^4.12.0", | ||
"melody-code-frame": "^1.4.0", | ||
"melody-code-frame": "^1.5.0", | ||
"random-seed": "^0.3.0" | ||
@@ -29,6 +29,6 @@ }, | ||
"devDependencies": { | ||
"melody-extension-core": "^1.4.0", | ||
"melody-plugin-idom": "^1.4.0" | ||
"melody-extension-core": "^1.5.0", | ||
"melody-plugin-idom": "^1.5.0" | ||
}, | ||
"gitHead": "c79e2d50e132626af6b043d1fb8df067cae9743a" | ||
"gitHead": "6730ddfaafc4f3a69de46806f8a2d050821c5bb0" | ||
} |
@@ -90,31 +90,7 @@ /** | ||
for (const ext of extensions) { | ||
if (ext.unaryOperators) { | ||
lexer.addOperators(...ext.unaryOperators.map(op => op.text)); | ||
} | ||
if (ext.binaryOperators) { | ||
lexer.addOperators(...ext.binaryOperators.map(op => op.text)); | ||
} | ||
lexer.applyExtension(ext); | ||
} | ||
const parser = new Parser(new TokenStream(lexer)); | ||
for (const extension of extensions) { | ||
if (extension.tags) { | ||
for (const tag of (extension.tags: Array)) { | ||
parser.addTag(tag); | ||
} | ||
} | ||
if (extension.unaryOperators) { | ||
for (const op of (extension.unaryOperators: Array)) { | ||
parser.addUnaryOperator(op); | ||
} | ||
} | ||
if (extension.binaryOperators) { | ||
for (const op of (extension.binaryOperators: Array)) { | ||
parser.addBinaryOperator(op); | ||
} | ||
} | ||
if (extension.tests) { | ||
for (const test of (extension.tests: Array)) { | ||
parser.addTest(test); | ||
} | ||
} | ||
for (const ext of extensions) { | ||
parser.applyExtension(ext); | ||
} | ||
@@ -129,9 +105,9 @@ | ||
// however we need them in order to be able to render complex strings | ||
g._generator.StringLiteral = function (node, parent) { | ||
g._generator.StringLiteral = function(node, parent) { | ||
var raw = this.getPossibleRaw(node); | ||
if (!this.format.minified && raw != null) { | ||
this.token(raw); | ||
return; | ||
this.token(raw); | ||
return; | ||
} | ||
return this.token(JSON.stringify(node.value)); | ||
@@ -138,0 +114,0 @@ }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
211152
4893
Updatedmelody-code-frame@^1.5.0