jass 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (503) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +47 -0
  3. data/README.md +45 -0
  4. data/lib/jass.rb +55 -0
  5. data/lib/jass/base.rb +141 -0
  6. data/lib/jass/bundle_processor.rb +28 -0
  7. data/lib/jass/compiler.rb +112 -0
  8. data/lib/jass/dependency.rb +14 -0
  9. data/lib/jass/errors.rb +29 -0
  10. data/lib/jass/es6_processor.rb +17 -0
  11. data/lib/jass/function.rb +13 -0
  12. data/lib/jass/global_directive_processor.rb +12 -0
  13. data/lib/jass/plugin.rb +13 -0
  14. data/lib/jass/railtie.rb +12 -0
  15. data/lib/jass/version.rb +3 -0
  16. data/vendor/node_modules/@types/acorn/index.d.ts +256 -0
  17. data/vendor/node_modules/@types/acorn/package.json +29 -0
  18. data/vendor/node_modules/@types/estree/index.d.ts +546 -0
  19. data/vendor/node_modules/@types/estree/package.json +22 -0
  20. data/vendor/node_modules/acorn-dynamic-import/lib/index.js +17 -0
  21. data/vendor/node_modules/acorn-dynamic-import/lib/inject.js +72 -0
  22. data/vendor/node_modules/acorn-dynamic-import/lib/walk.js +22 -0
  23. data/vendor/node_modules/acorn-dynamic-import/package.json +45 -0
  24. data/vendor/node_modules/acorn-dynamic-import/src/index.js +4 -0
  25. data/vendor/node_modules/acorn-dynamic-import/src/inject.js +52 -0
  26. data/vendor/node_modules/acorn-dynamic-import/src/walk.js +12 -0
  27. data/vendor/node_modules/acorn-es7-plugin/acorn-es7-plugin.js +17 -0
  28. data/vendor/node_modules/acorn-es7-plugin/acorn-v3.js +333 -0
  29. data/vendor/node_modules/acorn-es7-plugin/acorn-v4.js +194 -0
  30. data/vendor/node_modules/acorn-es7-plugin/package.json +29 -0
  31. data/vendor/node_modules/acorn-jsx/index.js +3 -0
  32. data/vendor/node_modules/acorn-jsx/inject.js +449 -0
  33. data/vendor/node_modules/acorn-jsx/package.json +28 -0
  34. data/vendor/node_modules/acorn-jsx/xhtml.js +255 -0
  35. data/vendor/node_modules/acorn/bin/_acorn.js +69 -0
  36. data/vendor/node_modules/acorn/bin/acorn +4 -0
  37. data/vendor/node_modules/acorn/bin/run_test262.js +22 -0
  38. data/vendor/node_modules/acorn/bin/test262.whitelist +409 -0
  39. data/vendor/node_modules/acorn/dist/acorn.es.js +5305 -0
  40. data/vendor/node_modules/acorn/dist/acorn.js +5336 -0
  41. data/vendor/node_modules/acorn/dist/acorn_loose.es.js +1412 -0
  42. data/vendor/node_modules/acorn/dist/acorn_loose.js +1422 -0
  43. data/vendor/node_modules/acorn/dist/walk.es.js +419 -0
  44. data/vendor/node_modules/acorn/dist/walk.js +439 -0
  45. data/vendor/node_modules/acorn/package.json +56 -0
  46. data/vendor/node_modules/ansi-styles/index.js +165 -0
  47. data/vendor/node_modules/ansi-styles/package.json +56 -0
  48. data/vendor/node_modules/arr-diff/index.js +58 -0
  49. data/vendor/node_modules/arr-diff/package.json +49 -0
  50. data/vendor/node_modules/arr-flatten/index.js +22 -0
  51. data/vendor/node_modules/arr-flatten/package.json +76 -0
  52. data/vendor/node_modules/array-unique/index.js +28 -0
  53. data/vendor/node_modules/array-unique/package.json +37 -0
  54. data/vendor/node_modules/braces/index.js +399 -0
  55. data/vendor/node_modules/braces/package.json +83 -0
  56. data/vendor/node_modules/buble/bin/buble +24 -0
  57. data/vendor/node_modules/buble/bin/handleError.js +58 -0
  58. data/vendor/node_modules/buble/bin/runBuble.js +150 -0
  59. data/vendor/node_modules/buble/bin/showHelp.js +16 -0
  60. data/vendor/node_modules/buble/dist/buble-browser-deps.umd.js +14857 -0
  61. data/vendor/node_modules/buble/dist/buble-browser.cjs.js +9941 -0
  62. data/vendor/node_modules/buble/dist/buble-browser.es.js +9933 -0
  63. data/vendor/node_modules/buble/dist/buble.cjs.js +9433 -0
  64. data/vendor/node_modules/buble/dist/buble.es.js +9425 -0
  65. data/vendor/node_modules/buble/package.json +74 -0
  66. data/vendor/node_modules/buble/register.js +90 -0
  67. data/vendor/node_modules/buble/src/index.js +98 -0
  68. data/vendor/node_modules/buble/src/program/BlockStatement.js +373 -0
  69. data/vendor/node_modules/buble/src/program/Node.js +112 -0
  70. data/vendor/node_modules/buble/src/program/Program.js +74 -0
  71. data/vendor/node_modules/buble/src/program/Scope.js +116 -0
  72. data/vendor/node_modules/buble/src/program/extractNames.js +35 -0
  73. data/vendor/node_modules/buble/src/program/keys.js +4 -0
  74. data/vendor/node_modules/buble/src/program/types/ArrayExpression.js +70 -0
  75. data/vendor/node_modules/buble/src/program/types/ArrowFunctionExpression.js +52 -0
  76. data/vendor/node_modules/buble/src/program/types/AssignmentExpression.js +185 -0
  77. data/vendor/node_modules/buble/src/program/types/BinaryExpression.js +12 -0
  78. data/vendor/node_modules/buble/src/program/types/BreakStatement.js +26 -0
  79. data/vendor/node_modules/buble/src/program/types/CallExpression.js +104 -0
  80. data/vendor/node_modules/buble/src/program/types/ClassBody.js +237 -0
  81. data/vendor/node_modules/buble/src/program/types/ClassDeclaration.js +79 -0
  82. data/vendor/node_modules/buble/src/program/types/ClassExpression.js +51 -0
  83. data/vendor/node_modules/buble/src/program/types/ContinueStatement.js +17 -0
  84. data/vendor/node_modules/buble/src/program/types/ExportDefaultDeclaration.js +10 -0
  85. data/vendor/node_modules/buble/src/program/types/ExportNamedDeclaration.js +10 -0
  86. data/vendor/node_modules/buble/src/program/types/ForInStatement.js +76 -0
  87. data/vendor/node_modules/buble/src/program/types/ForOfStatement.js +89 -0
  88. data/vendor/node_modules/buble/src/program/types/ForStatement.js +54 -0
  89. data/vendor/node_modules/buble/src/program/types/FunctionDeclaration.js +25 -0
  90. data/vendor/node_modules/buble/src/program/types/FunctionExpression.js +74 -0
  91. data/vendor/node_modules/buble/src/program/types/Identifier.js +54 -0
  92. data/vendor/node_modules/buble/src/program/types/IfStatement.js +29 -0
  93. data/vendor/node_modules/buble/src/program/types/ImportDeclaration.js +10 -0
  94. data/vendor/node_modules/buble/src/program/types/ImportDefaultSpecifier.js +8 -0
  95. data/vendor/node_modules/buble/src/program/types/ImportSpecifier.js +8 -0
  96. data/vendor/node_modules/buble/src/program/types/JSXAttribute.js +20 -0
  97. data/vendor/node_modules/buble/src/program/types/JSXClosingElement.js +27 -0
  98. data/vendor/node_modules/buble/src/program/types/JSXClosingFragment.js +22 -0
  99. data/vendor/node_modules/buble/src/program/types/JSXElement.js +57 -0
  100. data/vendor/node_modules/buble/src/program/types/JSXExpressionContainer.js +10 -0
  101. data/vendor/node_modules/buble/src/program/types/JSXFragment.js +4 -0
  102. data/vendor/node_modules/buble/src/program/types/JSXOpeningElement.js +93 -0
  103. data/vendor/node_modules/buble/src/program/types/JSXOpeningFragment.js +7 -0
  104. data/vendor/node_modules/buble/src/program/types/JSXSpreadAttribute.js +10 -0
  105. data/vendor/node_modules/buble/src/program/types/Literal.js +43 -0
  106. data/vendor/node_modules/buble/src/program/types/MemberExpression.js +13 -0
  107. data/vendor/node_modules/buble/src/program/types/NewExpression.js +55 -0
  108. data/vendor/node_modules/buble/src/program/types/ObjectExpression.js +250 -0
  109. data/vendor/node_modules/buble/src/program/types/Property.js +52 -0
  110. data/vendor/node_modules/buble/src/program/types/ReturnStatement.js +32 -0
  111. data/vendor/node_modules/buble/src/program/types/SpreadElement.js +12 -0
  112. data/vendor/node_modules/buble/src/program/types/Super.js +88 -0
  113. data/vendor/node_modules/buble/src/program/types/TaggedTemplateExpression.js +63 -0
  114. data/vendor/node_modules/buble/src/program/types/TemplateElement.js +7 -0
  115. data/vendor/node_modules/buble/src/program/types/TemplateLiteral.js +80 -0
  116. data/vendor/node_modules/buble/src/program/types/ThisExpression.js +31 -0
  117. data/vendor/node_modules/buble/src/program/types/UpdateExpression.js +32 -0
  118. data/vendor/node_modules/buble/src/program/types/VariableDeclaration.js +101 -0
  119. data/vendor/node_modules/buble/src/program/types/VariableDeclarator.js +43 -0
  120. data/vendor/node_modules/buble/src/program/types/index.js +98 -0
  121. data/vendor/node_modules/buble/src/program/types/shared/LoopStatement.js +105 -0
  122. data/vendor/node_modules/buble/src/program/types/shared/ModuleDeclaration.js +10 -0
  123. data/vendor/node_modules/buble/src/program/wrap.js +68 -0
  124. data/vendor/node_modules/buble/src/support.js +97 -0
  125. data/vendor/node_modules/buble/src/utils/CompileError.js +30 -0
  126. data/vendor/node_modules/buble/src/utils/array.js +11 -0
  127. data/vendor/node_modules/buble/src/utils/checkConst.js +8 -0
  128. data/vendor/node_modules/buble/src/utils/deindent.js +30 -0
  129. data/vendor/node_modules/buble/src/utils/destructure.js +377 -0
  130. data/vendor/node_modules/buble/src/utils/getSnippet.js +30 -0
  131. data/vendor/node_modules/buble/src/utils/isReference.js +41 -0
  132. data/vendor/node_modules/buble/src/utils/locate.js +20 -0
  133. data/vendor/node_modules/buble/src/utils/patterns.js +1 -0
  134. data/vendor/node_modules/buble/src/utils/removeTrailingComma.js +13 -0
  135. data/vendor/node_modules/buble/src/utils/reserved.js +6 -0
  136. data/vendor/node_modules/buble/src/utils/spread.js +70 -0
  137. data/vendor/node_modules/builtin-modules/builtin-modules.json +39 -0
  138. data/vendor/node_modules/builtin-modules/index.js +10 -0
  139. data/vendor/node_modules/builtin-modules/package.json +40 -0
  140. data/vendor/node_modules/builtin-modules/static.js +2 -0
  141. data/vendor/node_modules/chalk/index.js +228 -0
  142. data/vendor/node_modules/chalk/package.json +66 -0
  143. data/vendor/node_modules/chalk/templates.js +128 -0
  144. data/vendor/node_modules/chalk/types/index.d.ts +97 -0
  145. data/vendor/node_modules/color-convert/conversions.js +861 -0
  146. data/vendor/node_modules/color-convert/index.js +78 -0
  147. data/vendor/node_modules/color-convert/package.json +46 -0
  148. data/vendor/node_modules/color-convert/route.js +97 -0
  149. data/vendor/node_modules/color-name/index.js +152 -0
  150. data/vendor/node_modules/color-name/package.json +25 -0
  151. data/vendor/node_modules/color-name/test.js +7 -0
  152. data/vendor/node_modules/date-time/index.js +33 -0
  153. data/vendor/node_modules/date-time/package.json +39 -0
  154. data/vendor/node_modules/escape-string-regexp/index.js +11 -0
  155. data/vendor/node_modules/escape-string-regexp/package.json +41 -0
  156. data/vendor/node_modules/estree-walker/dist/estree-walker.es.js +57 -0
  157. data/vendor/node_modules/estree-walker/dist/estree-walker.umd.js +68 -0
  158. data/vendor/node_modules/estree-walker/package.json +34 -0
  159. data/vendor/node_modules/estree-walker/src/estree-walker.js +51 -0
  160. data/vendor/node_modules/expand-brackets/index.js +163 -0
  161. data/vendor/node_modules/expand-brackets/package.json +62 -0
  162. data/vendor/node_modules/expand-range/index.js +43 -0
  163. data/vendor/node_modules/expand-range/package.json +73 -0
  164. data/vendor/node_modules/extglob/index.js +178 -0
  165. data/vendor/node_modules/extglob/package.json +60 -0
  166. data/vendor/node_modules/filename-regex/index.js +10 -0
  167. data/vendor/node_modules/filename-regex/package.json +50 -0
  168. data/vendor/node_modules/fill-range/index.js +408 -0
  169. data/vendor/node_modules/fill-range/package.json +61 -0
  170. data/vendor/node_modules/for-in/index.js +16 -0
  171. data/vendor/node_modules/for-in/package.json +68 -0
  172. data/vendor/node_modules/for-own/index.js +19 -0
  173. data/vendor/node_modules/for-own/package.json +70 -0
  174. data/vendor/node_modules/glob-base/index.js +51 -0
  175. data/vendor/node_modules/glob-base/package.json +52 -0
  176. data/vendor/node_modules/glob-parent/index.js +10 -0
  177. data/vendor/node_modules/glob-parent/package.json +35 -0
  178. data/vendor/node_modules/glob-parent/test.js +28 -0
  179. data/vendor/node_modules/has-flag/index.js +8 -0
  180. data/vendor/node_modules/has-flag/package.json +44 -0
  181. data/vendor/node_modules/irregular-plurals/irregular-plurals.json +146 -0
  182. data/vendor/node_modules/irregular-plurals/package.json +39 -0
  183. data/vendor/node_modules/is-buffer/index.js +21 -0
  184. data/vendor/node_modules/is-buffer/package.json +51 -0
  185. data/vendor/node_modules/is-dotfile/index.js +14 -0
  186. data/vendor/node_modules/is-dotfile/package.json +69 -0
  187. data/vendor/node_modules/is-equal-shallow/index.js +27 -0
  188. data/vendor/node_modules/is-equal-shallow/package.json +54 -0
  189. data/vendor/node_modules/is-extendable/index.js +13 -0
  190. data/vendor/node_modules/is-extendable/package.json +51 -0
  191. data/vendor/node_modules/is-extglob/index.js +11 -0
  192. data/vendor/node_modules/is-extglob/package.json +48 -0
  193. data/vendor/node_modules/is-glob/index.js +14 -0
  194. data/vendor/node_modules/is-glob/package.json +60 -0
  195. data/vendor/node_modules/is-module/index.js +11 -0
  196. data/vendor/node_modules/is-module/package.json +20 -0
  197. data/vendor/node_modules/is-number/index.js +19 -0
  198. data/vendor/node_modules/is-number/package.json +59 -0
  199. data/vendor/node_modules/is-posix-bracket/index.js +10 -0
  200. data/vendor/node_modules/is-posix-bracket/package.json +64 -0
  201. data/vendor/node_modules/is-primitive/index.js +13 -0
  202. data/vendor/node_modules/is-primitive/package.json +46 -0
  203. data/vendor/node_modules/is-reference/dist/is-reference.es.js +26 -0
  204. data/vendor/node_modules/is-reference/dist/is-reference.js +34 -0
  205. data/vendor/node_modules/is-reference/dist/types/index.d.ts +2 -0
  206. data/vendor/node_modules/is-reference/package.json +47 -0
  207. data/vendor/node_modules/isarray/index.js +5 -0
  208. data/vendor/node_modules/isarray/package.json +45 -0
  209. data/vendor/node_modules/isarray/test.js +20 -0
  210. data/vendor/node_modules/isobject/index.js +14 -0
  211. data/vendor/node_modules/isobject/package.json +67 -0
  212. data/vendor/node_modules/kind-of/index.js +116 -0
  213. data/vendor/node_modules/kind-of/package.json +90 -0
  214. data/vendor/node_modules/locate-character/dist/locate-character.es.js +43 -0
  215. data/vendor/node_modules/locate-character/dist/locate-character.umd.js +54 -0
  216. data/vendor/node_modules/locate-character/dist/types/index.d.ts +17 -0
  217. data/vendor/node_modules/locate-character/package.json +41 -0
  218. data/vendor/node_modules/magic-string/dist/magic-string.cjs.js +1300 -0
  219. data/vendor/node_modules/magic-string/dist/magic-string.es.js +1296 -0
  220. data/vendor/node_modules/magic-string/dist/magic-string.umd.js +1352 -0
  221. data/vendor/node_modules/magic-string/index.d.ts +83 -0
  222. data/vendor/node_modules/magic-string/node_modules/vlq/dist/vlq.js +91 -0
  223. data/vendor/node_modules/magic-string/node_modules/vlq/package.json +27 -0
  224. data/vendor/node_modules/magic-string/node_modules/vlq/src/vlq.js +78 -0
  225. data/vendor/node_modules/magic-string/package.json +55 -0
  226. data/vendor/node_modules/micromatch/index.js +431 -0
  227. data/vendor/node_modules/micromatch/lib/chars.js +67 -0
  228. data/vendor/node_modules/micromatch/lib/expand.js +304 -0
  229. data/vendor/node_modules/micromatch/lib/glob.js +193 -0
  230. data/vendor/node_modules/micromatch/lib/utils.js +149 -0
  231. data/vendor/node_modules/micromatch/package.json +114 -0
  232. data/vendor/node_modules/minimist/index.js +236 -0
  233. data/vendor/node_modules/minimist/package.json +45 -0
  234. data/vendor/node_modules/nodent-compiler/compiler.js +171 -0
  235. data/vendor/node_modules/nodent-compiler/lib/arboriculture.js +2694 -0
  236. data/vendor/node_modules/nodent-compiler/lib/output.js +934 -0
  237. data/vendor/node_modules/nodent-compiler/lib/parser.js +291 -0
  238. data/vendor/node_modules/nodent-compiler/package.json +37 -0
  239. data/vendor/node_modules/normalize-path/index.js +19 -0
  240. data/vendor/node_modules/normalize-path/package.json +78 -0
  241. data/vendor/node_modules/object.omit/index.js +40 -0
  242. data/vendor/node_modules/object.omit/package.json +67 -0
  243. data/vendor/node_modules/os-homedir/index.js +24 -0
  244. data/vendor/node_modules/os-homedir/package.json +41 -0
  245. data/vendor/node_modules/parse-glob/index.js +156 -0
  246. data/vendor/node_modules/parse-glob/package.json +62 -0
  247. data/vendor/node_modules/parse-ms/index.js +16 -0
  248. data/vendor/node_modules/parse-ms/package.json +34 -0
  249. data/vendor/node_modules/path-parse/index.js +93 -0
  250. data/vendor/node_modules/path-parse/index.min.js +1 -0
  251. data/vendor/node_modules/path-parse/package.json +33 -0
  252. data/vendor/node_modules/path-parse/test.js +77 -0
  253. data/vendor/node_modules/path-parse/test.min.js +1 -0
  254. data/vendor/node_modules/plur/index.js +20 -0
  255. data/vendor/node_modules/plur/package.json +42 -0
  256. data/vendor/node_modules/preserve/index.js +54 -0
  257. data/vendor/node_modules/preserve/package.json +48 -0
  258. data/vendor/node_modules/preserve/test.js +48 -0
  259. data/vendor/node_modules/pretty-ms/index.js +48 -0
  260. data/vendor/node_modules/pretty-ms/package.json +48 -0
  261. data/vendor/node_modules/randomatic/index.js +82 -0
  262. data/vendor/node_modules/randomatic/node_modules/is-number/index.js +22 -0
  263. data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/index.js +116 -0
  264. data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/package.json +90 -0
  265. data/vendor/node_modules/randomatic/node_modules/is-number/package.json +83 -0
  266. data/vendor/node_modules/randomatic/node_modules/kind-of/index.js +119 -0
  267. data/vendor/node_modules/randomatic/node_modules/kind-of/package.json +90 -0
  268. data/vendor/node_modules/randomatic/package.json +78 -0
  269. data/vendor/node_modules/regex-cache/index.js +68 -0
  270. data/vendor/node_modules/regex-cache/package.json +64 -0
  271. data/vendor/node_modules/remove-trailing-separator/index.js +17 -0
  272. data/vendor/node_modules/remove-trailing-separator/package.json +37 -0
  273. data/vendor/node_modules/repeat-element/index.js +18 -0
  274. data/vendor/node_modules/repeat-element/package.json +44 -0
  275. data/vendor/node_modules/repeat-string/index.js +70 -0
  276. data/vendor/node_modules/repeat-string/package.json +77 -0
  277. data/vendor/node_modules/require-relative/index.js +33 -0
  278. data/vendor/node_modules/require-relative/package.json +22 -0
  279. data/vendor/node_modules/resolve/index.js +8 -0
  280. data/vendor/node_modules/resolve/lib/async.js +203 -0
  281. data/vendor/node_modules/resolve/lib/caller.js +8 -0
  282. data/vendor/node_modules/resolve/lib/core.js +53 -0
  283. data/vendor/node_modules/resolve/lib/core.json +69 -0
  284. data/vendor/node_modules/resolve/lib/node-modules-paths.js +45 -0
  285. data/vendor/node_modules/resolve/lib/sync.js +93 -0
  286. data/vendor/node_modules/resolve/package.json +40 -0
  287. data/vendor/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js +804 -0
  288. data/vendor/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js +800 -0
  289. data/vendor/node_modules/rollup-plugin-commonjs/package.json +52 -0
  290. data/vendor/node_modules/rollup-plugin-commonjs/src/ast-utils.js +104 -0
  291. data/vendor/node_modules/rollup-plugin-commonjs/src/defaultResolver.js +39 -0
  292. data/vendor/node_modules/rollup-plugin-commonjs/src/helpers.js +19 -0
  293. data/vendor/node_modules/rollup-plugin-commonjs/src/index.js +198 -0
  294. data/vendor/node_modules/rollup-plugin-commonjs/src/transform.js +431 -0
  295. data/vendor/node_modules/rollup-plugin-commonjs/src/utils.js +13 -0
  296. data/vendor/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js +218 -0
  297. data/vendor/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.es.js +214 -0
  298. data/vendor/node_modules/rollup-plugin-node-resolve/package.json +51 -0
  299. data/vendor/node_modules/rollup-plugin-node-resolve/src/empty.js +1 -0
  300. data/vendor/node_modules/rollup-plugin-node-resolve/src/index.js +205 -0
  301. data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.cjs.js +223 -0
  302. data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es.js +214 -0
  303. data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es6.js +217 -0
  304. data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.es.js +55 -0
  305. data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.es6.js +59 -0
  306. data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.umd.js +65 -0
  307. data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/package.json +33 -0
  308. data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/src/estree-walker.js +49 -0
  309. data/vendor/node_modules/rollup-pluginutils/package.json +40 -0
  310. data/vendor/node_modules/rollup-pluginutils/src/addExtension.js +6 -0
  311. data/vendor/node_modules/rollup-pluginutils/src/attachScopes.js +147 -0
  312. data/vendor/node_modules/rollup-pluginutils/src/createFilter.js +33 -0
  313. data/vendor/node_modules/rollup-pluginutils/src/index.js +4 -0
  314. data/vendor/node_modules/rollup-pluginutils/src/makeLegalIdentifier.js +15 -0
  315. data/vendor/node_modules/rollup-pluginutils/src/utils/ensureArray.js +5 -0
  316. data/vendor/node_modules/rollup/bin/rollup +4085 -0
  317. data/vendor/node_modules/rollup/dist/rollup.browser.js +19829 -0
  318. data/vendor/node_modules/rollup/dist/rollup.es.js +23586 -0
  319. data/vendor/node_modules/rollup/dist/rollup.js +23597 -0
  320. data/vendor/node_modules/rollup/dist/typings/Chunk.d.ts +85 -0
  321. data/vendor/node_modules/rollup/dist/typings/ExternalModule.d.ts +30 -0
  322. data/vendor/node_modules/rollup/dist/typings/Graph.d.ts +47 -0
  323. data/vendor/node_modules/rollup/dist/typings/Module.d.ts +130 -0
  324. data/vendor/node_modules/rollup/dist/typings/ast/CallOptions.d.ts +20 -0
  325. data/vendor/node_modules/rollup/dist/typings/ast/Entity.d.ts +16 -0
  326. data/vendor/node_modules/rollup/dist/typings/ast/ExecutionPathOptions.d.ts +57 -0
  327. data/vendor/node_modules/rollup/dist/typings/ast/clone.d.ts +1 -0
  328. data/vendor/node_modules/rollup/dist/typings/ast/enhance.d.ts +3 -0
  329. data/vendor/node_modules/rollup/dist/typings/ast/keys.d.ts +4 -0
  330. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrayExpression.d.ts +14 -0
  331. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrayPattern.d.ts +14 -0
  332. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrowFunctionExpression.d.ts +25 -0
  333. data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentExpression.d.ts +13 -0
  334. data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentPattern.d.ts +16 -0
  335. data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentProperty.d.ts +10 -0
  336. data/vendor/node_modules/rollup/dist/typings/ast/nodes/AwaitExpression.d.ts +8 -0
  337. data/vendor/node_modules/rollup/dist/typings/ast/nodes/BinaryExpression.d.ts +13 -0
  338. data/vendor/node_modules/rollup/dist/typings/ast/nodes/BlockStatement.d.ts +19 -0
  339. data/vendor/node_modules/rollup/dist/typings/ast/nodes/BreakStatement.d.ts +9 -0
  340. data/vendor/node_modules/rollup/dist/typings/ast/nodes/CallExpression.d.ts +22 -0
  341. data/vendor/node_modules/rollup/dist/typings/ast/nodes/CatchClause.d.ts +14 -0
  342. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassBody.d.ts +13 -0
  343. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassDeclaration.d.ts +14 -0
  344. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassExpression.d.ts +10 -0
  345. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ConditionalExpression.d.ts +28 -0
  346. data/vendor/node_modules/rollup/dist/typings/ast/nodes/DoWhileStatement.d.ts +9 -0
  347. data/vendor/node_modules/rollup/dist/typings/ast/nodes/EmptyStatement.d.ts +8 -0
  348. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportAllDeclaration.d.ts +12 -0
  349. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportDefaultDeclaration.d.ts +21 -0
  350. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportNamedDeclaration.d.ts +21 -0
  351. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportSpecifier.d.ts +8 -0
  352. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExpressionStatement.d.ts +10 -0
  353. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForInStatement.d.ts +20 -0
  354. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForOfStatement.d.ts +21 -0
  355. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForStatement.d.ts +19 -0
  356. data/vendor/node_modules/rollup/dist/typings/ast/nodes/FunctionDeclaration.d.ts +9 -0
  357. data/vendor/node_modules/rollup/dist/typings/ast/nodes/FunctionExpression.d.ts +6 -0
  358. data/vendor/node_modules/rollup/dist/typings/ast/nodes/Identifier.d.ts +29 -0
  359. data/vendor/node_modules/rollup/dist/typings/ast/nodes/IfStatement.d.ts +17 -0
  360. data/vendor/node_modules/rollup/dist/typings/ast/nodes/Import.d.ts +14 -0
  361. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportDeclaration.d.ts +17 -0
  362. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportDefaultSpecifier.d.ts +7 -0
  363. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportNamespaceSpecifier.d.ts +7 -0
  364. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportSpecifier.d.ts +8 -0
  365. data/vendor/node_modules/rollup/dist/typings/ast/nodes/LabeledStatement.d.ts +10 -0
  366. data/vendor/node_modules/rollup/dist/typings/ast/nodes/Literal.d.ts +22 -0
  367. data/vendor/node_modules/rollup/dist/typings/ast/nodes/LogicalExpression.d.ts +23 -0
  368. data/vendor/node_modules/rollup/dist/typings/ast/nodes/MemberExpression.d.ts +34 -0
  369. data/vendor/node_modules/rollup/dist/typings/ast/nodes/MethodDefinition.d.ts +16 -0
  370. data/vendor/node_modules/rollup/dist/typings/ast/nodes/NewExpression.d.ts +14 -0
  371. data/vendor/node_modules/rollup/dist/typings/ast/nodes/NodeType.d.ts +64 -0
  372. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ObjectExpression.d.ts +22 -0
  373. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ObjectPattern.d.ts +15 -0
  374. data/vendor/node_modules/rollup/dist/typings/ast/nodes/Program.d.ts +9 -0
  375. data/vendor/node_modules/rollup/dist/typings/ast/nodes/Property.d.ts +30 -0
  376. data/vendor/node_modules/rollup/dist/typings/ast/nodes/RestElement.d.ts +14 -0
  377. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ReturnStatement.d.ts +9 -0
  378. data/vendor/node_modules/rollup/dist/typings/ast/nodes/SequenceExpression.d.ts +13 -0
  379. data/vendor/node_modules/rollup/dist/typings/ast/nodes/SpreadElement.d.ts +6 -0
  380. data/vendor/node_modules/rollup/dist/typings/ast/nodes/SwitchCase.d.ts +11 -0
  381. data/vendor/node_modules/rollup/dist/typings/ast/nodes/SwitchStatement.d.ts +12 -0
  382. data/vendor/node_modules/rollup/dist/typings/ast/nodes/TaggedTemplateExpression.d.ts +13 -0
  383. data/vendor/node_modules/rollup/dist/typings/ast/nodes/TemplateElement.d.ts +12 -0
  384. data/vendor/node_modules/rollup/dist/typings/ast/nodes/TemplateLiteral.d.ts +12 -0
  385. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ThisExpression.d.ts +17 -0
  386. data/vendor/node_modules/rollup/dist/typings/ast/nodes/ThrowStatement.d.ts +8 -0
  387. data/vendor/node_modules/rollup/dist/typings/ast/nodes/UnaryExpression.d.ts +16 -0
  388. data/vendor/node_modules/rollup/dist/typings/ast/nodes/UnknownNode.d.ts +5 -0
  389. data/vendor/node_modules/rollup/dist/typings/ast/nodes/UpdateExpression.d.ts +13 -0
  390. data/vendor/node_modules/rollup/dist/typings/ast/nodes/VariableDeclaration.d.ts +21 -0
  391. data/vendor/node_modules/rollup/dist/typings/ast/nodes/VariableDeclarator.d.ts +13 -0
  392. data/vendor/node_modules/rollup/dist/typings/ast/nodes/WhileStatement.d.ts +9 -0
  393. data/vendor/node_modules/rollup/dist/typings/ast/nodes/YieldExpression.d.ts +9 -0
  394. data/vendor/node_modules/rollup/dist/typings/ast/nodes/index.d.ts +6 -0
  395. data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/ClassNode.d.ts +17 -0
  396. data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Expression.d.ts +21 -0
  397. data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/FunctionNode.d.ts +25 -0
  398. data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Node.d.ts +133 -0
  399. data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Pattern.d.ts +4 -0
  400. data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/pureFunctions.d.ts +4 -0
  401. data/vendor/node_modules/rollup/dist/typings/ast/scopes/BlockScope.d.ts +9 -0
  402. data/vendor/node_modules/rollup/dist/typings/ast/scopes/CatchScope.d.ts +10 -0
  403. data/vendor/node_modules/rollup/dist/typings/ast/scopes/FunctionScope.d.ts +20 -0
  404. data/vendor/node_modules/rollup/dist/typings/ast/scopes/GlobalScope.d.ts +7 -0
  405. data/vendor/node_modules/rollup/dist/typings/ast/scopes/ModuleScope.d.ts +11 -0
  406. data/vendor/node_modules/rollup/dist/typings/ast/scopes/ParameterScope.d.ts +16 -0
  407. data/vendor/node_modules/rollup/dist/typings/ast/scopes/ReturnValueScope.d.ts +11 -0
  408. data/vendor/node_modules/rollup/dist/typings/ast/scopes/Scope.d.ts +42 -0
  409. data/vendor/node_modules/rollup/dist/typings/ast/utils/extractNames.d.ts +2 -0
  410. data/vendor/node_modules/rollup/dist/typings/ast/values.d.ts +31 -0
  411. data/vendor/node_modules/rollup/dist/typings/ast/variables/ArgumentsVariable.d.ts +15 -0
  412. data/vendor/node_modules/rollup/dist/typings/ast/variables/ExportDefaultVariable.d.ts +16 -0
  413. data/vendor/node_modules/rollup/dist/typings/ast/variables/ExternalVariable.d.ts +12 -0
  414. data/vendor/node_modules/rollup/dist/typings/ast/variables/GlobalVariable.d.ts +11 -0
  415. data/vendor/node_modules/rollup/dist/typings/ast/variables/LocalVariable.d.ts +21 -0
  416. data/vendor/node_modules/rollup/dist/typings/ast/variables/NamespaceVariable.d.ts +20 -0
  417. data/vendor/node_modules/rollup/dist/typings/ast/variables/ParameterVariable.d.ts +5 -0
  418. data/vendor/node_modules/rollup/dist/typings/ast/variables/ReplaceableInitializationVariable.d.ts +14 -0
  419. data/vendor/node_modules/rollup/dist/typings/ast/variables/ThisVariable.d.ts +4 -0
  420. data/vendor/node_modules/rollup/dist/typings/ast/variables/Variable.d.ts +43 -0
  421. data/vendor/node_modules/rollup/dist/typings/ast/variables/VariableReassignmentTracker.d.ts +11 -0
  422. data/vendor/node_modules/rollup/dist/typings/finalisers/amd.d.ts +11 -0
  423. data/vendor/node_modules/rollup/dist/typings/finalisers/cjs.d.ts +10 -0
  424. data/vendor/node_modules/rollup/dist/typings/finalisers/es.d.ts +9 -0
  425. data/vendor/node_modules/rollup/dist/typings/finalisers/iife.d.ts +10 -0
  426. data/vendor/node_modules/rollup/dist/typings/finalisers/index.d.ts +15 -0
  427. data/vendor/node_modules/rollup/dist/typings/finalisers/shared/esModuleExport.d.ts +2 -0
  428. data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getExportBlock.d.ts +2 -0
  429. data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getGlobalNameMaker.d.ts +4 -0
  430. data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getInteropBlock.d.ts +3 -0
  431. data/vendor/node_modules/rollup/dist/typings/finalisers/shared/sanitize.d.ts +2 -0
  432. data/vendor/node_modules/rollup/dist/typings/finalisers/shared/setupNamespace.d.ts +2 -0
  433. data/vendor/node_modules/rollup/dist/typings/finalisers/shared/trimEmptyImports.d.ts +2 -0
  434. data/vendor/node_modules/rollup/dist/typings/finalisers/shared/warnOnBuiltins.d.ts +2 -0
  435. data/vendor/node_modules/rollup/dist/typings/finalisers/system.d.ts +8 -0
  436. data/vendor/node_modules/rollup/dist/typings/finalisers/umd.d.ts +10 -0
  437. data/vendor/node_modules/rollup/dist/typings/node-entry.d.ts +6 -0
  438. data/vendor/node_modules/rollup/dist/typings/rollup/index.d.ts +167 -0
  439. data/vendor/node_modules/rollup/dist/typings/utils/callIfFunction.d.ts +1 -0
  440. data/vendor/node_modules/rollup/dist/typings/utils/collapseSourcemaps.d.ts +5 -0
  441. data/vendor/node_modules/rollup/dist/typings/utils/commondir.d.ts +1 -0
  442. data/vendor/node_modules/rollup/dist/typings/utils/defaults.d.ts +6 -0
  443. data/vendor/node_modules/rollup/dist/typings/utils/deprecateOptions.d.ts +6 -0
  444. data/vendor/node_modules/rollup/dist/typings/utils/ensureArray.d.ts +2 -0
  445. data/vendor/node_modules/rollup/dist/typings/utils/entryHashing.d.ts +3 -0
  446. data/vendor/node_modules/rollup/dist/typings/utils/error.d.ts +18 -0
  447. data/vendor/node_modules/rollup/dist/typings/utils/first-sync.d.ts +1 -0
  448. data/vendor/node_modules/rollup/dist/typings/utils/first.d.ts +1 -0
  449. data/vendor/node_modules/rollup/dist/typings/utils/flushTime.d.ts +5 -0
  450. data/vendor/node_modules/rollup/dist/typings/utils/fs.d.ts +3 -0
  451. data/vendor/node_modules/rollup/dist/typings/utils/getCodeFrame.d.ts +1 -0
  452. data/vendor/node_modules/rollup/dist/typings/utils/getExportMode.d.ts +3 -0
  453. data/vendor/node_modules/rollup/dist/typings/utils/getIndentString.d.ts +4 -0
  454. data/vendor/node_modules/rollup/dist/typings/utils/identifierHelpers.d.ts +3 -0
  455. data/vendor/node_modules/rollup/dist/typings/utils/mergeOptions.d.ts +19 -0
  456. data/vendor/node_modules/rollup/dist/typings/utils/object.d.ts +7 -0
  457. data/vendor/node_modules/rollup/dist/typings/utils/path.d.ts +6 -0
  458. data/vendor/node_modules/rollup/dist/typings/utils/promise.d.ts +2 -0
  459. data/vendor/node_modules/rollup/dist/typings/utils/relativeId.d.ts +1 -0
  460. data/vendor/node_modules/rollup/dist/typings/utils/renderHelpers.d.ts +26 -0
  461. data/vendor/node_modules/rollup/dist/typings/utils/sourceMappingURL.d.ts +3 -0
  462. data/vendor/node_modules/rollup/dist/typings/utils/timers.d.ts +7 -0
  463. data/vendor/node_modules/rollup/dist/typings/utils/transform.d.ts +25 -0
  464. data/vendor/node_modules/rollup/dist/typings/utils/transformBundle.d.ts +3 -0
  465. data/vendor/node_modules/rollup/dist/typings/watch/chokidar.d.ts +3 -0
  466. data/vendor/node_modules/rollup/dist/typings/watch/fileWatchers.d.ts +14 -0
  467. data/vendor/node_modules/rollup/dist/typings/watch/index.d.ts +47 -0
  468. data/vendor/node_modules/rollup/package.json +122 -0
  469. data/vendor/node_modules/rollup/typings/package.json.d.ts +3 -0
  470. data/vendor/node_modules/signal-exit/index.js +157 -0
  471. data/vendor/node_modules/signal-exit/package.json +38 -0
  472. data/vendor/node_modules/signal-exit/signals.js +53 -0
  473. data/vendor/node_modules/source-map/dist/source-map.debug.js +3091 -0
  474. data/vendor/node_modules/source-map/dist/source-map.js +3090 -0
  475. data/vendor/node_modules/source-map/dist/source-map.min.js +2 -0
  476. data/vendor/node_modules/source-map/lib/array-set.js +121 -0
  477. data/vendor/node_modules/source-map/lib/base64-vlq.js +140 -0
  478. data/vendor/node_modules/source-map/lib/base64.js +67 -0
  479. data/vendor/node_modules/source-map/lib/binary-search.js +111 -0
  480. data/vendor/node_modules/source-map/lib/mapping-list.js +79 -0
  481. data/vendor/node_modules/source-map/lib/quick-sort.js +114 -0
  482. data/vendor/node_modules/source-map/lib/source-map-consumer.js +1082 -0
  483. data/vendor/node_modules/source-map/lib/source-map-generator.js +416 -0
  484. data/vendor/node_modules/source-map/lib/source-node.js +413 -0
  485. data/vendor/node_modules/source-map/lib/util.js +417 -0
  486. data/vendor/node_modules/source-map/package.json +72 -0
  487. data/vendor/node_modules/source-map/source-map.js +8 -0
  488. data/vendor/node_modules/sourcemap-codec/dist/sourcemap-codec.es.js +129 -0
  489. data/vendor/node_modules/sourcemap-codec/dist/sourcemap-codec.umd.js +140 -0
  490. data/vendor/node_modules/sourcemap-codec/dist/types/sourcemap-codec.d.ts +5 -0
  491. data/vendor/node_modules/sourcemap-codec/package.json +52 -0
  492. data/vendor/node_modules/supports-color/browser.js +5 -0
  493. data/vendor/node_modules/supports-color/index.js +135 -0
  494. data/vendor/node_modules/supports-color/package.json +53 -0
  495. data/vendor/node_modules/time-zone/index.js +10 -0
  496. data/vendor/node_modules/time-zone/package.json +35 -0
  497. data/vendor/node_modules/vlq/dist/types/vlq.d.ts +2 -0
  498. data/vendor/node_modules/vlq/dist/vlq.es.js +64 -0
  499. data/vendor/node_modules/vlq/dist/vlq.js +75 -0
  500. data/vendor/node_modules/vlq/package.json +30 -0
  501. data/vendor/package.json +15 -0
  502. data/vendor/yarn.lock +453 -0
  503. metadata +641 -0
