Commit 762b95bc authored by Cholgrrr's avatar Cholgrrr
Browse files

Merge branch 'New_Structure' of https://gitlab.com/Cholgrrr/m4labplatform into New_Structure

parents 613a2f33 a2e8cafb
{ {
"_from": "@vue/babel-preset-jsx@^1.0.0", "name": "@vue/babel-preset-jsx",
"_id": "@vue/babel-preset-jsx@1.1.2", "version": "1.1.2",
"_inBundle": false, "description": "Babel preset for Vue JSX",
"_integrity": "sha512-zDpVnFpeC9YXmvGIDSsKNdL7qCG2rA3gjywLYHPCKDT10erjxF4U+6ay9X6TW5fl4GsDlJp9bVfAVQAAVzxxvQ==", "main": "dist/plugin.cjs.js",
"_location": "/@vue/babel-preset-jsx", "repository": "https://github.com/vuejs/jsx/tree/master/packages/babel-preset-jsx",
"_phantomChildren": {}, "author": "Nick Messing <dot.nick.dot.messing@gmail.com>",
"_requested": { "license": "MIT",
"type": "range", "private": false,
"registry": true, "files": [],
"raw": "@vue/babel-preset-jsx@^1.0.0", "scripts": {
"name": "@vue/babel-preset-jsx", "build": "rollup -c",
"escapedName": "@vue%2fbabel-preset-jsx", "prerelease": "yarn build"
"scope": "@vue",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/@vue/babel-preset-app"
],
"_resolved": "https://registry.npmjs.org/@vue/babel-preset-jsx/-/babel-preset-jsx-1.1.2.tgz",
"_shasum": "2e169eb4c204ea37ca66c2ea85a880bfc99d4f20",
"_spec": "@vue/babel-preset-jsx@^1.0.0",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@vue\\babel-preset-app",
"author": {
"name": "Nick Messing",
"email": "dot.nick.dot.messing@gmail.com"
}, },
"bundleDependencies": false,
"dependencies": { "dependencies": {
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0", "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"@vue/babel-plugin-transform-vue-jsx": "^1.1.2", "@vue/babel-plugin-transform-vue-jsx": "^1.1.2",
...@@ -36,28 +20,12 @@ ...@@ -36,28 +20,12 @@
"@vue/babel-sugar-v-model": "^1.1.2", "@vue/babel-sugar-v-model": "^1.1.2",
"@vue/babel-sugar-v-on": "^1.1.2" "@vue/babel-sugar-v-on": "^1.1.2"
}, },
"deprecated": false,
"description": "Babel preset for Vue JSX",
"devDependencies": { "devDependencies": {
"rollup": "^0.67.4", "rollup": "^0.67.4",
"rollup-plugin-babel-minify": "^6.2.0" "rollup-plugin-babel-minify": "^6.2.0"
}, },
"files": [],
"gitHead": "67d6d39beab9f853118b4e0bbe901f5899ae7245",
"license": "MIT",
"main": "dist/plugin.cjs.js",
"name": "@vue/babel-preset-jsx",
"peerDependencies": { "peerDependencies": {
"@babel/core": "^7.0.0-0" "@babel/core": "^7.0.0-0"
}, },
"private": false, "gitHead": "67d6d39beab9f853118b4e0bbe901f5899ae7245"
"repository": {
"type": "git",
"url": "https://github.com/vuejs/jsx/tree/master/packages/babel-preset-jsx"
},
"scripts": {
"build": "rollup -c",
"prerelease": "yarn build"
},
"version": "1.1.2"
} }
{ {
"_from": "@vue/babel-sugar-functional-vue@^1.1.2", "name": "@vue/babel-sugar-functional-vue",
"_id": "@vue/babel-sugar-functional-vue@1.1.2", "version": "1.1.2",
"_inBundle": false,
"_integrity": "sha512-YhmdJQSVEFF5ETJXzrMpj0nkCXEa39TvVxJTuVjzvP2rgKhdMmQzlJuMv/HpadhZaRVMCCF3AEjjJcK5q/cYzQ==",
"_location": "/@vue/babel-sugar-functional-vue",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@vue/babel-sugar-functional-vue@^1.1.2",
"name": "@vue/babel-sugar-functional-vue",
"escapedName": "@vue%2fbabel-sugar-functional-vue",
"scope": "@vue",
"rawSpec": "^1.1.2",
"saveSpec": null,
"fetchSpec": "^1.1.2"
},
"_requiredBy": [
"/@vue/babel-preset-jsx"
],
"_resolved": "https://registry.npmjs.org/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.1.2.tgz",
"_shasum": "f7e24fba09e6f1ee70104560a8808057555f1a9a",
"_spec": "@vue/babel-sugar-functional-vue@^1.1.2",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@vue\\babel-preset-jsx",
"author": {
"name": "Nick Messing",
"email": "dot.nick.dot.messing@gmail.com"
},
"bundleDependencies": false,
"dependencies": {
"@babel/plugin-syntax-jsx": "^7.2.0"
},
"deprecated": false,
"description": "Babel syntactic sugar for functional components", "description": "Babel syntactic sugar for functional components",
"main": "dist/plugin.js",
"repository": "https://github.com/vuejs/jsx/tree/master/packages/babel-sugar-functional-vue",
"author": "Nick Messing <dot.nick.dot.messing@gmail.com>",
"license": "MIT",
"private": false,
"files": [],
"scripts": {
"prepublish": "yarn build",
"build": "rollup -c",
"build:test": "rollup -c rollup.config.testing.js",
"pretest": "yarn build:test",
"test": "nyc --reporter=html --reporter=text-summary ava -v test/test.js"
},
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.2.0", "@babel/cli": "^7.2.0",
"@babel/core": "^7.2.0", "@babel/core": "^7.2.0",
...@@ -45,31 +27,17 @@ ...@@ -45,31 +27,17 @@
"rollup-plugin-istanbul": "^2.0.1", "rollup-plugin-istanbul": "^2.0.1",
"vue": "^2.5.17" "vue": "^2.5.17"
}, },
"files": [], "dependencies": {
"gitHead": "67d6d39beab9f853118b4e0bbe901f5899ae7245", "@babel/plugin-syntax-jsx": "^7.2.0"
"license": "MIT", },
"main": "dist/plugin.js", "peerDependencies": {
"name": "@vue/babel-sugar-functional-vue", "@babel/core": "^7.0.0-0"
},
"nyc": { "nyc": {
"exclude": [ "exclude": [
"dist", "dist",
"test" "test"
] ]
}, },
"peerDependencies": { "gitHead": "67d6d39beab9f853118b4e0bbe901f5899ae7245"
"@babel/core": "^7.0.0-0"
},
"private": false,
"repository": {
"type": "git",
"url": "https://github.com/vuejs/jsx/tree/master/packages/babel-sugar-functional-vue"
},
"scripts": {
"build": "rollup -c",
"build:test": "rollup -c rollup.config.testing.js",
"prepublish": "yarn build",
"pretest": "yarn build:test",
"test": "nyc --reporter=html --reporter=text-summary ava -v test/test.js"
},
"version": "1.1.2"
} }
{ {
"_from": "@vue/babel-sugar-inject-h@^1.1.2", "name": "@vue/babel-sugar-inject-h",
"_id": "@vue/babel-sugar-inject-h@1.1.2", "version": "1.1.2",
"_inBundle": false,
"_integrity": "sha512-VRSENdTvD5htpnVp7i7DNuChR5rVMcORdXjvv5HVvpdKHzDZAYiLSD+GhnhxLm3/dMuk8pSzV+k28ECkiN5m8w==",
"_location": "/@vue/babel-sugar-inject-h",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@vue/babel-sugar-inject-h@^1.1.2",
"name": "@vue/babel-sugar-inject-h",
"escapedName": "@vue%2fbabel-sugar-inject-h",
"scope": "@vue",
"rawSpec": "^1.1.2",
"saveSpec": null,
"fetchSpec": "^1.1.2"
},
"_requiredBy": [
"/@vue/babel-preset-jsx"
],
"_resolved": "https://registry.npmjs.org/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.1.2.tgz",
"_shasum": "8a5276b6d8e2ed16ffc8078aad94236274e6edf0",
"_spec": "@vue/babel-sugar-inject-h@^1.1.2",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@vue\\babel-preset-jsx",
"author": {
"name": "Nick Messing",
"email": "dot.nick.dot.messing@gmail.com"
},
"bundleDependencies": false,
"dependencies": {
"@babel/plugin-syntax-jsx": "^7.2.0"
},
"deprecated": false,
"description": "Babel syntactic sugar for h automatic injection for Vue JSX", "description": "Babel syntactic sugar for h automatic injection for Vue JSX",
"main": "dist/plugin.js",
"repository": "https://github.com/vuejs/jsx/tree/master/packages/babel-sugar-inject-h",
"author": "Nick Messing <dot.nick.dot.messing@gmail.com>",
"license": "MIT",
"private": false,
"files": [],
"scripts": {
"prepublish": "yarn build",
"build": "rollup -c",
"build:test": "rollup -c rollup.config.testing.js",
"pretest": "yarn build:test",
"test": "nyc --reporter=html --reporter=text-summary ava -v test/test.js"
},
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.2.0", "@babel/cli": "^7.2.0",
"@babel/core": "^7.2.0", "@babel/core": "^7.2.0",
...@@ -45,31 +27,17 @@ ...@@ -45,31 +27,17 @@
"rollup-plugin-uglify-es": "^0.0.1", "rollup-plugin-uglify-es": "^0.0.1",
"vue": "^2.5.17" "vue": "^2.5.17"
}, },
"files": [], "dependencies": {
"gitHead": "67d6d39beab9f853118b4e0bbe901f5899ae7245", "@babel/plugin-syntax-jsx": "^7.2.0"
"license": "MIT", },
"main": "dist/plugin.js", "peerDependencies": {
"name": "@vue/babel-sugar-inject-h", "@babel/core": "^7.0.0-0"
},
"nyc": { "nyc": {
"exclude": [ "exclude": [
"dist", "dist",
"test" "test"
] ]
}, },
"peerDependencies": { "gitHead": "67d6d39beab9f853118b4e0bbe901f5899ae7245"
"@babel/core": "^7.0.0-0"
},
"private": false,
"repository": {
"type": "git",
"url": "https://github.com/vuejs/jsx/tree/master/packages/babel-sugar-inject-h"
},
"scripts": {
"build": "rollup -c",
"build:test": "rollup -c rollup.config.testing.js",
"prepublish": "yarn build",
"pretest": "yarn build:test",
"test": "nyc --reporter=html --reporter=text-summary ava -v test/test.js"
},
"version": "1.1.2"
} }
{ {
"_from": "@vue/babel-sugar-v-model@^1.1.2", "name": "@vue/babel-sugar-v-model",
"_id": "@vue/babel-sugar-v-model@1.1.2", "version": "1.1.2",
"_inBundle": false,
"_integrity": "sha512-vLXPvNq8vDtt0u9LqFdpGM9W9IWDmCmCyJXuozlq4F4UYVleXJ2Fa+3JsnTZNJcG+pLjjfnEGHci2339Kj5sGg==",
"_location": "/@vue/babel-sugar-v-model",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@vue/babel-sugar-v-model@^1.1.2",
"name": "@vue/babel-sugar-v-model",
"escapedName": "@vue%2fbabel-sugar-v-model",
"scope": "@vue",
"rawSpec": "^1.1.2",
"saveSpec": null,
"fetchSpec": "^1.1.2"
},
"_requiredBy": [
"/@vue/babel-preset-jsx"
],
"_resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.1.2.tgz",
"_shasum": "1ff6fd1b800223fc9cb1e84dceb5e52d737a8192",
"_spec": "@vue/babel-sugar-v-model@^1.1.2",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@vue\\babel-preset-jsx",
"author": {
"name": "Nick Messing",
"email": "dot.nick.dot.messing@gmail.com"
},
"bundleDependencies": false,
"dependencies": {
"@babel/plugin-syntax-jsx": "^7.2.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"@vue/babel-plugin-transform-vue-jsx": "^1.1.2",
"camelcase": "^5.0.0",
"html-tags": "^2.0.0",
"svg-tags": "^1.0.0"
},
"deprecated": false,
"description": "Babel syntactic sugar for v-model support in Vue JSX", "description": "Babel syntactic sugar for v-model support in Vue JSX",
"main": "dist/plugin.js",
"repository": "https://github.com/vuejs/jsx/tree/master/packages/babel-sugar-v-model",
"author": "Nick Messing <dot.nick.dot.messing@gmail.com>",
"license": "MIT",
"private": false,
"files": [],
"scripts": {
"pretest:snapshot": "yarn build:test",
"test:snapshot": "nyc --reporter=html --reporter=text-summary ava -v test/snapshot.js",
"pretest:functional": "yarn build:test && nyc --reporter=html --reporter=text-summary babel test/functional.js --plugins ./dist/plugin.testing.js,./node_modules/@vue/babel-plugin-transform-vue-jsx/dist/plugin.js --out-file test/functional-compiled.js",
"test:functional": "ava -v test/functional-compiled.js",
"build": "rollup -c",
"build:test": "rollup -c rollup.config.testing.js",
"test": "rm -rf coverage* && yarn test:snapshot && mv coverage coverage-snapshot && yarn test:functional && mv coverage coverage-functional",
"prepublish": "yarn build"
},
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.2.0", "@babel/cli": "^7.2.0",
"@babel/core": "^7.2.0", "@babel/core": "^7.2.0",
...@@ -54,34 +34,22 @@ ...@@ -54,34 +34,22 @@
"vue": "^2.5.17", "vue": "^2.5.17",
"vue-template-compiler": "^2.5.17" "vue-template-compiler": "^2.5.17"
}, },
"files": [], "dependencies": {
"gitHead": "67d6d39beab9f853118b4e0bbe901f5899ae7245", "@babel/plugin-syntax-jsx": "^7.2.0",
"license": "MIT", "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"main": "dist/plugin.js", "@vue/babel-plugin-transform-vue-jsx": "^1.1.2",
"name": "@vue/babel-sugar-v-model", "camelcase": "^5.0.0",
"html-tags": "^2.0.0",
"svg-tags": "^1.0.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"nyc": { "nyc": {
"exclude": [ "exclude": [
"dist", "dist",
"test" "test"
] ]
}, },
"peerDependencies": { "gitHead": "67d6d39beab9f853118b4e0bbe901f5899ae7245"
"@babel/core": "^7.0.0-0"
},
"private": false,
"repository": {
"type": "git",
"url": "https://github.com/vuejs/jsx/tree/master/packages/babel-sugar-v-model"
},
"scripts": {
"build": "rollup -c",
"build:test": "rollup -c rollup.config.testing.js",
"prepublish": "yarn build",
"pretest:functional": "yarn build:test && nyc --reporter=html --reporter=text-summary babel test/functional.js --plugins ./dist/plugin.testing.js,./node_modules/@vue/babel-plugin-transform-vue-jsx/dist/plugin.js --out-file test/functional-compiled.js",
"pretest:snapshot": "yarn build:test",
"test": "rm -rf coverage* && yarn test:snapshot && mv coverage coverage-snapshot && yarn test:functional && mv coverage coverage-functional",
"test:functional": "ava -v test/functional-compiled.js",
"test:snapshot": "nyc --reporter=html --reporter=text-summary ava -v test/snapshot.js"
},
"version": "1.1.2"
} }
{ {
"_from": "@vue/babel-sugar-v-on@^1.1.2", "name": "@vue/babel-sugar-v-on",
"_id": "@vue/babel-sugar-v-on@1.1.2", "version": "1.1.2",
"_inBundle": false,
"_integrity": "sha512-T8ZCwC8Jp2uRtcZ88YwZtZXe7eQrJcfRq0uTFy6ShbwYJyz5qWskRFoVsdTi9o0WEhmQXxhQUewodOSCUPVmsQ==",
"_location": "/@vue/babel-sugar-v-on",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@vue/babel-sugar-v-on@^1.1.2",
"name": "@vue/babel-sugar-v-on",
"escapedName": "@vue%2fbabel-sugar-v-on",
"scope": "@vue",
"rawSpec": "^1.1.2",
"saveSpec": null,
"fetchSpec": "^1.1.2"
},
"_requiredBy": [
"/@vue/babel-preset-jsx"
],
"_resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.1.2.tgz",
"_shasum": "b2ef99b8f2fab09fbead25aad70ef42e1cf5b13b",
"_spec": "@vue/babel-sugar-v-on@^1.1.2",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@vue\\babel-preset-jsx",
"author": {
"name": "Nick Messing",
"email": "dot.nick.dot.messing@gmail.com"
},
"bundleDependencies": false,
"dependencies": {
"@babel/plugin-syntax-jsx": "^7.2.0",
"@vue/babel-plugin-transform-vue-jsx": "^1.1.2",
"camelcase": "^5.0.0"
},
"deprecated": false,
"description": "Babel syntactic sugar for v-model support in Vue JSX", "description": "Babel syntactic sugar for v-model support in Vue JSX",
"main": "dist/plugin.js",
"repository": "https://github.com/vuejs/jsx/tree/master/packages/babel-sugar-v-on",
"author": "Nick Messing <dot.nick.dot.messing@gmail.com>",
"license": "MIT",
"private": false,
"files": [],
"scripts": {
"pretest:snapshot": "yarn build:test",
"test:snapshot": "nyc --reporter=html --reporter=text-summary ava -v test/snapshot.js",
"pretest:functional": "yarn build:test && nyc --reporter=html --reporter=text-summary babel test/functional.js --plugins ./dist/plugin.testing.js,./node_modules/@vue/babel-plugin-transform-vue-jsx/dist/plugin.js --out-file test/functional-compiled.js",
"test:functional": "ava -v test/functional-compiled.js",
"build": "rollup -c",
"build:test": "rollup -c rollup.config.testing.js",
"test": "rm -rf coverage* && yarn test:snapshot && mv coverage coverage-snapshot && yarn test:functional && mv coverage coverage-functional",
"prepublish": "yarn build"
},
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.2.0", "@babel/cli": "^7.2.0",
"@babel/core": "^7.2.0", "@babel/core": "^7.2.0",
...@@ -52,34 +35,19 @@ ...@@ -52,34 +35,19 @@
"vue": "^2.5.17", "vue": "^2.5.17",
"vue-template-compiler": "^2.5.17" "vue-template-compiler": "^2.5.17"
}, },
"files": [], "dependencies": {
"gitHead": "67d6d39beab9f853118b4e0bbe901f5899ae7245", "@babel/plugin-syntax-jsx": "^7.2.0",
"license": "MIT", "@vue/babel-plugin-transform-vue-jsx": "^1.1.2",
"main": "dist/plugin.js", "camelcase": "^5.0.0"
"name": "@vue/babel-sugar-v-on", },
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"nyc": { "nyc": {
"exclude": [ "exclude": [
"dist", "dist",
"test" "test"
] ]
}, },
"peerDependencies": { "gitHead": "67d6d39beab9f853118b4e0bbe901f5899ae7245"
"@babel/core": "^7.0.0-0"
},
"private": false,
"repository": {
"type": "git",
"url": "https://github.com/vuejs/jsx/tree/master/packages/babel-sugar-v-on"
},
"scripts": {
"build": "rollup -c",
"build:test": "rollup -c rollup.config.testing.js",
"prepublish": "yarn build",
"pretest:functional": "yarn build:test && nyc --reporter=html --reporter=text-summary babel test/functional.js --plugins ./dist/plugin.testing.js,./node_modules/@vue/babel-plugin-transform-vue-jsx/dist/plugin.js --out-file test/functional-compiled.js",
"pretest:snapshot": "yarn build:test",
"test": "rm -rf coverage* && yarn test:snapshot && mv coverage coverage-snapshot && yarn test:functional && mv coverage coverage-functional",
"test:functional": "ava -v test/functional-compiled.js",
"test:snapshot": "nyc --reporter=html --reporter=text-summary ava -v test/snapshot.js"
},
"version": "1.1.2"
} }
{ {
"_from": "abbrev@1", "name": "abbrev",
"_id": "abbrev@1.1.1", "version": "1.1.1",
"_inBundle": false,
"_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"_location": "/abbrev",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "abbrev@1",
"name": "abbrev",
"escapedName": "abbrev",
"rawSpec": "1",
"saveSpec": null,
"fetchSpec": "1"
},
"_requiredBy": [
"/nopt"
],
"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8",
"_spec": "abbrev@1",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\nopt",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me"
},
"bugs": {
"url": "https://github.com/isaacs/abbrev-js/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Like ruby's abbrev module, but in js", "description": "Like ruby's abbrev module, but in js",
"author": "Isaac Z. Schlueter <i@izs.me>",
"main": "abbrev.js",
"scripts": {
"test": "tap test.js --100",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --all; git push origin --tags"
},
"repository": "http://github.com/isaacs/abbrev-js",
"license": "ISC",
"devDependencies": { "devDependencies": {
"tap": "^10.1" "tap": "^10.1"
}, },
"files": [ "files": [
"abbrev.js" "abbrev.js"
], ]
"homepage": "https://github.com/isaacs/abbrev-js#readme",
"license": "ISC",
"main": "abbrev.js",
"name": "abbrev",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
},
"scripts": {
"postpublish": "git push origin --all; git push origin --tags",
"postversion": "npm publish",
"preversion": "npm test",
"test": "tap test.js --100"
},
"version": "1.1.1"
} }
{ {
"_from": "accepts@~1.3.7", "name": "accepts",
"_id": "accepts@1.3.7", "description": "Higher-level content negotiation",
"_inBundle": false, "version": "1.3.7",
"_integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
"_location": "/accepts",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "accepts@~1.3.7",
"name": "accepts",
"escapedName": "accepts",
"rawSpec": "~1.3.7",
"saveSpec": null,
"fetchSpec": "~1.3.7"
},
"_requiredBy": [
"/express"
],
"_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
"_shasum": "531bc726517a3b2b41f850021c6cc15eaab507cd",
"_spec": "accepts@~1.3.7",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\express",
"bugs": {
"url": "https://github.com/jshttp/accepts/issues"
},
"bundleDependencies": false,
"contributors": [ "contributors": [
{ "Douglas Christopher Wilson <doug@somethingdoug.com>",
"name": "Douglas Christopher Wilson", "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
"email": "doug@somethingdoug.com"
},
{
"name": "Jonathan Ong",
"email": "me@jongleberry.com",
"url": "http://jongleberry.com"
}
], ],
"license": "MIT",
"repository": "jshttp/accepts",
"dependencies": { "dependencies": {
"mime-types": "~2.1.24", "mime-types": "~2.1.24",
"negotiator": "0.6.2" "negotiator": "0.6.2"
}, },
"deprecated": false,
"description": "Higher-level content negotiation",
"devDependencies": { "devDependencies": {
"deep-equal": "1.0.1", "deep-equal": "1.0.1",
"eslint": "5.16.0", "eslint": "5.16.0",
...@@ -55,26 +24,13 @@ ...@@ -55,26 +24,13 @@
"mocha": "6.1.4", "mocha": "6.1.4",
"nyc": "14.0.0" "nyc": "14.0.0"
}, },
"engines": {
"node": ">= 0.6"
},
"files": [ "files": [
"LICENSE", "LICENSE",
"HISTORY.md", "HISTORY.md",
"index.js" "index.js"
], ],
"homepage": "https://github.com/jshttp/accepts#readme", "engines": {
"keywords": [ "node": ">= 0.6"
"content",
"negotiation",
"accept",
"accepts"
],
"license": "MIT",
"name": "accepts",
"repository": {
"type": "git",
"url": "git+https://github.com/jshttp/accepts.git"
}, },
"scripts": { "scripts": {
"lint": "eslint --plugin markdown --ext js,md .", "lint": "eslint --plugin markdown --ext js,md .",
...@@ -82,5 +38,10 @@ ...@@ -82,5 +38,10 @@
"test-cov": "nyc --reporter=html --reporter=text npm test", "test-cov": "nyc --reporter=html --reporter=text npm test",
"test-travis": "nyc --reporter=text npm test" "test-travis": "nyc --reporter=text npm test"
}, },
"version": "1.3.7" "keywords": [
"content",
"negotiation",
"accept",
"accepts"
]
} }
# 2.0.2
- Fixing parsing of `yield import()`.
# 2.0.1
- Removing unnecessary `in-publish` dependency.
# 2.0.0
- Updating acorn version to >= 4.
# 1.0.1
- Fixes for publishing the module.
# 1.0.0
- Initial release of plugin.
MIT License
Copyright (c) 2016 Jordan Gensler
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.
# Dynamic import support in acorn
This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript.
For more information, check out the [proposal repo](https://github.com/tc39/proposal-dynamic-import).
## Usage
You can use this module directly in order to get Acorn instance with plugin installed:
```js
import acorn from 'acorn-dynamic-import';
// or...
const acorn = require('acorn-dynamic-import').default;
```
Or you can use `inject.js` for injecting plugin into your own version of Acorn like this:
```js
const acorn = require('acorn-dynamic-import/lib/inject').default(require('./custom-acorn'));
```
Then, use the `plugins` option whenever you need to support dynamicImport while parsing:
```js
const ast = acorn.parse(code, {
plugins: { dynamicImport: true }
});
```
## License
This plugin is issued under the [MIT license](./LICENSE).
Object.defineProperty(exports, "__esModule", {
value: true
});
var _acorn = require('acorn');
var acorn = _interopRequireWildcard(_acorn);
var _inject = require('./inject');
var _inject2 = _interopRequireDefault(_inject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
exports['default'] = (0, _inject2['default'])(acorn);
\ No newline at end of file
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = injectDynamicImport;
/* eslint-disable no-underscore-dangle */
function injectDynamicImport(acorn) {
var tt = acorn.tokTypes;
// NOTE: This allows `yield import()` to parse correctly.
tt._import.startsExpr = true;
function parseDynamicImport() {
var node = this.startNode();
this.next();
if (this.type !== tt.parenL) {
this.unexpected();
}
return this.finishNode(node, 'Import');
}
function peekNext() {
return this.input[this.pos];
}
// eslint-disable-next-line no-param-reassign
acorn.plugins.dynamicImport = function () {
function dynamicImportPlugin(instance) {
instance.extend('parseStatement', function (nextMethod) {
return function () {
function parseStatement() {
var node = this.startNode();
if (this.type === tt._import) {
var nextToken = peekNext.call(this);
if (nextToken === tt.parenL.label) {
var expr = this.parseExpression();
return this.parseExpressionStatement(node, expr);
}
}
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return nextMethod.apply(this, args);
}
return parseStatement;
}();
});
instance.extend('parseExprAtom', function (nextMethod) {
return function () {
function parseExprAtom(refDestructuringErrors) {
if (this.type === tt._import) {
return parseDynamicImport.call(this);
}
return nextMethod.call(this, refDestructuringErrors);
}
return parseExprAtom;
}();
});
}
return dynamicImportPlugin;
}();
return acorn;
}
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../acorn/bin/acorn" "$@"
ret=$?
else
node "$basedir/../acorn/bin/acorn" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\acorn\bin\acorn" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\acorn\bin\acorn" %*
)
\ No newline at end of file
/.tern-port
/test
/local
/rollup
/bin/generate-identifier-regex.js
/bin/update_authors.sh
.editorconfig
.gitattributes
.tern-project
.travis.yml
List of Acorn contributors. Updated before every release.
Adrian Rakovsky
Alistair Braidwood
Amila Welihinda
Andres Suarez
Angelo
Aparajita Fishman
Arian Stolwijk
Artem Govorov
Brandon Mills
Charles Hughes
Conrad Irwin
Daniel Tschinder
David Bonnet
Domenico Matteo
Forbes Lindesay
Gilad Peleg
impinball
Ingvar Stepanyan
Jackson Ray Hamilton
Jesse McCarthy
Jiaxing Wang
Joel Kemp
Johannes Herr
Jordan Klassen
Jürg Lehni
Kai Cataldo
keeyipchan
Keheliya Gallaba
Kevin Irish
Kevin Kwok
krator
Marijn Haverbeke
Martin Carlberg
Mat Garcia
Mathias Bynens
Mathieu 'p01' Henri
Matthew Bastien
Max Schaefer
Max Zerzouri
Mihai Bazon
Mike Rennie
naoh
Nicholas C. Zakas
Nick Fitzgerald
Olivier Thomann
Oskar Schöldström
Paul Harper
Peter Rust
PlNG
Prayag Verma
ReadmeCritic
r-e-d
Richard Gibson
Rich Harris
Sebastian McKenzie
Simen Bekkhus
Timothy Gu
Toru Nagashima
Wexpo Lyu
zsjforcn
## 4.0.11 (2017-02-07)
### Bug fixes
Allow all forms of member expressions to be parenthesized as lvalue.
## 4.0.10 (2017-02-07)
### Bug fixes
Don't expect semicolons after default-exported functions or classes,
even when they are expressions.
Check for use of `'use strict'` directives in non-simple parameter
functions, even when already in strict mode.
## 4.0.9 (2017-02-06)
### Bug fixes
Fix incorrect error raised for parenthesized simple assignment
targets, so that `(x) = 1` parses again.
## 4.0.8 (2017-02-03)
### Bug fixes
Solve spurious parenthesized pattern errors by temporarily erring on
the side of accepting programs that our delayed errors don't handle
correctly yet.
## 4.0.7 (2017-02-02)
### Bug fixes
Accept invalidly rejected code like `(x).y = 2` again.
Don't raise an error when a function _inside_ strict code has a
non-simple parameter list.
## 4.0.6 (2017-02-02)
### Bug fixes
Fix exponential behavior (manifesting itself as a complete hang for
even relatively small source files) introduced by the new 'use strict'
check.
## 4.0.5 (2017-02-02)
### Bug fixes
Disallow parenthesized pattern expressions.
Allow keywords as export names.
Don't allow the `async` keyword to be parenthesized.
Properly raise an error when a keyword contains a character escape.
Allow `"use strict"` to appear after other string literal expressions.
Disallow labeled declarations.
## 4.0.4 (2016-12-19)
### Bug fixes
Fix issue with loading acorn_loose.js with an AMD loader.
Fix crash when `export` was followed by a keyword that can't be
exported.
## 4.0.3 (2016-08-16)
### Bug fixes
Allow regular function declarations inside single-statement `if`
branches in loose mode. Forbid them entirely in strict mode.
Properly parse properties named `async` in ES2017 mode.
Fix bug where reserved words were broken in ES2017 mode.
## 4.0.2 (2016-08-11)
### Bug fixes
Don't ignore period or 'e' characters after octal numbers.
Fix broken parsing for call expressions in default parameter values
of arrow functions.
## 4.0.1 (2016-08-08)
### Bug fixes
Fix false positives in duplicated export name errors.
## 4.0.0 (2016-08-07)
### Breaking changes
The default `ecmaVersion` option value is now 7.
A number of internal method signatures changed, so plugins might need
to be updated.
### Bug fixes
The parser now raises errors on duplicated export names.
`arguments` and `eval` can now be used in shorthand properties.
Duplicate parameter names in non-simple argument lists now always
produce an error.
### New features
The `ecmaVersion` option now also accepts year-style version numbers
(2015, etc).
Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
Support for trailing commas in call expressions when `ecmaVersion`
is >= 8.
## 3.3.0 (2016-07-25)
### Bug fixes
Fix bug in tokenizing of regexp operator after a function declaration.
Fix parser crash when parsing an array pattern with a hole.
### New features
Implement check against complex argument lists in functions that
enable strict mode in ES7.
## 3.2.0 (2016-06-07)
### Bug fixes
Improve handling of lack of unicode regexp support in host
environment.
Properly reject shorthand properties whose name is a keyword.
Don't crash when the loose parser is called without options object.
### New features
Visitors created with `visit.make` now have their base as _prototype_,
rather than copying properties into a fresh object.
Make it possible to use `visit.ancestor` with a walk state.
## 3.1.0 (2016-04-18)
### Bug fixes
Fix issue where the loose parser created invalid TemplateElement nodes
for unclosed template literals.
Properly tokenize the division operator directly after a function
expression.
Allow trailing comma in destructuring arrays.
### New features
The walker now allows defining handlers for `CatchClause` nodes.
## 3.0.4 (2016-02-25)
### Fixes
Allow update expressions as left-hand-side of the ES7 exponential
operator.
## 3.0.2 (2016-02-10)
### Fixes
Fix bug that accidentally made `undefined` a reserved word when
parsing ES7.
## 3.0.0 (2016-02-10)
### Breaking changes
The default value of the `ecmaVersion` option is now 6 (used to be 5).
Support for comprehension syntax (which was dropped from the draft
spec) has been removed.
### Fixes
`let` and `yield` are now “contextual keywords”, meaning you can
mostly use them as identifiers in ES5 non-strict code.
A parenthesized class or function expression after `export default` is
now parsed correctly.
### New features
When `ecmaVersion` is set to 7, Acorn will parse the exponentiation
operator (`**`).
The identifier character ranges are now based on Unicode 8.0.0.
Plugins can now override the `raiseRecoverable` method to override the
way non-critical errors are handled.
## 2.7.0 (2016-01-04)
### Fixes
Stop allowing rest parameters in setters.
Make sure the loose parser always attaches a `local` property to
`ImportNamespaceSpecifier` nodes.
Disallow `y` rexexp flag in ES5.
Disallow `\00` and `\000` escapes in strict mode.
Raise an error when an import name is a reserved word.
## 2.6.4 (2015-11-12)
### Fixes
Fix crash in loose parser when parsing invalid object pattern.
### New features
Support plugins in the loose parser.
## 2.6.2 (2015-11-10)
### Fixes
Don't crash when no options object is passed.
## 2.6.0 (2015-11-09)
### Fixes
Add `await` as a reserved word in module sources.
Disallow `yield` in a parameter default value for a generator.
Forbid using a comma after a rest pattern in an array destructuring.
### New features
Support parsing stdin in command-line tool.
## 2.5.2 (2015-10-27)
### Fixes
Fix bug where the walker walked an exported `let` statement as an
expression.
## 2.5.0 (2015-10-27)
### Fixes
Fix tokenizer support in the command-line tool.
In the loose parser, don't allow non-string-literals as import
sources.
Stop allowing `new.target` outside of functions.
Remove legacy `guard` and `guardedHandler` properties from try nodes.
Stop allowing multiple `__proto__` properties on an object literal in
strict mode.
Don't allow rest parameters to be non-identifier patterns.
Check for duplicate paramter names in arrow functions.
Copyright (C) 2012-2016 by various contributors (see AUTHORS)
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.
# Acorn
[![Build Status](https://travis-ci.org/ternjs/acorn.svg?branch=master)](https://travis-ci.org/ternjs/acorn)
[![NPM version](https://img.shields.io/npm/v/acorn.svg)](https://www.npmjs.com/package/acorn)
[![CDNJS](https://img.shields.io/cdnjs/v/acorn.svg)](https://cdnjs.com/libraries/acorn)
[Author funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?force)](https://marijnhaverbeke.nl/fund/)
A tiny, fast JavaScript parser, written completely in JavaScript.
## Community
Acorn is open source software released under an
[MIT license](https://github.com/ternjs/acorn/blob/master/LICENSE).
You are welcome to
[report bugs](https://github.com/ternjs/acorn/issues) or create pull
requests on [github](https://github.com/ternjs/acorn). For questions
and discussion, please use the
[Tern discussion forum](https://discuss.ternjs.net).
## Installation
The easiest way to install acorn is with [`npm`][npm].
[npm]: https://www.npmjs.com/
```sh
npm install acorn
```
Alternately, download the source.
```sh
git clone https://github.com/ternjs/acorn.git
```
## Components
When run in a CommonJS (node.js) or AMD environment, exported values
appear in the interfaces exposed by the individual files, as usual.
When loaded in the browser (Acorn works in any JS-enabled browser more
recent than IE5) without any kind of module management, a single
global object `acorn` will be defined, and all the exported properties
will be added to that.
### Main parser
This is implemented in `dist/acorn.js`, and is what you get when you
`require("acorn")` in node.js.
**parse**`(input, options)` is used to parse a JavaScript program.
The `input` parameter is a string, `options` can be undefined or an
object setting some of the options listed below. The return value will
be an abstract syntax tree object as specified by the
[ESTree spec][estree].
When encountering a syntax error, the parser will raise a
`SyntaxError` object with a meaningful message. The error object will
have a `pos` property that indicates the character offset at which the
error occurred, and a `loc` object that contains a `{line, column}`
object referring to that same position.
[estree]: https://github.com/estree/estree
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
either 3, 5, 6 (2015), 7 (2016), or 8 (2017). This influences support for strict
mode, the set of reserved words, and support for new syntax features.
Default is 7.
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
implemented by Acorn.
- **sourceType**: Indicate the mode the code should be parsed in. Can be
either `"script"` or `"module"`. This influences global strict mode
and parsing of `import` and `export` declarations.
- **onInsertedSemicolon**: If given a callback, that callback will be
called whenever a missing semicolon is inserted by the parser. The
callback will be given the character offset of the point where the
semicolon is inserted as argument, and if `locations` is on, also a
`{line, column}` object representing this position.
- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
commas.
- **allowReserved**: If `false`, using a reserved word will generate
an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher
versions. When given the value `"never"`, reserved words and
keywords can also not be used as property names (as in Internet
Explorer's old parser).
- **allowReturnOutsideFunction**: By default, a return statement at
the top level raises an error. Set this to `true` to accept such
code.
- **allowImportExportEverywhere**: By default, `import` and `export`
declarations can only appear at a program's top level. Setting this
option to `true` allows them anywhere where a statement is allowed.
- **allowHashBang**: When this is enabled (off by default), if the
code starts with the characters `#!` (as in a shellscript), the
first line will be treated as a comment.
- **locations**: When `true`, each node has a `loc` object attached
with `start` and `end` subobjects, each of which contains the
one-based line and zero-based column numbers in `{line, column}`
form. Default is `false`.
- **onToken**: If a function is passed for this option, each found
token will be passed in same format as tokens returned from
`tokenizer().getToken()`.
If array is passed, each found token is pushed to it.
Note that you are not allowed to call the parser from the
callback—that will corrupt its internal state.
- **onComment**: If a function is passed for this option, whenever a
comment is encountered the function will be called with the
following parameters:
- `block`: `true` if the comment is a block comment, false if it
is a line comment.
- `text`: The content of the comment.
- `start`: Character offset of the start of the comment.
- `end`: Character offset of the end of the comment.
When the `locations` options is on, the `{line, column}` locations
of the comment’s start and end are passed as two additional
parameters.
If array is passed for this option, each found comment is pushed
to it as object in Esprima format:
```javascript
{
"type": "Line" | "Block",
"value": "comment text",
"start": Number,
"end": Number,
// If `locations` option is on:
"loc": {
"start": {line: Number, column: Number}
"end": {line: Number, column: Number}
},
// If `ranges` option is on:
"range": [Number, Number]
}
```
Note that you are not allowed to call the parser from the
callback—that will corrupt its internal state.
- **ranges**: Nodes have their start and end characters offsets
recorded in `start` and `end` properties (directly on the node,
rather than the `loc` object, which holds line/column data. To also
add a [semi-standardized][range] `range` property holding a
`[start, end]` array with the same numbers, set the `ranges` option
to `true`.
- **program**: It is possible to parse multiple files into a single
AST by passing the tree produced by parsing the first file as the
`program` option in subsequent parses. This will add the toplevel
forms of the parsed file to the "Program" (top) node of an existing
parse tree.
- **sourceFile**: When the `locations` option is `true`, you can pass
this option to add a `source` attribute in every node’s `loc`
object. Note that the contents of this option are not examined or
processed in any way; you are free to use whatever format you
choose.
- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
will be added (regardless of the `location` option) directly to the
nodes, rather than the `loc` object.
- **preserveParens**: If this option is `true`, parenthesized expressions
are represented by (non-standard) `ParenthesizedExpression` nodes
that have a single `expression` property containing the expression
inside parentheses.
[range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
**parseExpressionAt**`(input, offset, options)` will parse a single
expression in a string, and return its AST. It will not complain if
there is more of the string left after the expression.
**getLineInfo**`(input, offset)` can be used to get a `{line,
column}` object for a given program string and character offset.
**tokenizer**`(input, options)` returns an object with a `getToken`
method that can be called repeatedly to get the next token, a `{start,
end, type, value}` object (with added `loc` property when the
`locations` option is enabled and `range` property when the `ranges`
option is enabled). When the token's type is `tokTypes.eof`, you
should stop calling the method, since it will keep returning that same
token forever.
In ES6 environment, returned result can be used as any other
protocol-compliant iterable:
```javascript
for (let token of acorn.tokenizer(str)) {
// iterate over the tokens
}
// transform code to array of tokens:
var tokens = [...acorn.tokenizer(str)];
```
**tokTypes** holds an object mapping names to the token type objects
that end up in the `type` properties of tokens.
#### Note on using with [Escodegen][escodegen]
Escodegen supports generating comments from AST, attached in
Esprima-specific format. In order to simulate same format in
Acorn, consider following example:
```javascript
var comments = [], tokens = [];
var ast = acorn.parse('var x = 42; // answer', {
// collect ranges for each node
ranges: true,
// collect comments in Esprima's format
onComment: comments,
// collect token ranges
onToken: tokens
});
// attach comments using collected information
escodegen.attachComments(ast, comments, tokens);
// generate code
console.log(escodegen.generate(ast, {comment: true}));
// > 'var x = 42; // answer'
```
[escodegen]: https://github.com/estools/escodegen
### dist/acorn_loose.js ###
This file implements an error-tolerant parser. It exposes a single
function. The loose parser is accessible in node.js via `require("acorn/dist/acorn_loose")`.
**parse_dammit**`(input, options)` takes the same arguments and
returns the same syntax tree as the `parse` function in `acorn.js`,
but never raises an error, and will do its best to parse syntactically
invalid code in as meaningful a way as it can. It'll insert identifier
nodes with name `"✖"` as placeholders in places where it can't make
sense of the input. Depends on `acorn.js`, because it uses the same
tokenizer.
### dist/walk.js ###
Implements an abstract syntax tree walker. Will store its interface in
`acorn.walk` when loaded without a module system.
**simple**`(node, visitors, base, state)` does a 'simple' walk over
a tree. `node` should be the AST node to walk, and `visitors` an
object with properties whose names correspond to node types in the
[ESTree spec][estree]. The properties should contain functions
that will be called with the node object and, if applicable the state
at that point. The last two arguments are optional. `base` is a walker
algorithm, and `state` is a start state. The default walker will
simply visit all statements and expressions and not produce a
meaningful state. (An example of a use of state is to track scope at
each point in the tree.)
**ancestor**`(node, visitors, base, state)` does a 'simple' walk over
a tree, building up an array of ancestor nodes (including the current node)
and passing the array to the callbacks as a third parameter.
**recursive**`(node, state, functions, base)` does a 'recursive'
walk, where the walker functions are responsible for continuing the
walk on the child nodes of their target node. `state` is the start
state, and `functions` should contain an object that maps node types
to walker functions. Such functions are called with `(node, state, c)`
arguments, and can cause the walk to continue on a sub-node by calling
the `c` argument on it with `(node, state)` arguments. The optional
`base` argument provides the fallback walker functions for node types
that aren't handled in the `functions` object. If not given, the
default walkers will be used.
**make**`(functions, base)` builds a new walker object by using the
walker functions in `functions` and filling in the missing ones by
taking defaults from `base`.
**findNodeAt**`(node, start, end, test, base, state)` tries to
locate a node in a tree at the given start and/or end offsets, which
satisfies the predicate `test`. `start` and `end` can be either `null`
(as wildcard) or a number. `test` may be a string (indicating a node
type) or a function that takes `(nodeType, node)` arguments and
returns a boolean indicating whether this node is interesting. `base`
and `state` are optional, and can be used to specify a custom walker.
Nodes are tested from inner to outer, so if two nodes match the
boundaries, the inner one will be preferred.
**findNodeAround**`(node, pos, test, base, state)` is a lot like
`findNodeAt`, but will match any node that exists 'around' (spanning)
the given position.
**findNodeAfter**`(node, pos, test, base, state)` is similar to
`findNodeAround`, but will match all nodes *after* the given position
(testing outer nodes before inner nodes).
## Command line interface
The `bin/acorn` utility can be used to parse a file from the command
line. It accepts as arguments its input file and the following
options:
- `--ecma3|--ecma5|--ecma6|--ecma7`: Sets the ECMAScript version to parse. Default is
version 5.
- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
- `--locations`: Attaches a "loc" object to each node with "start" and
"end" subobjects, each of which contains the one-based line and
zero-based column numbers in `{line, column}` form.
- `--allow-hash-bang`: If the code starts with the characters #! (as in a shellscript), the first line will be treated as a comment.
- `--compact`: No whitespace is used in the AST output.
- `--silent`: Do not output the AST, just return the exit status.
- `--help`: Print the usage information and quit.
The utility spits out the syntax tree as JSON data.
## Build system
Acorn is written in ECMAScript 6, as a set of small modules, in the
project's `src` directory, and compiled down to bigger ECMAScript 3
files in `dist` using [Browserify](http://browserify.org) and
[Babel](http://babeljs.io/). If you are already using Babel, you can
consider including the modules directly.
The command-line test runner (`npm test`) uses the ES6 modules. The
browser-based test page (`test/index.html`) uses the compiled modules.
The `bin/build-acorn.js` script builds the latter from the former.
If you are working on Acorn, you'll probably want to try the code out
directly, without an intermediate build step. In your scripts, you can
register the Babel require shim like this:
require("babel-core/register")
That will allow you to directly `require` the ES6 modules.
## Plugins
Acorn is designed support allow plugins which, within reasonable
bounds, redefine the way the parser works. Plugins can add new token
types and new tokenizer contexts (if necessary), and extend methods in
the parser object. This is not a clean, elegant API—using it requires
an understanding of Acorn's internals, and plugins are likely to break
whenever those internals are significantly changed. But still, it is
_possible_, in this way, to create parsers for JavaScript dialects
without forking all of Acorn. And in principle it is even possible to
combine such plugins, so that if you have, for example, a plugin for
parsing types and a plugin for parsing JSX-style XML literals, you
could load them both and parse code with both JSX tags and types.
A plugin should register itself by adding a property to
`acorn.plugins`, which holds a function. Calling `acorn.parse`, a
`plugins` option can be passed, holding an object mapping plugin names
to configuration values (or just `true` for plugins that don't take
options). After the parser object has been created, the initialization
functions for the chosen plugins are called with `(parser,
configValue)` arguments. They are expected to use the `parser.extend`
method to extend parser methods. For example, the `readToken` method
could be extended like this:
```javascript
parser.extend("readToken", function(nextMethod) {
return function(code) {
console.log("Reading a token!")
return nextMethod.call(this, code)
}
})
```
The `nextMethod` argument passed to `extend`'s second argument is the
previous value of this method, and should usually be called through to
whenever the extended method does not handle the call itself.
Similarly, the loose parser allows plugins to register themselves via
`acorn.pluginsLoose`. The extension mechanism is the same as for the
normal parser:
```javascript
looseParser.extend("readToken", function(nextMethod) {
return function() {
console.log("Reading a token in the loose parser!")
return nextMethod.call(this)
}
})
```
### Existing plugins
- [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
- [`acorn-es7-plugin`](https://github.com/MatAtBread/acorn-es7-plugin/): Parse [async/await syntax proposal](https://github.com/tc39/ecmascript-asyncawait)
- [`acorn-object-spread`](https://github.com/UXtemple/acorn-object-spread): Parse [object spread syntax proposal](https://github.com/sebmarkbage/ecmascript-rest-spread)
- [`acorn-es7`](https://www.npmjs.com/package/acorn-es7): Parse [decorator syntax proposal](https://github.com/wycats/javascript-decorators)
- [`acorn-objj`](https://www.npmjs.com/package/acorn-objj): [Objective-J](http://www.cappuccino-project.org/learn/objective-j.html) language parser built as Acorn plugin
#!/usr/bin/env node
'use strict';
var path = require('path');
var fs = require('fs');
var acorn = require('../dist/acorn.js');
var infile;
var forceFile;
var silent = false;
var compact = false;
var tokenize = false;
var options = {}
function help(status) {
var print = (status == 0) ? console.log : console.error
print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|...|--ecma2015|--ecma2016|...]")
print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]")
process.exit(status)
}
for (var i = 2; i < process.argv.length; ++i) {
var arg = process.argv[i]
if ((arg == "-" || arg[0] != "-") && !infile) infile = arg
else if (arg == "--" && !infile && i + 2 == process.argv.length) forceFile = infile = process.argv[++i]
else if (arg == "--locations") options.locations = true
else if (arg == "--allow-hash-bang") options.allowHashBang = true
else if (arg == "--silent") silent = true
else if (arg == "--compact") compact = true
else if (arg == "--help") help(0)
else if (arg == "--tokenize") tokenize = true
else if (arg == "--module") options.sourceType = 'module'
else {
var match = arg.match(/^--ecma(\d+)$/)
if (match)
options.ecmaVersion = +match[1]
else
help(1)
}
}
function run(code) {
var result
if (!tokenize) {
try { result = acorn.parse(code, options) }
catch(e) { console.error(e.message); process.exit(1) }
} else {
result = []
var tokenizer = acorn.tokenizer(code, options), token
while (true) {
try { token = tokenizer.getToken() }
catch(e) { console.error(e.message); process.exit(1) }
result.push(token)
if (token.type == acorn.tokTypes.eof) break
}
}
if (!silent) console.log(JSON.stringify(result, null, compact ? null : 2))
}
if (forceFile || infile && infile != "-") {
run(fs.readFileSync(infile, "utf8"))
} else {
var code = ""
process.stdin.resume()
process.stdin.on("data", function (chunk) { return code += chunk; })
process.stdin.on("end", function () { return run(code); })
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment