Comparing version 1.2.1 to 1.2.2
{ | ||
"name": "astq", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Abstract Syntax Tree (AST) Query Engine", | ||
@@ -5,0 +5,0 @@ "main": "lib/astq.browser.js", |
@@ -31,2 +31,3 @@ /* | ||
grunt.loadNpmTasks("grunt-mocha-test"); | ||
grunt.loadNpmTasks("grunt-jscs"); | ||
@@ -42,2 +43,13 @@ grunt.initConfig({ | ||
}, | ||
jscs: { | ||
"astq": { | ||
options: { | ||
config: "jscs.json", | ||
esnext: true | ||
}, | ||
files: { | ||
src: [ "src/**/*.js", "tst/**/*.js" ] | ||
} | ||
} | ||
}, | ||
browserify: { | ||
@@ -116,5 +128,5 @@ "astq-browser": { | ||
grunt.registerTask("default", [ "jshint", "browserify", "mochaTest" ]); | ||
grunt.registerTask("default", [ "jshint", "jscs", "browserify", "mochaTest" ]); | ||
grunt.registerTask("test", [ "jshint:astq", "browserify:astq-node", "mochaTest" ]); | ||
}; | ||
{ | ||
"name": "astq", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Abstract Syntax Tree (AST) Query Engine", | ||
@@ -35,2 +35,3 @@ "keywords": [ "abstract", "syntax", "tree", "query", "engine", "adaptable" ], | ||
"grunt-mocha-test": "~0.12.7", | ||
"grunt-jscs": "~1.5.0", | ||
"chai": "~1.10.0", | ||
@@ -37,0 +38,0 @@ "6to5ify": "~4.1.0", |
@@ -203,17 +203,17 @@ /* | ||
switch (Q.type()) { | ||
case "ConditionalBinary": return this.execExprConditionalBinary (Q, T) | ||
case "ConditionalBinary": return this.execExprConditionalBinary(Q, T) | ||
case "ConditionalTernary": return this.execExprConditionalTernary(Q, T) | ||
case "Logical": return this.execExprLogical (Q, T) | ||
case "Bitwise": return this.execExprBitwise (Q, T) | ||
case "Relational": return this.execExprRelational (Q, T) | ||
case "Arithmetical": return this.execExprArithmetical (Q, T) | ||
case "Unary": return this.execExprUnary (Q, T) | ||
case "FuncCall": return this.execExprFuncCall (Q, T) | ||
case "Attribute": return this.execExprAttribute (Q, T) | ||
case "Param": return this.execExprParam (Q, T) | ||
case "LiteralString": return this.execExprLiteralString (Q, T) | ||
case "LiteralRegExp": return this.execExprLiteralRegExp (Q, T) | ||
case "LiteralNumber": return this.execExprLiteralNumber (Q, T) | ||
case "LiteralValue": return this.execExprLiteralValue (Q, T) | ||
case "Path": return this.execExprPath (Q, T) | ||
case "Logical": return this.execExprLogical(Q, T) | ||
case "Bitwise": return this.execExprBitwise(Q, T) | ||
case "Relational": return this.execExprRelational(Q, T) | ||
case "Arithmetical": return this.execExprArithmetical(Q, T) | ||
case "Unary": return this.execExprUnary(Q, T) | ||
case "FuncCall": return this.execExprFuncCall(Q, T) | ||
case "Attribute": return this.execExprAttribute(Q, T) | ||
case "Param": return this.execExprParam(Q, T) | ||
case "LiteralString": return this.execExprLiteralString(Q, T) | ||
case "LiteralRegExp": return this.execExprLiteralRegExp(Q, T) | ||
case "LiteralNumber": return this.execExprLiteralNumber(Q, T) | ||
case "LiteralValue": return this.execExprLiteralValue(Q, T) | ||
case "Path": return this.execExprPath(Q, T) | ||
} | ||
@@ -321,2 +321,3 @@ } | ||
let result | ||
/* jscs: disable */ | ||
switch (Q.get("op")) { | ||
@@ -326,2 +327,3 @@ case "!": result = !util.coerce(v, "boolean"); break | ||
} | ||
/* jscs: enable */ | ||
this.traceEnd(Q, T, result) | ||
@@ -328,0 +330,0 @@ return result |
@@ -54,3 +54,4 @@ /* | ||
if (trace) | ||
console.log("ASTQ: compile: +-------------------------------------------------------------------------------------------------------\n" + | ||
console.log("ASTQ: compile: +---------------------------------------" + | ||
"----------------------------------------------------------------\n" + | ||
"ASTQ: compile: | " + selector) | ||
@@ -68,3 +69,4 @@ let result = PEGUtil.parse(ASTQQueryParse, selector, { | ||
if (trace) | ||
console.log("ASTQ: compile: +-------------------------------------------------------------------------------------------------------\n" + | ||
console.log("ASTQ: compile: +---------------------------------------" + | ||
"----------------------------------------------------------------\n" + | ||
this.dump().replace(/\n$/, "").replace(/^/mg, "ASTQ: compile: | ")) | ||
@@ -82,3 +84,4 @@ return this | ||
if (trace) | ||
console.log("ASTQ: execute: +--------------------------------------------------------------+----------------------------------------") | ||
console.log("ASTQ: execute: +---------------------------------------" + | ||
"-----------------------+----------------------------------------") | ||
let qe = new ASTQQueryExec(adapter, params, funcs, trace) | ||
@@ -85,0 +88,0 @@ return qe.execQuery(this.ast, node) |
@@ -32,7 +32,7 @@ /* | ||
var ASTQ = require("../lib/astq.node.js"); | ||
var ASTQ = require("../lib/astq.node.js") | ||
describe("ASTq Library", function () { | ||
it("basic functionality", function () { | ||
var astq = new ASTQ(); | ||
var astq = new ASTQ() | ||
expect(astq).to.respondTo("version") | ||
@@ -39,0 +39,0 @@ expect(astq).to.respondTo("adapter") |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
434916
26
6564
13