@@ -0,0 +1,194 @@
1
+ var asyncExit = /^async[\t ]+(return|throw)/ ;
2
+ var atomOrPropertyOrLabel = /^\s*[):;]/ ;
3
+ var removeComments = /([^\n])\/\*(\*(?!\/)|[^\n*])*\*\/([^\n])/g ;
4
+
5
+ function hasLineTerminatorBeforeNext(st, since) {
6
+ return st.lineStart >= since;
7
+ }
8
+
9
+ function test(regex,st,noComment) {
10
+ var src = st.input.slice(st.start) ;
11
+ if (noComment) {
12
+ src = src.replace(removeComments,"$1 $3") ;
13
+ }
14
+ return regex.test(src);
15
+ }
16
+
17
+ /* Create a new parser derived from the specified parser, so that in the
18
+ * event of an error we can back out and try again */
19
+ function subParse(parser, pos, extensions) {
20
+ var p = new parser.constructor(parser.options, parser.input, pos);
21
+ if (extensions)
22
+ for (var k in extensions)
23
+ p[k] = extensions[k] ;
24
+
25
+ var src = parser ;
26
+ var dest = p ;
27
+ ['inFunction','inAsync','inGenerator','inModule'].forEach(function(k){
28
+ if (k in src)
29
+ dest[k] = src[k] ;
30
+ }) ;
31
+ p.nextToken();
32
+ return p;
33
+ }
34
+
35
+ function asyncAwaitPlugin (parser,options){
36
+ if (!options || typeof options !== "object")
37
+ options = {} ;
38
+
39
+ parser.extend("parse",function(base){
40
+ return function(){
41
+ this.inAsync = options.inAsyncFunction ;
42
+ if (options.awaitAnywhere && options.inAsyncFunction)
43
+ parser.raise(node.start,"The options awaitAnywhere and inAsyncFunction are mutually exclusive") ;
44
+
45
+ return base.apply(this,arguments);
46
+ }
47
+ }) ;
48
+
49
+ parser.extend("parseStatement",function(base){
50
+ return function (declaration, topLevel) {
51
+ var start = this.start;
52
+ var startLoc = this.startLoc;
53
+ if (this.type.label==='name') {
54
+ if ((options.asyncExits) && test(asyncExit,this)) {
55
+ // TODO: Ensure this function is itself nested in an async function or Method
56
+ this.next() ;
57
+
58
+ var r = this.parseStatement(declaration, topLevel) ;
59
+ r.async = true ;
60
+ r.start = start;
61
+ r.loc && (r.loc.start = startLoc);
62
+ r.range && (r.range[0] = start);
63
+ return r ;
64
+ }
65
+ }
66
+ return base.apply(this,arguments);
67
+ }
68
+ }) ;
69
+
70
+ parser.extend("parseIdent",function(base){
71
+ return function(liberal) {
72
+ if (this.options.sourceType==='module' && this.options.ecmaVersion >= 8 && options.awaitAnywhere)
73
+ return base.call(this,true) ; // Force liberal mode if awaitAnywhere is set
74
+ return base.apply(this,arguments) ;
75
+ }
76
+ }) ;
77
+
78
+ parser.extend("parseExprAtom",function(base){
79
+ var NotAsync = {};
80
+ return function(refShorthandDefaultPos){
81
+ var start = this.start ;
82
+ var startLoc = this.startLoc;
83
+
84
+ var rhs,r = base.apply(this,arguments);
85
+
86
+ if (r.type==='Identifier') {
87
+ if (r.name==='await' && !this.inAsync) {
88
+ if (options.awaitAnywhere) {
89
+ var n = this.startNodeAt(r.start, r.loc && r.loc.start);
90
+
91
+ start = this.start ;
92
+
93
+ var parseHooks = {
94
+ raise:function(){
95
+ try {
96
+ return pp.raise.apply(this,arguments) ;
97
+ } catch(ex) {
98
+ throw /*inBody?ex:*/NotAsync ;
99
+ }
100
+ }
101
+ } ;
102
+
103
+ try {
104
+ rhs = subParse(this,start-4,parseHooks).parseExprSubscripts() ;
105
+ if (rhs.end<=start) {
106
+ rhs = subParse(this,start,parseHooks).parseExprSubscripts() ;
107
+ n.argument = rhs ;
108
+ n = this.finishNodeAt(n,'AwaitExpression', rhs.end, rhs.loc && rhs.loc.end) ;
109
+ this.pos = rhs.end;
110
+ this.end = rhs.end ;
111
+ this.endLoc = rhs.endLoc ;
112
+ this.next();
113
+ return n ;
114
+ }
115
+ } catch (ex) {
116
+ if (ex===NotAsync)
117
+ return r ;
118
+ throw ex ;
119
+ }
120
+ }
121
+ }
122
+ }
123
+ return r ;
124
+ }
125
+ }) ;
126
+
127
+ var allowedPropValues = {
128
+ undefined:true,
129
+ get:true,
130
+ set:true,
131
+ static:true,
132
+ async:true,
133
+ constructor:true
134
+ };
135
+ parser.extend("parsePropertyName",function(base){
136
+ return function (prop) {
137
+ var prevName = prop.key && prop.key.name ;
138
+ var key = base.apply(this,arguments) ;
139
+ if (this.value==='get') {
140
+ prop.__maybeStaticAsyncGetter = true ;
141
+ }
142
+ var next ;
143
+ if (allowedPropValues[this.value])
144
+ return key ;
145
+
146
+ if (key.type === "Identifier" && (key.name === "async" || prevName === "async") && !hasLineTerminatorBeforeNext(this, key.end)
147
+ // Look-ahead to see if this is really a property or label called async or await
148
+ && !this.input.slice(key.end).match(atomOrPropertyOrLabel)) {
149
+ if (prop.kind === 'set' || key.name === 'set')
150
+ this.raise(key.start,"'set <member>(value)' cannot be be async") ;
151
+ else {
152
+ this.__isAsyncProp = true ;
153
+ key = base.apply(this,arguments) ;
154
+ if (key.type==='Identifier') {
155
+ if (key.name==='set')
156
+ this.raise(key.start,"'set <member>(value)' cannot be be async") ;
157
+ }
158
+ }
159
+ } else {
160
+ delete prop.__maybeStaticAsyncGetter ;
161
+ }
162
+ return key;
163
+ };
164
+ }) ;
165
+
166
+ parser.extend("parseClassMethod",function(base){
167
+ return function (classBody, method, isGenerator) {
168
+ var r = base.apply(this,arguments) ;
169
+ if (method.__maybeStaticAsyncGetter) {
170
+ delete method.__maybeStaticAsyncGetter ;
171
+ if (method.key.name!=='get')
172
+ method.kind = "get" ;
173
+ }
174
+ return r ;
175
+ }
176
+ }) ;
177
+
178
+
179
+ parser.extend("parseFunctionBody",function(base){
180
+ return function (node, isArrowFunction) {
181
+ var wasAsync = this.inAsync ;
182
+ if (this.__isAsyncProp) {
183
+ node.async = true ;
184
+ this.inAsync = true ;
185
+ delete this.__isAsyncProp ;
186
+ }
187
+ var r = base.apply(this,arguments) ;
188
+ this.inAsync = wasAsync ;
189
+ return r ;
190
+ }
191
+ }) ;
192
+ }
193
+
194
+ module.exports = asyncAwaitPlugin ;
@@ -0,0 +1,29 @@
1
+ {
2
+ "author": {
3
+ "name": "matatbread"
4
+ },
5
+ "bugs": {
6
+ "url": "https://github.com/MatAtBread/acorn-es7-plugin/issues"
7
+ },
8
+ "description": "A plugin for the Acorn parser that understands the ES7 keywords async and await",
9
+ "homepage": "https://github.com/MatAtBread/acorn-es7-plugin#readme",
10
+ "keywords": [
11
+ "acorn",
12
+ "parser",
13
+ "es7",
14
+ "async",
15
+ "await"
16
+ ],
17
+ "license": "MIT",
18
+ "main": "acorn-es7-plugin.js",
19
+ "name": "acorn-es7-plugin",
20
+ "readmeFilename": "README.md",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/MatAtBread/acorn-es7-plugin.git"
24
+ },
25
+ "scripts": {
26
+ "test": "cd test ; npm i ; npm test"
27
+ },
28
+ "version": "1.1.7"
29
+ }
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = require('./inject')(require('acorn'));
@@ -0,0 +1,449 @@
1
+ 'use strict';
2
+
3
+ var XHTMLEntities = require('./xhtml');
4
+
5
+ var hexNumber = /^[\da-fA-F]+$/;
6
+ var decimalNumber = /^\d+$/;
7
+
8
+ module.exports = function(acorn) {
9
+ var tt = acorn.tokTypes;
10
+ var tc = acorn.tokContexts;
11
+
12
+ tc.j_oTag = new acorn.TokContext('<tag', false);
13
+ tc.j_cTag = new acorn.TokContext('</tag', false);
14
+ tc.j_expr = new acorn.TokContext('<tag>...</tag>', true, true);
15
+
16
+ tt.jsxName = new acorn.TokenType('jsxName');
17
+ tt.jsxText = new acorn.TokenType('jsxText', {beforeExpr: true});
18
+ tt.jsxTagStart = new acorn.TokenType('jsxTagStart');
19
+ tt.jsxTagEnd = new acorn.TokenType('jsxTagEnd');
20
+
21
+ tt.jsxTagStart.updateContext = function() {
22
+ this.context.push(tc.j_expr); // treat as beginning of JSX expression
23
+ this.context.push(tc.j_oTag); // start opening tag context
24
+ this.exprAllowed = false;
25
+ };
26
+ tt.jsxTagEnd.updateContext = function(prevType) {
27
+ var out = this.context.pop();
28
+ if (out === tc.j_oTag && prevType === tt.slash || out === tc.j_cTag) {
29
+ this.context.pop();
30
+ this.exprAllowed = this.curContext() === tc.j_expr;
31
+ } else {
32
+ this.exprAllowed = true;
33
+ }
34
+ };
35
+
36
+ var pp = acorn.Parser.prototype;
37
+
38
+ // Reads inline JSX contents token.
39
+
40
+ pp.jsx_readToken = function() {
41
+ var out = '', chunkStart = this.pos;
42
+ for (;;) {
43
+ if (this.pos >= this.input.length)
44
+ this.raise(this.start, 'Unterminated JSX contents');
45
+ var ch = this.input.charCodeAt(this.pos);
46
+
47
+ switch (ch) {
48
+ case 60: // '<'
49
+ case 123: // '{'
50
+ if (this.pos === this.start) {
51
+ if (ch === 60 && this.exprAllowed) {
52
+ ++this.pos;
53
+ return this.finishToken(tt.jsxTagStart);
54
+ }
55
+ return this.getTokenFromCode(ch);
56
+ }
57
+ out += this.input.slice(chunkStart, this.pos);
58
+ return this.finishToken(tt.jsxText, out);
59
+
60
+ case 38: // '&'
61
+ out += this.input.slice(chunkStart, this.pos);
62
+ out += this.jsx_readEntity();
63
+ chunkStart = this.pos;
64
+ break;
65
+
66
+ default:
67
+ if (acorn.isNewLine(ch)) {
68
+ out += this.input.slice(chunkStart, this.pos);
69
+ out += this.jsx_readNewLine(true);
70
+ chunkStart = this.pos;
71
+ } else {
72
+ ++this.pos;
73
+ }
74
+ }
75
+ }
76
+ };
77
+
78
+ pp.jsx_readNewLine = function(normalizeCRLF) {
79
+ var ch = this.input.charCodeAt(this.pos);
80
+ var out;
81
+ ++this.pos;
82
+ if (ch === 13 && this.input.charCodeAt(this.pos) === 10) {
83
+ ++this.pos;
84
+ out = normalizeCRLF ? '\n' : '\r\n';
85
+ } else {
86
+ out = String.fromCharCode(ch);
87
+ }
88
+ if (this.options.locations) {
89
+ ++this.curLine;
90
+ this.lineStart = this.pos;
91
+ }
92
+
93
+ return out;
94
+ };
95
+
96
+ pp.jsx_readString = function(quote) {
97
+ var out = '', chunkStart = ++this.pos;
98
+ for (;;) {
99
+ if (this.pos >= this.input.length)
100
+ this.raise(this.start, 'Unterminated string constant');
101
+ var ch = this.input.charCodeAt(this.pos);
102
+ if (ch === quote) break;
103
+ if (ch === 38) { // '&'
104
+ out += this.input.slice(chunkStart, this.pos);
105
+ out += this.jsx_readEntity();
106
+ chunkStart = this.pos;
107
+ } else if (acorn.isNewLine(ch)) {
108
+ out += this.input.slice(chunkStart, this.pos);
109
+ out += this.jsx_readNewLine(false);
110
+ chunkStart = this.pos;
111
+ } else {
112
+ ++this.pos;
113
+ }
114
+ }
115
+ out += this.input.slice(chunkStart, this.pos++);
116
+ return this.finishToken(tt.string, out);
117
+ };
118
+
119
+ pp.jsx_readEntity = function() {
120
+ var str = '', count = 0, entity;
121
+ var ch = this.input[this.pos];
122
+ if (ch !== '&')
123
+ this.raise(this.pos, 'Entity must start with an ampersand');
124
+ var startPos = ++this.pos;
125
+ while (this.pos < this.input.length && count++ < 10) {
126
+ ch = this.input[this.pos++];
127
+ if (ch === ';') {
128
+ if (str[0] === '#') {
129
+ if (str[1] === 'x') {
130
+ str = str.substr(2);
131
+ if (hexNumber.test(str))
132
+ entity = String.fromCharCode(parseInt(str, 16));
133
+ } else {
134
+ str = str.substr(1);
135
+ if (decimalNumber.test(str))
136
+ entity = String.fromCharCode(parseInt(str, 10));
137
+ }
138
+ } else {
139
+ entity = XHTMLEntities[str];
140
+ }
141
+ break;
142
+ }
143
+ str += ch;
144
+ }
145
+ if (!entity) {
146
+ this.pos = startPos;
147
+ return '&';
148
+ }
149
+ return entity;
150
+ };
151
+
152
+
153
+ // Read a JSX identifier (valid tag or attribute name).
154
+ //
155
+ // Optimized version since JSX identifiers can't contain
156
+ // escape characters and so can be read as single slice.
157
+ // Also assumes that first character was already checked
158
+ // by isIdentifierStart in readToken.
159
+
160
+ pp.jsx_readWord = function() {
161
+ var ch, start = this.pos;
162
+ do {
163
+ ch = this.input.charCodeAt(++this.pos);
164
+ } while (acorn.isIdentifierChar(ch) || ch === 45); // '-'
165
+ return this.finishToken(tt.jsxName, this.input.slice(start, this.pos));
166
+ };
167
+
168
+ // Transforms JSX element name to string.
169
+
170
+ function getQualifiedJSXName(object) {
171
+ if (!object)
172
+ return object;
173
+
174
+ if (object.type === 'JSXIdentifier')
175
+ return object.name;
176
+
177
+ if (object.type === 'JSXNamespacedName')
178
+ return object.namespace.name + ':' + object.name.name;
179
+
180
+ if (object.type === 'JSXMemberExpression')
181
+ return getQualifiedJSXName(object.object) + '.' +
182
+ getQualifiedJSXName(object.property);
183
+ }
184
+
185
+ // Parse next token as JSX identifier
186
+
187
+ pp.jsx_parseIdentifier = function() {
188
+ var node = this.startNode();
189
+ if (this.type === tt.jsxName)
190
+ node.name = this.value;
191
+ else if (this.type.keyword)
192
+ node.name = this.type.keyword;
193
+ else
194
+ this.unexpected();
195
+ this.next();
196
+ return this.finishNode(node, 'JSXIdentifier');
197
+ };
198
+
199
+ // Parse namespaced identifier.
200
+
201
+ pp.jsx_parseNamespacedName = function() {
202
+ var startPos = this.start, startLoc = this.startLoc;
203
+ var name = this.jsx_parseIdentifier();
204
+ if (!this.options.plugins.jsx.allowNamespaces || !this.eat(tt.colon)) return name;
205
+ var node = this.startNodeAt(startPos, startLoc);
206
+ node.namespace = name;
207
+ node.name = this.jsx_parseIdentifier();
208
+ return this.finishNode(node, 'JSXNamespacedName');
209
+ };
210
+
211
+ // Parses element name in any form - namespaced, member
212
+ // or single identifier.
213
+
214
+ pp.jsx_parseElementName = function() {
215
+ if (this.type === tt.jsxTagEnd)
216
+ return '';
217
+ var startPos = this.start, startLoc = this.startLoc;
218
+ var node = this.jsx_parseNamespacedName();
219
+ if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !this.options.plugins.jsx.allowNamespacedObjects) {
220
+ this.unexpected();
221
+ }
222
+ while (this.eat(tt.dot)) {
223
+ var newNode = this.startNodeAt(startPos, startLoc);
224
+ newNode.object = node;
225
+ newNode.property = this.jsx_parseIdentifier();
226
+ node = this.finishNode(newNode, 'JSXMemberExpression');
227
+ }
228
+ return node;
229
+ };
230
+
231
+ // Parses any type of JSX attribute value.
232
+
233
+ pp.jsx_parseAttributeValue = function() {
234
+ switch (this.type) {
235
+ case tt.braceL:
236
+ var node = this.jsx_parseExpressionContainer();
237
+ if (node.expression.type === 'JSXEmptyExpression')
238
+ this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression');
239
+ return node;
240
+
241
+ case tt.jsxTagStart:
242
+ case tt.string:
243
+ return this.parseExprAtom();
244
+
245
+ default:
246
+ this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text');
247
+ }
248
+ };
249
+
250
+ // JSXEmptyExpression is unique type since it doesn't actually parse anything,
251
+ // and so it should start at the end of last read token (left brace) and finish
252
+ // at the beginning of the next one (right brace).
253
+
254
+ pp.jsx_parseEmptyExpression = function() {
255
+ var node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
256
+ return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc);
257
+ };
258
+
259
+ // Parses JSX expression enclosed into curly brackets.
260
+
261
+
262
+ pp.jsx_parseExpressionContainer = function() {
263
+ var node = this.startNode();
264
+ this.next();
265
+ node.expression = this.type === tt.braceR
266
+ ? this.jsx_parseEmptyExpression()
267
+ : this.parseExpression();
268
+ this.expect(tt.braceR);
269
+ return this.finishNode(node, 'JSXExpressionContainer');
270
+ };
271
+
272
+ // Parses following JSX attribute name-value pair.
273
+
274
+ pp.jsx_parseAttribute = function() {
275
+ var node = this.startNode();
276
+ if (this.eat(tt.braceL)) {
277
+ this.expect(tt.ellipsis);
278
+ node.argument = this.parseMaybeAssign();
279
+ this.expect(tt.braceR);
280
+ return this.finishNode(node, 'JSXSpreadAttribute');
281
+ }
282
+ node.name = this.jsx_parseNamespacedName();
283
+ node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null;
284
+ return this.finishNode(node, 'JSXAttribute');
285
+ };
286
+
287
+ // Parses JSX opening tag starting after '<'.
288
+
289
+ pp.jsx_parseOpeningElementAt = function(startPos, startLoc) {
290
+ var node = this.startNodeAt(startPos, startLoc);
291
+ node.attributes = [];
292
+ var nodeName = this.jsx_parseElementName();
293
+ if (nodeName) node.name = nodeName;
294
+ while (this.type !== tt.slash && this.type !== tt.jsxTagEnd)
295
+ node.attributes.push(this.jsx_parseAttribute());
296
+ node.selfClosing = this.eat(tt.slash);
297
+ this.expect(tt.jsxTagEnd);
298
+ return this.finishNode(node, nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment');
299
+ };
300
+
301
+ // Parses JSX closing tag starting after '</'.
302
+
303
+ pp.jsx_parseClosingElementAt = function(startPos, startLoc) {
304
+ var node = this.startNodeAt(startPos, startLoc);
305
+ var nodeName = this.jsx_parseElementName();
306
+ if (nodeName) node.name = nodeName;
307
+ this.expect(tt.jsxTagEnd);
308
+ return this.finishNode(node, nodeName ? 'JSXClosingElement' : 'JSXClosingFragment');
309
+ };
310
+
311
+ // Parses entire JSX element, including it's opening tag
312
+ // (starting after '<'), attributes, contents and closing tag.
313
+
314
+ pp.jsx_parseElementAt = function(startPos, startLoc) {
315
+ var node = this.startNodeAt(startPos, startLoc);
316
+ var children = [];
317
+ var openingElement = this.jsx_parseOpeningElementAt(startPos, startLoc);
318
+ var closingElement = null;
319
+
320
+ if (!openingElement.selfClosing) {
321
+ contents: for (;;) {
322
+ switch (this.type) {
323
+ case tt.jsxTagStart:
324
+ startPos = this.start; startLoc = this.startLoc;
325
+ this.next();
326
+ if (this.eat(tt.slash)) {
327
+ closingElement = this.jsx_parseClosingElementAt(startPos, startLoc);
328
+ break contents;
329
+ }
330
+ children.push(this.jsx_parseElementAt(startPos, startLoc));
331
+ break;
332
+
333
+ case tt.jsxText:
334
+ children.push(this.parseExprAtom());
335
+ break;
336
+
337
+ case tt.braceL:
338
+ children.push(this.jsx_parseExpressionContainer());
339
+ break;
340
+
341
+ default:
342
+ this.unexpected();
343
+ }
344
+ }
345
+ if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
346
+ this.raise(
347
+ closingElement.start,
348
+ 'Expected corresponding JSX closing tag for <' + getQualifiedJSXName(openingElement.name) + '>');
349
+ }
350
+ }
351
+
352
+ node.openingElement = openingElement;
353
+ node.closingElement = closingElement;
354
+ node.children = children;
355
+ if (this.type === tt.relational && this.value === "<") {
356
+ this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
357
+ }
358
+ return this.finishNode(node, openingElement.name ? 'JSXElement' : 'JSXFragment');
359
+ };
360
+
361
+ // Parse JSX text
362
+
363
+ pp.jsx_parseText = function(value) {
364
+ var node = this.parseLiteral(value);
365
+ node.type = "JSXText";
366
+
367
+ return node;
368
+ };
369
+
370
+ // Parses entire JSX element from current position.
371
+
372
+ pp.jsx_parseElement = function() {
373
+ var startPos = this.start, startLoc = this.startLoc;
374
+ this.next();
375
+ return this.jsx_parseElementAt(startPos, startLoc);
376
+ };
377
+
378
+ acorn.plugins.jsx = function(instance, opts) {
379
+ if (!opts) {
380
+ return;
381
+ }
382
+
383
+ if (typeof opts !== 'object') {
384
+ opts = {};
385
+ }
386
+
387
+ instance.options.plugins.jsx = {
388
+ allowNamespaces: opts.allowNamespaces !== false,
389
+ allowNamespacedObjects: !!opts.allowNamespacedObjects
390
+ };
391
+
392
+ instance.extend('parseExprAtom', function(inner) {
393
+ return function(refShortHandDefaultPos) {
394
+ if (this.type === tt.jsxText)
395
+ return this.jsx_parseText(this.value);
396
+ else if (this.type === tt.jsxTagStart)
397
+ return this.jsx_parseElement();
398
+ else
399
+ return inner.call(this, refShortHandDefaultPos);
400
+ };
401
+ });
402
+
403
+ instance.extend('readToken', function(inner) {
404
+ return function(code) {
405
+ var context = this.curContext();
406
+
407
+ if (context === tc.j_expr) return this.jsx_readToken();
408
+
409
+ if (context === tc.j_oTag || context === tc.j_cTag) {
410
+ if (acorn.isIdentifierStart(code)) return this.jsx_readWord();
411
+
412
+ if (code == 62) {
413
+ ++this.pos;
414
+ return this.finishToken(tt.jsxTagEnd);
415
+ }
416
+
417
+ if ((code === 34 || code === 39) && context == tc.j_oTag)
418
+ return this.jsx_readString(code);
419
+ }
420
+
421
+ if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) {
422
+ ++this.pos;
423
+ return this.finishToken(tt.jsxTagStart);
424
+ }
425
+ return inner.call(this, code);
426
+ };
427
+ });
428
+
429
+ instance.extend('updateContext', function(inner) {
430
+ return function(prevType) {
431
+ if (this.type == tt.braceL) {
432
+ var curContext = this.curContext();
433
+ if (curContext == tc.j_oTag) this.context.push(tc.b_expr);
434
+ else if (curContext == tc.j_expr) this.context.push(tc.b_tmpl);
435
+ else inner.call(this, prevType);
436
+ this.exprAllowed = true;
437
+ } else if (this.type === tt.slash && prevType === tt.jsxTagStart) {
438
+ this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore
439
+ this.context.push(tc.j_cTag); // reconsider as closing tag context
440
+ this.exprAllowed = false;
441
+ } else {
442
+ return inner.call(this, prevType);
443
+ }
444
+ };
445
+ });
446
+ };
447
+
448
+ return acorn;
449
+ };