Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "asty", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Abstract Syntax Tree (AST) Data Structure", | ||
@@ -5,0 +5,0 @@ "main": "lib/asty.browser.js", |
@@ -31,4 +31,6 @@ /* | ||
grunt.loadNpmTasks("grunt-mocha-test"); | ||
grunt.loadNpmTasks("grunt-jscs"); | ||
grunt.initConfig({ | ||
version: grunt.file.readYAML("VERSION.yml"), | ||
jshint: { | ||
@@ -42,2 +44,13 @@ options: { | ||
}, | ||
jscs: { | ||
"asty": { | ||
options: { | ||
config: "jscs.json", | ||
esnext: true | ||
}, | ||
files: { | ||
src: [ "src/**/*.js" ] | ||
} | ||
} | ||
}, | ||
browserify: { | ||
@@ -49,3 +62,11 @@ "asty-browser": { | ||
options: { | ||
transform: [ "6to5ify" ], | ||
transform: [ | ||
[ "browserify-replace", { replace: [ | ||
{ from: /\$major/g, to: "<%= version.major %>" }, | ||
{ from: /\$minor/g, to: "<%= version.minor %>" }, | ||
{ from: /\$micro/g, to: "<%= version.micro %>" }, | ||
{ from: /\$date/g, to: "<%= version.date %>" } | ||
]}], | ||
"6to5ify" | ||
], | ||
plugin: [ | ||
@@ -67,3 +88,11 @@ [ "minifyify", { map: "asty.browser.map", output: "lib/asty.browser.map" } ], | ||
options: { | ||
transform: [ "6to5ify" ], | ||
transform: [ | ||
[ "browserify-replace", { replace: [ | ||
{ from: /\$major/g, to: "<%= version.major %>" }, | ||
{ from: /\$minor/g, to: "<%= version.minor %>" }, | ||
{ from: /\$micro/g, to: "<%= version.micro %>" }, | ||
{ from: /\$date/g, to: "<%= version.date %>" } | ||
]}], | ||
"6to5ify" | ||
], | ||
plugin: [ | ||
@@ -94,4 +123,4 @@ [ "browserify-derequire" ], | ||
grunt.registerTask("default", [ "jshint", "browserify", "mochaTest" ]); | ||
grunt.registerTask("default", [ "jshint", "jscs", "browserify", "mochaTest" ]); | ||
}; | ||
@@ -32,6 +32,8 @@ /* | ||
},{}],4:[function(_dereq_,module,exports){ | ||
"use strict";var version={major:1,minor:0,micro:4,date:20150211};module.exports=version; | ||
},{}],5:[function(_dereq_,module,exports){ | ||
"use strict";var _prototypeProperties=function(n,t,e){t&&Object.defineProperties(n,t),e&&Object.defineProperties(n.prototype,e)},_classCallCheck=function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")},ASTYWalk=function(){function n(){_classCallCheck(this,n)}return _prototypeProperties(n,null,{walk:{value:function(n,t){"undefined"==typeof t&&(t="downward");var e=function(o,r,l){("downward"===t||"both"===t)&&n.call(null,o,r,l,"downward"),o.C.forEach(function(n){e(n,r+1,o)}),("upward"===t||"both"===t)&&n.call(null,o,r,l,"upward")};return e(this,0,null),this},writable:!0,configurable:!0}}),n}();module.exports=ASTYWalk; | ||
},{}],5:[function(_dereq_,module,exports){ | ||
"use strict";var _prototypeProperties=function(e,t,r){t&&Object.defineProperties(e,t),r&&Object.defineProperties(e.prototype,r)},_classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ASTYBase=_dereq_("./asty-base.js"),ASTYMerge=_dereq_("./asty-merge.js"),ASTYWalk=_dereq_("./asty-walk.js"),ASTYDump=_dereq_("./asty-dump.js"),ASTYCtx=function(){function e(){var t=this;_classCallCheck(this,e),this.ASTYNode=function(){};var r=[[ASTYBase,"init","type","pos","set","get","attrs","add","del","childs","parent"],[ASTYMerge,"merge"],[ASTYWalk,"walk"],[ASTYDump,"dump"]];return r.forEach(function(e){var r=e[0].prototype;e.slice(1).forEach(function(e){t.ASTYNode.prototype[e]=r[e]})}),this}return _prototypeProperties(e,null,{extend:{value:function(e){for(var t in e)e.hasOwnProperty(t)&&(this.ASTYNode.prototype[t]=e[t]);return this},writable:!0,configurable:!0},create:{value:function(e){return(new this.ASTYNode).init(e)},writable:!0,configurable:!0},isA:{value:function(e){return"object"==typeof e&&e instanceof this.ASTYNode&&"boolean"==typeof e.ASTy&&e.ASTy===!0},writable:!0,configurable:!0}}),e}();module.exports=ASTYCtx; | ||
},{"./asty-base.js":1,"./asty-dump.js":2,"./asty-merge.js":3,"./asty-walk.js":4}]},{},[1,2,3,4,5])(5) | ||
},{}],6:[function(_dereq_,module,exports){ | ||
"use strict";var _interopRequire=function(e){return e&&e.__esModule?e["default"]:e},_prototypeProperties=function(e,r,t){r&&Object.defineProperties(e,r),t&&Object.defineProperties(e.prototype,t)},_classCallCheck=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},ASTYBase=_interopRequire(_dereq_("./asty-base.js")),ASTYMerge=_interopRequire(_dereq_("./asty-merge.js")),ASTYWalk=_interopRequire(_dereq_("./asty-walk.js")),ASTYDump=_interopRequire(_dereq_("./asty-dump.js")),ASTYVersion=_interopRequire(_dereq_("./asty-version.js")),ASTYCtx=function(){function e(){var r=this;_classCallCheck(this,e),this.ASTYNode=function(){};var t=[[ASTYBase,"init","type","pos","set","get","attrs","add","del","childs","parent"],[ASTYMerge,"merge"],[ASTYWalk,"walk"],[ASTYDump,"dump"]];return t.forEach(function(e){var t=e[0].prototype;e.slice(1).forEach(function(e){r.ASTYNode.prototype[e]=t[e]})}),this}return _prototypeProperties(e,null,{version:{value:function(){return ASTYVersion},writable:!0,configurable:!0},extend:{value:function(e){for(var r in e)e.hasOwnProperty(r)&&(this.ASTYNode.prototype[r]=e[r]);return this},writable:!0,configurable:!0},create:{value:function(e){return(new this.ASTYNode).init(e)},writable:!0,configurable:!0},isA:{value:function(e){return"object"==typeof e&&e instanceof this.ASTYNode&&"boolean"==typeof e.ASTy&&e.ASTy===!0},writable:!0,configurable:!0}}),e}();module.exports=ASTYCtx; | ||
},{"./asty-base.js":1,"./asty-dump.js":2,"./asty-merge.js":3,"./asty-version.js":4,"./asty-walk.js":5}]},{},[1,2,3,4,5,6])(6) | ||
}); | ||
@@ -38,0 +40,0 @@ |
@@ -374,2 +374,43 @@ /* | ||
/* | ||
** ASTy -- Abstract Syntax Tree (AST) Data Structure | ||
** Copyright (c) 2014-2015 Ralf S. Engelschall <rse@engelschall.com> | ||
** | ||
** Permission is hereby granted, free of charge, to any person obtaining | ||
** a copy of this software and associated documentation files (the | ||
** "Software"), to deal in the Software without restriction, including | ||
** without limitation the rights to use, copy, modify, merge, publish, | ||
** distribute, sublicense, and/or sell copies of the Software, and to | ||
** permit persons to whom the Software is furnished to do so, subject to | ||
** the following conditions: | ||
** | ||
** The above copyright notice and this permission notice shall be included | ||
** in all copies or substantial portions of the Software. | ||
** | ||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
/* global 1: false */ | ||
/* global 0: false */ | ||
/* global 4: false */ | ||
/* global 20150211: false */ | ||
var version = { | ||
major: 1, | ||
minor: 0, | ||
micro: 4, | ||
date: 20150211 | ||
}; | ||
module.exports = version; | ||
},{}],5:[function(_dereq_,module,exports){ | ||
"use strict"; | ||
var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; | ||
@@ -433,5 +474,7 @@ | ||
},{}],5:[function(_dereq_,module,exports){ | ||
},{}],6:[function(_dereq_,module,exports){ | ||
"use strict"; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; | ||
var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; | ||
@@ -465,7 +508,12 @@ | ||
var ASTYBase = _dereq_("./asty-base.js"); | ||
var ASTYMerge = _dereq_("./asty-merge.js"); | ||
var ASTYWalk = _dereq_("./asty-walk.js"); | ||
var ASTYDump = _dereq_("./asty-dump.js"); | ||
var ASTYBase = _interopRequire(_dereq_("./asty-base.js")); | ||
var ASTYMerge = _interopRequire(_dereq_("./asty-merge.js")); | ||
var ASTYWalk = _interopRequire(_dereq_("./asty-walk.js")); | ||
var ASTYDump = _interopRequire(_dereq_("./asty-dump.js")); | ||
var ASTYVersion = _interopRequire(_dereq_("./asty-version.js")); | ||
var ASTYCtx = (function () { | ||
@@ -488,2 +536,9 @@ function ASTYCtx() { | ||
_prototypeProperties(ASTYCtx, null, { | ||
version: { | ||
value: function version() { | ||
return ASTYVersion; | ||
}, | ||
writable: true, | ||
configurable: true | ||
}, | ||
extend: { | ||
@@ -519,3 +574,3 @@ value: function extend(mixin) { | ||
},{"./asty-base.js":1,"./asty-dump.js":2,"./asty-merge.js":3,"./asty-walk.js":4}]},{},[1,2,3,4,5])(5) | ||
},{"./asty-base.js":1,"./asty-dump.js":2,"./asty-merge.js":3,"./asty-version.js":4,"./asty-walk.js":5}]},{},[1,2,3,4,5,6])(6) | ||
}); |
{ | ||
"name": "asty", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Abstract Syntax Tree (AST) Data Structure", | ||
@@ -29,8 +29,10 @@ "keywords": [ "ast", "abstract", "syntax", "tree", "data", "structure" ], | ||
"grunt-mocha-test": "~0.12.7", | ||
"chai": "~1.10.0", | ||
"grunt-jscs": "~1.5.0", | ||
"chai": "~2.0.0", | ||
"6to5ify": "~4.1.0", | ||
"minifyify": "~6.1.0", | ||
"browserify-header": "~0.9.1", | ||
"browserify-derequire": "~0.9.1" | ||
"browserify-derequire": "~0.9.1", | ||
"browserify-replace": "~0.9.0" | ||
} | ||
} |
@@ -25,3 +25,3 @@ /* | ||
class ASTYBase { | ||
export default class ASTYBase { | ||
/* AST node initialization */ | ||
@@ -159,3 +159,1 @@ init (T, A, C) { | ||
module.exports = ASTYBase | ||
@@ -25,3 +25,3 @@ /* | ||
class ASTYDump { | ||
export default class ASTYDump { | ||
/* dump the AST recursively */ | ||
@@ -77,3 +77,1 @@ dump (maxDepth) { | ||
module.exports = ASTYDump | ||
@@ -25,3 +25,3 @@ /* | ||
class ASTYMerge { | ||
export default class ASTYMerge { | ||
/* merge attributes and childs of an AST node */ | ||
@@ -55,3 +55,1 @@ merge (node, takePos, attrMap) { | ||
module.exports = ASTYMerge | ||
@@ -25,3 +25,3 @@ /* | ||
class ASTYWalk { | ||
export default class ASTYWalk { | ||
/* walk the AST recursively */ | ||
@@ -45,3 +45,1 @@ walk (cb, when) { | ||
module.exports = ASTYWalk | ||
@@ -25,8 +25,9 @@ /* | ||
let ASTYBase = require("./asty-base.js") | ||
let ASTYMerge = require("./asty-merge.js") | ||
let ASTYWalk = require("./asty-walk.js") | ||
let ASTYDump = require("./asty-dump.js") | ||
import ASTYBase from "./asty-base.js" | ||
import ASTYMerge from "./asty-merge.js" | ||
import ASTYWalk from "./asty-walk.js" | ||
import ASTYDump from "./asty-dump.js" | ||
import ASTYVersion from "./asty-version.js" | ||
let ASTYCtx = class ASTYCtx { | ||
export default class ASTYCtx { | ||
constructor () { | ||
@@ -48,2 +49,5 @@ this.ASTYNode = () => {} | ||
} | ||
version () { | ||
return ASTYVersion | ||
} | ||
extend (mixin) { | ||
@@ -68,3 +72,1 @@ for (let method in mixin) | ||
module.exports = ASTYCtx | ||
@@ -27,2 +27,3 @@ /* | ||
/* global it: false */ | ||
/* jshint -W030 */ | ||
@@ -39,3 +40,3 @@ var chai = require("chai") | ||
var node = asty.create("foo") | ||
expect(asty.isA(node)).to.be.true() | ||
expect(asty.isA(node)).to.be.true | ||
expect(node).to.be.a("object") | ||
@@ -42,0 +43,0 @@ expect(node).to.include.keys("T", "L", "A", "P", "C") |
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
94073
19
1288
13