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,1412 @@
1
+ import { Node, SourceLocation, Token, addLooseExports, defaultOptions, getLineInfo, isNewLine, lineBreak, lineBreakG, tokTypes, tokenizer } from './acorn.es';
2
+
3
+ function noop() {}
4
+
5
+ // Registered plugins
6
+ var pluginsLoose = {};
7
+
8
+ var LooseParser = function LooseParser(input, options) {
9
+ if ( options === void 0 ) options = {};
10
+
11
+ this.toks = tokenizer(input, options);
12
+ this.options = this.toks.options;
13
+ this.input = this.toks.input;
14
+ this.tok = this.last = {type: tokTypes.eof, start: 0, end: 0};
15
+ this.tok.validateRegExpFlags = noop;
16
+ this.tok.validateRegExpPattern = noop;
17
+ if (this.options.locations) {
18
+ var here = this.toks.curPosition();
19
+ this.tok.loc = new SourceLocation(this.toks, here, here);
20
+ }
21
+ this.ahead = []; // Tokens ahead
22
+ this.context = []; // Indentation contexted
23
+ this.curIndent = 0;
24
+ this.curLineStart = 0;
25
+ this.nextLineStart = this.lineEnd(this.curLineStart) + 1;
26
+ this.inAsync = false;
27
+ // Load plugins
28
+ this.options.pluginsLoose = options.pluginsLoose || {};
29
+ this.loadPlugins(this.options.pluginsLoose);
30
+ };
31
+
32
+ LooseParser.prototype.startNode = function startNode () {
33
+ return new Node(this.toks, this.tok.start, this.options.locations ? this.tok.loc.start : null)
34
+ };
35
+
36
+ LooseParser.prototype.storeCurrentPos = function storeCurrentPos () {
37
+ return this.options.locations ? [this.tok.start, this.tok.loc.start] : this.tok.start
38
+ };
39
+
40
+ LooseParser.prototype.startNodeAt = function startNodeAt (pos) {
41
+ if (this.options.locations) {
42
+ return new Node(this.toks, pos[0], pos[1])
43
+ } else {
44
+ return new Node(this.toks, pos)
45
+ }
46
+ };
47
+
48
+ LooseParser.prototype.finishNode = function finishNode (node, type) {
49
+ node.type = type;
50
+ node.end = this.last.end;
51
+ if (this.options.locations)
52
+ { node.loc.end = this.last.loc.end; }
53
+ if (this.options.ranges)
54
+ { node.range[1] = this.last.end; }
55
+ return node
56
+ };
57
+
58
+ LooseParser.prototype.dummyNode = function dummyNode (type) {
59
+ var dummy = this.startNode();
60
+ dummy.type = type;
61
+ dummy.end = dummy.start;
62
+ if (this.options.locations)
63
+ { dummy.loc.end = dummy.loc.start; }
64
+ if (this.options.ranges)
65
+ { dummy.range[1] = dummy.start; }
66
+ this.last = {type: tokTypes.name, start: dummy.start, end: dummy.start, loc: dummy.loc};
67
+ return dummy
68
+ };
69
+
70
+ LooseParser.prototype.dummyIdent = function dummyIdent () {
71
+ var dummy = this.dummyNode("Identifier");
72
+ dummy.name = "✖";
73
+ return dummy
74
+ };
75
+
76
+ LooseParser.prototype.dummyString = function dummyString () {
77
+ var dummy = this.dummyNode("Literal");
78
+ dummy.value = dummy.raw = "✖";
79
+ return dummy
80
+ };
81
+
82
+ LooseParser.prototype.eat = function eat (type) {
83
+ if (this.tok.type === type) {
84
+ this.next();
85
+ return true
86
+ } else {
87
+ return false
88
+ }
89
+ };
90
+
91
+ LooseParser.prototype.isContextual = function isContextual (name) {
92
+ return this.tok.type === tokTypes.name && this.tok.value === name
93
+ };
94
+
95
+ LooseParser.prototype.eatContextual = function eatContextual (name) {
96
+ return this.tok.value === name && this.eat(tokTypes.name)
97
+ };
98
+
99
+ LooseParser.prototype.canInsertSemicolon = function canInsertSemicolon () {
100
+ return this.tok.type === tokTypes.eof || this.tok.type === tokTypes.braceR ||
101
+ lineBreak.test(this.input.slice(this.last.end, this.tok.start))
102
+ };
103
+
104
+ LooseParser.prototype.semicolon = function semicolon () {
105
+ return this.eat(tokTypes.semi)
106
+ };
107
+
108
+ LooseParser.prototype.expect = function expect (type) {
109
+ var this$1 = this;
110
+
111
+ if (this.eat(type)) { return true }
112
+ for (var i = 1; i <= 2; i++) {
113
+ if (this$1.lookAhead(i).type == type) {
114
+ for (var j = 0; j < i; j++) { this$1.next(); }
115
+ return true
116
+ }
117
+ }
118
+ };
119
+
120
+ LooseParser.prototype.pushCx = function pushCx () {
121
+ this.context.push(this.curIndent);
122
+ };
123
+
124
+ LooseParser.prototype.popCx = function popCx () {
125
+ this.curIndent = this.context.pop();
126
+ };
127
+
128
+ LooseParser.prototype.lineEnd = function lineEnd (pos) {
129
+ while (pos < this.input.length && !isNewLine(this.input.charCodeAt(pos))) { ++pos; }
130
+ return pos
131
+ };
132
+
133
+ LooseParser.prototype.indentationAfter = function indentationAfter (pos) {
134
+ var this$1 = this;
135
+
136
+ for (var count = 0;; ++pos) {
137
+ var ch = this$1.input.charCodeAt(pos);
138
+ if (ch === 32) { ++count; }
139
+ else if (ch === 9) { count += this$1.options.tabSize; }
140
+ else { return count }
141
+ }
142
+ };
143
+
144
+ LooseParser.prototype.closes = function closes (closeTok, indent, line, blockHeuristic) {
145
+ if (this.tok.type === closeTok || this.tok.type === tokTypes.eof) { return true }
146
+ return line != this.curLineStart && this.curIndent < indent && this.tokenStartsLine() &&
147
+ (!blockHeuristic || this.nextLineStart >= this.input.length ||
148
+ this.indentationAfter(this.nextLineStart) < indent)
149
+ };
150
+
151
+ LooseParser.prototype.tokenStartsLine = function tokenStartsLine () {
152
+ var this$1 = this;
153
+
154
+ for (var p = this.tok.start - 1; p >= this.curLineStart; --p) {
155
+ var ch = this$1.input.charCodeAt(p);
156
+ if (ch !== 9 && ch !== 32) { return false }
157
+ }
158
+ return true
159
+ };
160
+
161
+ LooseParser.prototype.extend = function extend (name, f) {
162
+ this[name] = f(this[name]);
163
+ };
164
+
165
+ LooseParser.prototype.loadPlugins = function loadPlugins (pluginConfigs) {
166
+ var this$1 = this;
167
+
168
+ for (var name in pluginConfigs) {
169
+ var plugin = pluginsLoose[name];
170
+ if (!plugin) { throw new Error("Plugin '" + name + "' not found") }
171
+ plugin(this$1, pluginConfigs[name]);
172
+ }
173
+ };
174
+
175
+ LooseParser.prototype.parse = function parse () {
176
+ this.next();
177
+ return this.parseTopLevel()
178
+ };
179
+
180
+ var lp = LooseParser.prototype;
181
+
182
+ function isSpace(ch) {
183
+ return (ch < 14 && ch > 8) || ch === 32 || ch === 160 || isNewLine(ch)
184
+ }
185
+
186
+ lp.next = function() {
187
+ var this$1 = this;
188
+
189
+ this.last = this.tok;
190
+ if (this.ahead.length)
191
+ { this.tok = this.ahead.shift(); }
192
+ else
193
+ { this.tok = this.readToken(); }
194
+
195
+ if (this.tok.start >= this.nextLineStart) {
196
+ while (this.tok.start >= this.nextLineStart) {
197
+ this$1.curLineStart = this$1.nextLineStart;
198
+ this$1.nextLineStart = this$1.lineEnd(this$1.curLineStart) + 1;
199
+ }
200
+ this.curIndent = this.indentationAfter(this.curLineStart);
201
+ }
202
+ };
203
+
204
+ lp.readToken = function() {
205
+ var this$1 = this;
206
+
207
+ for (;;) {
208
+ try {
209
+ this$1.toks.next();
210
+ if (this$1.toks.type === tokTypes.dot &&
211
+ this$1.input.substr(this$1.toks.end, 1) === "." &&
212
+ this$1.options.ecmaVersion >= 6) {
213
+ this$1.toks.end++;
214
+ this$1.toks.type = tokTypes.ellipsis;
215
+ }
216
+ return new Token(this$1.toks)
217
+ } catch (e) {
218
+ if (!(e instanceof SyntaxError)) { throw e }
219
+
220
+ // Try to skip some text, based on the error message, and then continue
221
+ var msg = e.message, pos = e.raisedAt, replace = true;
222
+ if (/unterminated/i.test(msg)) {
223
+ pos = this$1.lineEnd(e.pos + 1);
224
+ if (/string/.test(msg)) {
225
+ replace = {start: e.pos, end: pos, type: tokTypes.string, value: this$1.input.slice(e.pos + 1, pos)};
226
+ } else if (/regular expr/i.test(msg)) {
227
+ var re = this$1.input.slice(e.pos, pos);
228
+ try { re = new RegExp(re); } catch (e) { /* ignore compilation error due to new syntax */ }
229
+ replace = {start: e.pos, end: pos, type: tokTypes.regexp, value: re};
230
+ } else if (/template/.test(msg)) {
231
+ replace = {
232
+ start: e.pos,
233
+ end: pos,
234
+ type: tokTypes.template,
235
+ value: this$1.input.slice(e.pos, pos)
236
+ };
237
+ } else {
238
+ replace = false;
239
+ }
240
+ } else if (/invalid (unicode|regexp|number)|expecting unicode|octal literal|is reserved|directly after number|expected number in radix/i.test(msg)) {
241
+ while (pos < this.input.length && !isSpace(this.input.charCodeAt(pos))) { ++pos; }
242
+ } else if (/character escape|expected hexadecimal/i.test(msg)) {
243
+ while (pos < this.input.length) {
244
+ var ch = this$1.input.charCodeAt(pos++);
245
+ if (ch === 34 || ch === 39 || isNewLine(ch)) { break }
246
+ }
247
+ } else if (/unexpected character/i.test(msg)) {
248
+ pos++;
249
+ replace = false;
250
+ } else if (/regular expression/i.test(msg)) {
251
+ replace = true;
252
+ } else {
253
+ throw e
254
+ }
255
+ this$1.resetTo(pos);
256
+ if (replace === true) { replace = {start: pos, end: pos, type: tokTypes.name, value: "✖"}; }
257
+ if (replace) {
258
+ if (this$1.options.locations)
259
+ { replace.loc = new SourceLocation(
260
+ this$1.toks,
261
+ getLineInfo(this$1.input, replace.start),
262
+ getLineInfo(this$1.input, replace.end)); }
263
+ return replace
264
+ }
265
+ }
266
+ }
267
+ };
268
+
269
+ lp.resetTo = function(pos) {
270
+ var this$1 = this;
271
+
272
+ this.toks.pos = pos;
273
+ var ch = this.input.charAt(pos - 1);
274
+ this.toks.exprAllowed = !ch || /[[{(,;:?/*=+\-~!|&%^<>]/.test(ch) ||
275
+ /[enwfd]/.test(ch) &&
276
+ /\b(case|else|return|throw|new|in|(instance|type)?of|delete|void)$/.test(this.input.slice(pos - 10, pos));
277
+
278
+ if (this.options.locations) {
279
+ this.toks.curLine = 1;
280
+ this.toks.lineStart = lineBreakG.lastIndex = 0;
281
+ var match;
282
+ while ((match = lineBreakG.exec(this.input)) && match.index < pos) {
283
+ ++this$1.toks.curLine;
284
+ this$1.toks.lineStart = match.index + match[0].length;
285
+ }
286
+ }
287
+ };
288
+
289
+ lp.lookAhead = function(n) {
290
+ var this$1 = this;
291
+
292
+ while (n > this.ahead.length)
293
+ { this$1.ahead.push(this$1.readToken()); }
294
+ return this.ahead[n - 1]
295
+ };
296
+
297
+ function isDummy(node) { return node.name == "✖" }
298
+
299
+ var lp$1 = LooseParser.prototype;
300
+
301
+ lp$1.parseTopLevel = function() {
302
+ var this$1 = this;
303
+
304
+ var node = this.startNodeAt(this.options.locations ? [0, getLineInfo(this.input, 0)] : 0);
305
+ node.body = [];
306
+ while (this.tok.type !== tokTypes.eof) { node.body.push(this$1.parseStatement()); }
307
+ this.toks.adaptDirectivePrologue(node.body);
308
+ this.last = this.tok;
309
+ if (this.options.ecmaVersion >= 6) {
310
+ node.sourceType = this.options.sourceType;
311
+ }
312
+ return this.finishNode(node, "Program")
313
+ };
314
+
315
+ lp$1.parseStatement = function() {
316
+ var this$1 = this;
317
+
318
+ var starttype = this.tok.type, node = this.startNode(), kind;
319
+
320
+ if (this.toks.isLet()) {
321
+ starttype = tokTypes._var;
322
+ kind = "let";
323
+ }
324
+
325
+ switch (starttype) {
326
+ case tokTypes._break: case tokTypes._continue:
327
+ this.next();
328
+ var isBreak = starttype === tokTypes._break;
329
+ if (this.semicolon() || this.canInsertSemicolon()) {
330
+ node.label = null;
331
+ } else {
332
+ node.label = this.tok.type === tokTypes.name ? this.parseIdent() : null;
333
+ this.semicolon();
334
+ }
335
+ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
336
+
337
+ case tokTypes._debugger:
338
+ this.next();
339
+ this.semicolon();
340
+ return this.finishNode(node, "DebuggerStatement")
341
+
342
+ case tokTypes._do:
343
+ this.next();
344
+ node.body = this.parseStatement();
345
+ node.test = this.eat(tokTypes._while) ? this.parseParenExpression() : this.dummyIdent();
346
+ this.semicolon();
347
+ return this.finishNode(node, "DoWhileStatement")
348
+
349
+ case tokTypes._for:
350
+ this.next(); // `for` keyword
351
+ var isAwait = this.options.ecmaVersion >= 9 && this.inAsync && this.eatContextual("await");
352
+
353
+ this.pushCx();
354
+ this.expect(tokTypes.parenL);
355
+ if (this.tok.type === tokTypes.semi) { return this.parseFor(node, null) }
356
+ var isLet = this.toks.isLet();
357
+ if (isLet || this.tok.type === tokTypes._var || this.tok.type === tokTypes._const) {
358
+ var init$1 = this.parseVar(true, isLet ? "let" : this.tok.value);
359
+ if (init$1.declarations.length === 1 && (this.tok.type === tokTypes._in || this.isContextual("of"))) {
360
+ if (this.options.ecmaVersion >= 9 && this.tok.type !== tokTypes._in) {
361
+ node.await = isAwait;
362
+ }
363
+ return this.parseForIn(node, init$1)
364
+ }
365
+ return this.parseFor(node, init$1)
366
+ }
367
+ var init = this.parseExpression(true);
368
+ if (this.tok.type === tokTypes._in || this.isContextual("of")) {
369
+ if (this.options.ecmaVersion >= 9 && this.tok.type !== tokTypes._in) {
370
+ node.await = isAwait;
371
+ }
372
+ return this.parseForIn(node, this.toAssignable(init))
373
+ }
374
+ return this.parseFor(node, init)
375
+
376
+ case tokTypes._function:
377
+ this.next();
378
+ return this.parseFunction(node, true)
379
+
380
+ case tokTypes._if:
381
+ this.next();
382
+ node.test = this.parseParenExpression();
383
+ node.consequent = this.parseStatement();
384
+ node.alternate = this.eat(tokTypes._else) ? this.parseStatement() : null;
385
+ return this.finishNode(node, "IfStatement")
386
+
387
+ case tokTypes._return:
388
+ this.next();
389
+ if (this.eat(tokTypes.semi) || this.canInsertSemicolon()) { node.argument = null; }
390
+ else { node.argument = this.parseExpression(); this.semicolon(); }
391
+ return this.finishNode(node, "ReturnStatement")
392
+
393
+ case tokTypes._switch:
394
+ var blockIndent = this.curIndent, line = this.curLineStart;
395
+ this.next();
396
+ node.discriminant = this.parseParenExpression();
397
+ node.cases = [];
398
+ this.pushCx();
399
+ this.expect(tokTypes.braceL);
400
+
401
+ var cur;
402
+ while (!this.closes(tokTypes.braceR, blockIndent, line, true)) {
403
+ if (this$1.tok.type === tokTypes._case || this$1.tok.type === tokTypes._default) {
404
+ var isCase = this$1.tok.type === tokTypes._case;
405
+ if (cur) { this$1.finishNode(cur, "SwitchCase"); }
406
+ node.cases.push(cur = this$1.startNode());
407
+ cur.consequent = [];
408
+ this$1.next();
409
+ if (isCase) { cur.test = this$1.parseExpression(); }
410
+ else { cur.test = null; }
411
+ this$1.expect(tokTypes.colon);
412
+ } else {
413
+ if (!cur) {
414
+ node.cases.push(cur = this$1.startNode());
415
+ cur.consequent = [];
416
+ cur.test = null;
417
+ }
418
+ cur.consequent.push(this$1.parseStatement());
419
+ }
420
+ }
421
+ if (cur) { this.finishNode(cur, "SwitchCase"); }
422
+ this.popCx();
423
+ this.eat(tokTypes.braceR);
424
+ return this.finishNode(node, "SwitchStatement")
425
+
426
+ case tokTypes._throw:
427
+ this.next();
428
+ node.argument = this.parseExpression();
429
+ this.semicolon();
430
+ return this.finishNode(node, "ThrowStatement")
431
+
432
+ case tokTypes._try:
433
+ this.next();
434
+ node.block = this.parseBlock();
435
+ node.handler = null;
436
+ if (this.tok.type === tokTypes._catch) {
437
+ var clause = this.startNode();
438
+ this.next();
439
+ this.expect(tokTypes.parenL);
440
+ clause.param = this.toAssignable(this.parseExprAtom(), true);
441
+ this.expect(tokTypes.parenR);
442
+ clause.body = this.parseBlock();
443
+ node.handler = this.finishNode(clause, "CatchClause");
444
+ }
445
+ node.finalizer = this.eat(tokTypes._finally) ? this.parseBlock() : null;
446
+ if (!node.handler && !node.finalizer) { return node.block }
447
+ return this.finishNode(node, "TryStatement")
448
+
449
+ case tokTypes._var:
450
+ case tokTypes._const:
451
+ return this.parseVar(false, kind || this.tok.value)
452
+
453
+ case tokTypes._while:
454
+ this.next();
455
+ node.test = this.parseParenExpression();
456
+ node.body = this.parseStatement();
457
+ return this.finishNode(node, "WhileStatement")
458
+
459
+ case tokTypes._with:
460
+ this.next();
461
+ node.object = this.parseParenExpression();
462
+ node.body = this.parseStatement();
463
+ return this.finishNode(node, "WithStatement")
464
+
465
+ case tokTypes.braceL:
466
+ return this.parseBlock()
467
+
468
+ case tokTypes.semi:
469
+ this.next();
470
+ return this.finishNode(node, "EmptyStatement")
471
+
472
+ case tokTypes._class:
473
+ return this.parseClass(true)
474
+
475
+ case tokTypes._import:
476
+ return this.parseImport()
477
+
478
+ case tokTypes._export:
479
+ return this.parseExport()
480
+
481
+ default:
482
+ if (this.toks.isAsyncFunction()) {
483
+ this.next();
484
+ this.next();
485
+ return this.parseFunction(node, true, true)
486
+ }
487
+ var expr = this.parseExpression();
488
+ if (isDummy(expr)) {
489
+ this.next();
490
+ if (this.tok.type === tokTypes.eof) { return this.finishNode(node, "EmptyStatement") }
491
+ return this.parseStatement()
492
+ } else if (starttype === tokTypes.name && expr.type === "Identifier" && this.eat(tokTypes.colon)) {
493
+ node.body = this.parseStatement();
494
+ node.label = expr;
495
+ return this.finishNode(node, "LabeledStatement")
496
+ } else {
497
+ node.expression = expr;
498
+ this.semicolon();
499
+ return this.finishNode(node, "ExpressionStatement")
500
+ }
501
+ }
502
+ };
503
+
504
+ lp$1.parseBlock = function() {
505
+ var this$1 = this;
506
+
507
+ var node = this.startNode();
508
+ this.pushCx();
509
+ this.expect(tokTypes.braceL);
510
+ var blockIndent = this.curIndent, line = this.curLineStart;
511
+ node.body = [];
512
+ while (!this.closes(tokTypes.braceR, blockIndent, line, true))
513
+ { node.body.push(this$1.parseStatement()); }
514
+ this.popCx();
515
+ this.eat(tokTypes.braceR);
516
+ return this.finishNode(node, "BlockStatement")
517
+ };
518
+
519
+ lp$1.parseFor = function(node, init) {
520
+ node.init = init;
521
+ node.test = node.update = null;
522
+ if (this.eat(tokTypes.semi) && this.tok.type !== tokTypes.semi) { node.test = this.parseExpression(); }
523
+ if (this.eat(tokTypes.semi) && this.tok.type !== tokTypes.parenR) { node.update = this.parseExpression(); }
524
+ this.popCx();
525
+ this.expect(tokTypes.parenR);
526
+ node.body = this.parseStatement();
527
+ return this.finishNode(node, "ForStatement")
528
+ };
529
+
530
+ lp$1.parseForIn = function(node, init) {
531
+ var type = this.tok.type === tokTypes._in ? "ForInStatement" : "ForOfStatement";
532
+ this.next();
533
+ node.left = init;
534
+ node.right = this.parseExpression();
535
+ this.popCx();
536
+ this.expect(tokTypes.parenR);
537
+ node.body = this.parseStatement();
538
+ return this.finishNode(node, type)
539
+ };
540
+
541
+ lp$1.parseVar = function(noIn, kind) {
542
+ var this$1 = this;
543
+
544
+ var node = this.startNode();
545
+ node.kind = kind;
546
+ this.next();
547
+ node.declarations = [];
548
+ do {
549
+ var decl = this$1.startNode();
550
+ decl.id = this$1.options.ecmaVersion >= 6 ? this$1.toAssignable(this$1.parseExprAtom(), true) : this$1.parseIdent();
551
+ decl.init = this$1.eat(tokTypes.eq) ? this$1.parseMaybeAssign(noIn) : null;
552
+ node.declarations.push(this$1.finishNode(decl, "VariableDeclarator"));
553
+ } while (this.eat(tokTypes.comma))
554
+ if (!node.declarations.length) {
555
+ var decl$1 = this.startNode();
556
+ decl$1.id = this.dummyIdent();
557
+ node.declarations.push(this.finishNode(decl$1, "VariableDeclarator"));
558
+ }
559
+ if (!noIn) { this.semicolon(); }
560
+ return this.finishNode(node, "VariableDeclaration")
561
+ };
562
+
563
+ lp$1.parseClass = function(isStatement) {
564
+ var this$1 = this;
565
+
566
+ var node = this.startNode();
567
+ this.next();
568
+ if (this.tok.type === tokTypes.name) { node.id = this.parseIdent(); }
569
+ else if (isStatement === true) { node.id = this.dummyIdent(); }
570
+ else { node.id = null; }
571
+ node.superClass = this.eat(tokTypes._extends) ? this.parseExpression() : null;
572
+ node.body = this.startNode();
573
+ node.body.body = [];
574
+ this.pushCx();
575
+ var indent = this.curIndent + 1, line = this.curLineStart;
576
+ this.eat(tokTypes.braceL);
577
+ if (this.curIndent + 1 < indent) { indent = this.curIndent; line = this.curLineStart; }
578
+ while (!this.closes(tokTypes.braceR, indent, line)) {
579
+ if (this$1.semicolon()) { continue }
580
+ var method = this$1.startNode(), isGenerator = (void 0), isAsync = (void 0);
581
+ if (this$1.options.ecmaVersion >= 6) {
582
+ method.static = false;
583
+ isGenerator = this$1.eat(tokTypes.star);
584
+ }
585
+ this$1.parsePropertyName(method);
586
+ if (isDummy(method.key)) { if (isDummy(this$1.parseMaybeAssign())) { this$1.next(); } this$1.eat(tokTypes.comma); continue }
587
+ if (method.key.type === "Identifier" && !method.computed && method.key.name === "static" &&
588
+ (this$1.tok.type != tokTypes.parenL && this$1.tok.type != tokTypes.braceL)) {
589
+ method.static = true;
590
+ isGenerator = this$1.eat(tokTypes.star);
591
+ this$1.parsePropertyName(method);
592
+ } else {
593
+ method.static = false;
594
+ }
595
+ if (!method.computed &&
596
+ method.key.type === "Identifier" && method.key.name === "async" && this$1.tok.type !== tokTypes.parenL &&
597
+ !this$1.canInsertSemicolon()) {
598
+ isAsync = true;
599
+ isGenerator = this$1.options.ecmaVersion >= 9 && this$1.eat(tokTypes.star);
600
+ this$1.parsePropertyName(method);
601
+ } else {
602
+ isAsync = false;
603
+ }
604
+ if (this$1.options.ecmaVersion >= 5 && method.key.type === "Identifier" &&
605
+ !method.computed && (method.key.name === "get" || method.key.name === "set") &&
606
+ this$1.tok.type !== tokTypes.parenL && this$1.tok.type !== tokTypes.braceL) {
607
+ method.kind = method.key.name;
608
+ this$1.parsePropertyName(method);
609
+ method.value = this$1.parseMethod(false);
610
+ } else {
611
+ if (!method.computed && !method.static && !isGenerator && !isAsync && (
612
+ method.key.type === "Identifier" && method.key.name === "constructor" ||
613
+ method.key.type === "Literal" && method.key.value === "constructor")) {
614
+ method.kind = "constructor";
615
+ } else {
616
+ method.kind = "method";
617
+ }
618
+ method.value = this$1.parseMethod(isGenerator, isAsync);
619
+ }
620
+ node.body.body.push(this$1.finishNode(method, "MethodDefinition"));
621
+ }
622
+ this.popCx();
623
+ if (!this.eat(tokTypes.braceR)) {
624
+ // If there is no closing brace, make the node span to the start
625
+ // of the next token (this is useful for Tern)
626
+ this.last.end = this.tok.start;
627
+ if (this.options.locations) { this.last.loc.end = this.tok.loc.start; }
628
+ }
629
+ this.semicolon();
630
+ this.finishNode(node.body, "ClassBody");
631
+ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
632
+ };
633
+
634
+ lp$1.parseFunction = function(node, isStatement, isAsync) {
635
+ var oldInAsync = this.inAsync;
636
+ this.initFunction(node);
637
+ if (this.options.ecmaVersion >= 6) {
638
+ node.generator = this.eat(tokTypes.star);
639
+ }
640
+ if (this.options.ecmaVersion >= 8) {
641
+ node.async = !!isAsync;
642
+ }
643
+ if (this.tok.type === tokTypes.name) { node.id = this.parseIdent(); }
644
+ else if (isStatement === true) { node.id = this.dummyIdent(); }
645
+ this.inAsync = node.async;
646
+ node.params = this.parseFunctionParams();
647
+ node.body = this.parseBlock();
648
+ this.toks.adaptDirectivePrologue(node.body.body);
649
+ this.inAsync = oldInAsync;
650
+ return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression")
651
+ };
652
+
653
+ lp$1.parseExport = function() {
654
+ var node = this.startNode();
655
+ this.next();
656
+ if (this.eat(tokTypes.star)) {
657
+ node.source = this.eatContextual("from") ? this.parseExprAtom() : this.dummyString();
658
+ return this.finishNode(node, "ExportAllDeclaration")
659
+ }
660
+ if (this.eat(tokTypes._default)) {
661
+ // export default (function foo() {}) // This is FunctionExpression.
662
+ var isAsync;
663
+ if (this.tok.type === tokTypes._function || (isAsync = this.toks.isAsyncFunction())) {
664
+ var fNode = this.startNode();
665
+ this.next();
666
+ if (isAsync) { this.next(); }
667
+ node.declaration = this.parseFunction(fNode, "nullableID", isAsync);
668
+ } else if (this.tok.type === tokTypes._class) {
669
+ node.declaration = this.parseClass("nullableID");
670
+ } else {
671
+ node.declaration = this.parseMaybeAssign();
672
+ this.semicolon();
673
+ }
674
+ return this.finishNode(node, "ExportDefaultDeclaration")
675
+ }
676
+ if (this.tok.type.keyword || this.toks.isLet() || this.toks.isAsyncFunction()) {
677
+ node.declaration = this.parseStatement();
678
+ node.specifiers = [];
679
+ node.source = null;
680
+ } else {
681
+ node.declaration = null;
682
+ node.specifiers = this.parseExportSpecifierList();
683
+ node.source = this.eatContextual("from") ? this.parseExprAtom() : null;
684
+ this.semicolon();
685
+ }
686
+ return this.finishNode(node, "ExportNamedDeclaration")
687
+ };
688
+
689
+ lp$1.parseImport = function() {
690
+ var node = this.startNode();
691
+ this.next();
692
+ if (this.tok.type === tokTypes.string) {
693
+ node.specifiers = [];
694
+ node.source = this.parseExprAtom();
695
+ } else {
696
+ var elt;
697
+ if (this.tok.type === tokTypes.name && this.tok.value !== "from") {
698
+ elt = this.startNode();
699
+ elt.local = this.parseIdent();
700
+ this.finishNode(elt, "ImportDefaultSpecifier");
701
+ this.eat(tokTypes.comma);
702
+ }
703
+ node.specifiers = this.parseImportSpecifierList();
704
+ node.source = this.eatContextual("from") && this.tok.type == tokTypes.string ? this.parseExprAtom() : this.dummyString();
705
+ if (elt) { node.specifiers.unshift(elt); }
706
+ }
707
+ this.semicolon();
708
+ return this.finishNode(node, "ImportDeclaration")
709
+ };
710
+
711
+ lp$1.parseImportSpecifierList = function() {
712
+ var this$1 = this;
713
+
714
+ var elts = [];
715
+ if (this.tok.type === tokTypes.star) {
716
+ var elt = this.startNode();
717
+ this.next();
718
+ elt.local = this.eatContextual("as") ? this.parseIdent() : this.dummyIdent();
719
+ elts.push(this.finishNode(elt, "ImportNamespaceSpecifier"));
720
+ } else {
721
+ var indent = this.curIndent, line = this.curLineStart, continuedLine = this.nextLineStart;
722
+ this.pushCx();
723
+ this.eat(tokTypes.braceL);
724
+ if (this.curLineStart > continuedLine) { continuedLine = this.curLineStart; }
725
+ while (!this.closes(tokTypes.braceR, indent + (this.curLineStart <= continuedLine ? 1 : 0), line)) {
726
+ var elt$1 = this$1.startNode();
727
+ if (this$1.eat(tokTypes.star)) {
728
+ elt$1.local = this$1.eatContextual("as") ? this$1.parseIdent() : this$1.dummyIdent();
729
+ this$1.finishNode(elt$1, "ImportNamespaceSpecifier");
730
+ } else {
731
+ if (this$1.isContextual("from")) { break }
732
+ elt$1.imported = this$1.parseIdent();
733
+ if (isDummy(elt$1.imported)) { break }
734
+ elt$1.local = this$1.eatContextual("as") ? this$1.parseIdent() : elt$1.imported;
735
+ this$1.finishNode(elt$1, "ImportSpecifier");
736
+ }
737
+ elts.push(elt$1);
738
+ this$1.eat(tokTypes.comma);
739
+ }
740
+ this.eat(tokTypes.braceR);
741
+ this.popCx();
742
+ }
743
+ return elts
744
+ };
745
+
746
+ lp$1.parseExportSpecifierList = function() {
747
+ var this$1 = this;
748
+
749
+ var elts = [];
750
+ var indent = this.curIndent, line = this.curLineStart, continuedLine = this.nextLineStart;
751
+ this.pushCx();
752
+ this.eat(tokTypes.braceL);
753
+ if (this.curLineStart > continuedLine) { continuedLine = this.curLineStart; }
754
+ while (!this.closes(tokTypes.braceR, indent + (this.curLineStart <= continuedLine ? 1 : 0), line)) {
755
+ if (this$1.isContextual("from")) { break }
756
+ var elt = this$1.startNode();
757
+ elt.local = this$1.parseIdent();
758
+ if (isDummy(elt.local)) { break }
759
+ elt.exported = this$1.eatContextual("as") ? this$1.parseIdent() : elt.local;
760
+ this$1.finishNode(elt, "ExportSpecifier");
761
+ elts.push(elt);
762
+ this$1.eat(tokTypes.comma);
763
+ }
764
+ this.eat(tokTypes.braceR);
765
+ this.popCx();
766
+ return elts
767
+ };
768
+
769
+ var lp$2 = LooseParser.prototype;
770
+
771
+ lp$2.checkLVal = function(expr) {
772
+ if (!expr) { return expr }
773
+ switch (expr.type) {
774
+ case "Identifier":
775
+ case "MemberExpression":
776
+ return expr
777
+
778
+ case "ParenthesizedExpression":
779
+ expr.expression = this.checkLVal(expr.expression);
780
+ return expr
781
+
782
+ default:
783
+ return this.dummyIdent()
784
+ }
785
+ };
786
+
787
+ lp$2.parseExpression = function(noIn) {
788
+ var this$1 = this;
789
+
790
+ var start = this.storeCurrentPos();
791
+ var expr = this.parseMaybeAssign(noIn);
792
+ if (this.tok.type === tokTypes.comma) {
793
+ var node = this.startNodeAt(start);
794
+ node.expressions = [expr];
795
+ while (this.eat(tokTypes.comma)) { node.expressions.push(this$1.parseMaybeAssign(noIn)); }
796
+ return this.finishNode(node, "SequenceExpression")
797
+ }
798
+ return expr
799
+ };
800
+
801
+ lp$2.parseParenExpression = function() {
802
+ this.pushCx();
803
+ this.expect(tokTypes.parenL);
804
+ var val = this.parseExpression();
805
+ this.popCx();
806
+ this.expect(tokTypes.parenR);
807
+ return val
808
+ };
809
+
810
+ lp$2.parseMaybeAssign = function(noIn) {
811
+ if (this.toks.isContextual("yield")) {
812
+ var node = this.startNode();
813
+ this.next();
814
+ if (this.semicolon() || this.canInsertSemicolon() || (this.tok.type != tokTypes.star && !this.tok.type.startsExpr)) {
815
+ node.delegate = false;
816
+ node.argument = null;
817
+ } else {
818
+ node.delegate = this.eat(tokTypes.star);
819
+ node.argument = this.parseMaybeAssign();
820
+ }
821
+ return this.finishNode(node, "YieldExpression")
822
+ }
823
+
824
+ var start = this.storeCurrentPos();
825
+ var left = this.parseMaybeConditional(noIn);
826
+ if (this.tok.type.isAssign) {
827
+ var node$1 = this.startNodeAt(start);
828
+ node$1.operator = this.tok.value;
829
+ node$1.left = this.tok.type === tokTypes.eq ? this.toAssignable(left) : this.checkLVal(left);
830
+ this.next();
831
+ node$1.right = this.parseMaybeAssign(noIn);
832
+ return this.finishNode(node$1, "AssignmentExpression")
833
+ }
834
+ return left
835
+ };
836
+
837
+ lp$2.parseMaybeConditional = function(noIn) {
838
+ var start = this.storeCurrentPos();
839
+ var expr = this.parseExprOps(noIn);
840
+ if (this.eat(tokTypes.question)) {
841
+ var node = this.startNodeAt(start);
842
+ node.test = expr;
843
+ node.consequent = this.parseMaybeAssign();
844
+ node.alternate = this.expect(tokTypes.colon) ? this.parseMaybeAssign(noIn) : this.dummyIdent();
845
+ return this.finishNode(node, "ConditionalExpression")
846
+ }
847
+ return expr
848
+ };
849
+
850
+ lp$2.parseExprOps = function(noIn) {
851
+ var start = this.storeCurrentPos();
852
+ var indent = this.curIndent, line = this.curLineStart;
853
+ return this.parseExprOp(this.parseMaybeUnary(false), start, -1, noIn, indent, line)
854
+ };
855
+
856
+ lp$2.parseExprOp = function(left, start, minPrec, noIn, indent, line) {
857
+ if (this.curLineStart != line && this.curIndent < indent && this.tokenStartsLine()) { return left }
858
+ var prec = this.tok.type.binop;
859
+ if (prec != null && (!noIn || this.tok.type !== tokTypes._in)) {
860
+ if (prec > minPrec) {
861
+ var node = this.startNodeAt(start);
862
+ node.left = left;
863
+ node.operator = this.tok.value;
864
+ this.next();
865
+ if (this.curLineStart != line && this.curIndent < indent && this.tokenStartsLine()) {
866
+ node.right = this.dummyIdent();
867
+ } else {
868
+ var rightStart = this.storeCurrentPos();
869
+ node.right = this.parseExprOp(this.parseMaybeUnary(false), rightStart, prec, noIn, indent, line);
870
+ }
871
+ this.finishNode(node, /&&|\|\|/.test(node.operator) ? "LogicalExpression" : "BinaryExpression");
872
+ return this.parseExprOp(node, start, minPrec, noIn, indent, line)
873
+ }
874
+ }
875
+ return left
876
+ };
877
+
878
+ lp$2.parseMaybeUnary = function(sawUnary) {
879
+ var this$1 = this;
880
+
881
+ var start = this.storeCurrentPos(), expr;
882
+ if (this.options.ecmaVersion >= 8 && this.inAsync && this.toks.isContextual("await")) {
883
+ expr = this.parseAwait();
884
+ sawUnary = true;
885
+ } else if (this.tok.type.prefix) {
886
+ var node = this.startNode(), update = this.tok.type === tokTypes.incDec;
887
+ if (!update) { sawUnary = true; }
888
+ node.operator = this.tok.value;
889
+ node.prefix = true;
890
+ this.next();
891
+ node.argument = this.parseMaybeUnary(true);
892
+ if (update) { node.argument = this.checkLVal(node.argument); }
893
+ expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
894
+ } else if (this.tok.type === tokTypes.ellipsis) {
895
+ var node$1 = this.startNode();
896
+ this.next();
897
+ node$1.argument = this.parseMaybeUnary(sawUnary);
898
+ expr = this.finishNode(node$1, "SpreadElement");
899
+ } else {
900
+ expr = this.parseExprSubscripts();
901
+ while (this.tok.type.postfix && !this.canInsertSemicolon()) {
902
+ var node$2 = this$1.startNodeAt(start);
903
+ node$2.operator = this$1.tok.value;
904
+ node$2.prefix = false;
905
+ node$2.argument = this$1.checkLVal(expr);
906
+ this$1.next();
907
+ expr = this$1.finishNode(node$2, "UpdateExpression");
908
+ }
909
+ }
910
+
911
+ if (!sawUnary && this.eat(tokTypes.starstar)) {
912
+ var node$3 = this.startNodeAt(start);
913
+ node$3.operator = "**";
914
+ node$3.left = expr;
915
+ node$3.right = this.parseMaybeUnary(false);
916
+ return this.finishNode(node$3, "BinaryExpression")
917
+ }
918
+
919
+ return expr
920
+ };
921
+
922
+ lp$2.parseExprSubscripts = function() {
923
+ var start = this.storeCurrentPos();
924
+ return this.parseSubscripts(this.parseExprAtom(), start, false, this.curIndent, this.curLineStart)
925
+ };
926
+
927
+ lp$2.parseSubscripts = function(base, start, noCalls, startIndent, line) {
928
+ var this$1 = this;
929
+
930
+ for (;;) {
931
+ if (this$1.curLineStart != line && this$1.curIndent <= startIndent && this$1.tokenStartsLine()) {
932
+ if (this$1.tok.type == tokTypes.dot && this$1.curIndent == startIndent)
933
+ { --startIndent; }
934
+ else
935
+ { return base }
936
+ }
937
+
938
+ var maybeAsyncArrow = base.type === "Identifier" && base.name === "async" && !this$1.canInsertSemicolon();
939
+
940
+ if (this$1.eat(tokTypes.dot)) {
941
+ var node = this$1.startNodeAt(start);
942
+ node.object = base;
943
+ if (this$1.curLineStart != line && this$1.curIndent <= startIndent && this$1.tokenStartsLine())
944
+ { node.property = this$1.dummyIdent(); }
945
+ else
946
+ { node.property = this$1.parsePropertyAccessor() || this$1.dummyIdent(); }
947
+ node.computed = false;
948
+ base = this$1.finishNode(node, "MemberExpression");
949
+ } else if (this$1.tok.type == tokTypes.bracketL) {
950
+ this$1.pushCx();
951
+ this$1.next();
952
+ var node$1 = this$1.startNodeAt(start);
953
+ node$1.object = base;
954
+ node$1.property = this$1.parseExpression();
955
+ node$1.computed = true;
956
+ this$1.popCx();
957
+ this$1.expect(tokTypes.bracketR);
958
+ base = this$1.finishNode(node$1, "MemberExpression");
959
+ } else if (!noCalls && this$1.tok.type == tokTypes.parenL) {
960
+ var exprList = this$1.parseExprList(tokTypes.parenR);
961
+ if (maybeAsyncArrow && this$1.eat(tokTypes.arrow))
962
+ { return this$1.parseArrowExpression(this$1.startNodeAt(start), exprList, true) }
963
+ var node$2 = this$1.startNodeAt(start);
964
+ node$2.callee = base;
965
+ node$2.arguments = exprList;
966
+ base = this$1.finishNode(node$2, "CallExpression");
967
+ } else if (this$1.tok.type == tokTypes.backQuote) {
968
+ var node$3 = this$1.startNodeAt(start);
969
+ node$3.tag = base;
970
+ node$3.quasi = this$1.parseTemplate();
971
+ base = this$1.finishNode(node$3, "TaggedTemplateExpression");
972
+ } else {
973
+ return base
974
+ }
975
+ }
976
+ };
977
+
978
+ lp$2.parseExprAtom = function() {
979
+ var node;
980
+ switch (this.tok.type) {
981
+ case tokTypes._this:
982
+ case tokTypes._super:
983
+ var type = this.tok.type === tokTypes._this ? "ThisExpression" : "Super";
984
+ node = this.startNode();
985
+ this.next();
986
+ return this.finishNode(node, type)
987
+
988
+ case tokTypes.name:
989
+ var start = this.storeCurrentPos();
990
+ var id = this.parseIdent();
991
+ var isAsync = false;
992
+ if (id.name === "async" && !this.canInsertSemicolon()) {
993
+ if (this.eat(tokTypes._function))
994
+ { return this.parseFunction(this.startNodeAt(start), false, true) }
995
+ if (this.tok.type === tokTypes.name) {
996
+ id = this.parseIdent();
997
+ isAsync = true;
998
+ }
999
+ }
1000
+ return this.eat(tokTypes.arrow) ? this.parseArrowExpression(this.startNodeAt(start), [id], isAsync) : id
1001
+
1002
+ case tokTypes.regexp:
1003
+ node = this.startNode();
1004
+ var val = this.tok.value;
1005
+ node.regex = {pattern: val.pattern, flags: val.flags};
1006
+ node.value = val.value;
1007
+ node.raw = this.input.slice(this.tok.start, this.tok.end);
1008
+ this.next();
1009
+ return this.finishNode(node, "Literal")
1010
+
1011
+ case tokTypes.num: case tokTypes.string:
1012
+ node = this.startNode();
1013
+ node.value = this.tok.value;
1014
+ node.raw = this.input.slice(this.tok.start, this.tok.end);
1015
+ this.next();
1016
+ return this.finishNode(node, "Literal")
1017
+
1018
+ case tokTypes._null: case tokTypes._true: case tokTypes._false:
1019
+ node = this.startNode();
1020
+ node.value = this.tok.type === tokTypes._null ? null : this.tok.type === tokTypes._true;
1021
+ node.raw = this.tok.type.keyword;
1022
+ this.next();
1023
+ return this.finishNode(node, "Literal")
1024
+
1025
+ case tokTypes.parenL:
1026
+ var parenStart = this.storeCurrentPos();
1027
+ this.next();
1028
+ var inner = this.parseExpression();
1029
+ this.expect(tokTypes.parenR);
1030
+ if (this.eat(tokTypes.arrow)) {
1031
+ // (a,)=>a // SequenceExpression makes dummy in the last hole. Drop the dummy.
1032
+ var params = inner.expressions || [inner];
1033
+ if (params.length && isDummy(params[params.length - 1]))
1034
+ { params.pop(); }
1035
+ return this.parseArrowExpression(this.startNodeAt(parenStart), params)
1036
+ }
1037
+ if (this.options.preserveParens) {
1038
+ var par = this.startNodeAt(parenStart);
1039
+ par.expression = inner;
1040
+ inner = this.finishNode(par, "ParenthesizedExpression");
1041
+ }
1042
+ return inner
1043
+
1044
+ case tokTypes.bracketL:
1045
+ node = this.startNode();
1046
+ node.elements = this.parseExprList(tokTypes.bracketR, true);
1047
+ return this.finishNode(node, "ArrayExpression")
1048
+
1049
+ case tokTypes.braceL:
1050
+ return this.parseObj()
1051
+
1052
+ case tokTypes._class:
1053
+ return this.parseClass(false)
1054
+
1055
+ case tokTypes._function:
1056
+ node = this.startNode();
1057
+ this.next();
1058
+ return this.parseFunction(node, false)
1059
+
1060
+ case tokTypes._new:
1061
+ return this.parseNew()
1062
+
1063
+ case tokTypes.backQuote:
1064
+ return this.parseTemplate()
1065
+
1066
+ default:
1067
+ return this.dummyIdent()
1068
+ }
1069
+ };
1070
+
1071
+ lp$2.parseNew = function() {
1072
+ var node = this.startNode(), startIndent = this.curIndent, line = this.curLineStart;
1073
+ var meta = this.parseIdent(true);
1074
+ if (this.options.ecmaVersion >= 6 && this.eat(tokTypes.dot)) {
1075
+ node.meta = meta;
1076
+ node.property = this.parseIdent(true);
1077
+ return this.finishNode(node, "MetaProperty")
1078
+ }
1079
+ var start = this.storeCurrentPos();
1080
+ node.callee = this.parseSubscripts(this.parseExprAtom(), start, true, startIndent, line);
1081
+ if (this.tok.type == tokTypes.parenL) {
1082
+ node.arguments = this.parseExprList(tokTypes.parenR);
1083
+ } else {
1084
+ node.arguments = [];
1085
+ }
1086
+ return this.finishNode(node, "NewExpression")
1087
+ };
1088
+
1089
+ lp$2.parseTemplateElement = function() {
1090
+ var elem = this.startNode();
1091
+
1092
+ // The loose parser accepts invalid unicode escapes even in untagged templates.
1093
+ if (this.tok.type === tokTypes.invalidTemplate) {
1094
+ elem.value = {
1095
+ raw: this.tok.value,
1096
+ cooked: null
1097
+ };
1098
+ } else {
1099
+ elem.value = {
1100
+ raw: this.input.slice(this.tok.start, this.tok.end).replace(/\r\n?/g, "\n"),
1101
+ cooked: this.tok.value
1102
+ };
1103
+ }
1104
+ this.next();
1105
+ elem.tail = this.tok.type === tokTypes.backQuote;
1106
+ return this.finishNode(elem, "TemplateElement")
1107
+ };
1108
+
1109
+ lp$2.parseTemplate = function() {
1110
+ var this$1 = this;
1111
+
1112
+ var node = this.startNode();
1113
+ this.next();
1114
+ node.expressions = [];
1115
+ var curElt = this.parseTemplateElement();
1116
+ node.quasis = [curElt];
1117
+ while (!curElt.tail) {
1118
+ this$1.next();
1119
+ node.expressions.push(this$1.parseExpression());
1120
+ if (this$1.expect(tokTypes.braceR)) {
1121
+ curElt = this$1.parseTemplateElement();
1122
+ } else {
1123
+ curElt = this$1.startNode();
1124
+ curElt.value = {cooked: "", raw: ""};
1125
+ curElt.tail = true;
1126
+ this$1.finishNode(curElt, "TemplateElement");
1127
+ }
1128
+ node.quasis.push(curElt);
1129
+ }
1130
+ this.expect(tokTypes.backQuote);
1131
+ return this.finishNode(node, "TemplateLiteral")
1132
+ };
1133
+
1134
+ lp$2.parseObj = function() {
1135
+ var this$1 = this;
1136
+
1137
+ var node = this.startNode();
1138
+ node.properties = [];
1139
+ this.pushCx();
1140
+ var indent = this.curIndent + 1, line = this.curLineStart;
1141
+ this.eat(tokTypes.braceL);
1142
+ if (this.curIndent + 1 < indent) { indent = this.curIndent; line = this.curLineStart; }
1143
+ while (!this.closes(tokTypes.braceR, indent, line)) {
1144
+ var prop = this$1.startNode(), isGenerator = (void 0), isAsync = (void 0), start = (void 0);
1145
+ if (this$1.options.ecmaVersion >= 9 && this$1.eat(tokTypes.ellipsis)) {
1146
+ prop.argument = this$1.parseMaybeAssign();
1147
+ node.properties.push(this$1.finishNode(prop, "SpreadElement"));
1148
+ this$1.eat(tokTypes.comma);
1149
+ continue
1150
+ }
1151
+ if (this$1.options.ecmaVersion >= 6) {
1152
+ start = this$1.storeCurrentPos();
1153
+ prop.method = false;
1154
+ prop.shorthand = false;
1155
+ isGenerator = this$1.eat(tokTypes.star);
1156
+ }
1157
+ this$1.parsePropertyName(prop);
1158
+ if (this$1.toks.isAsyncProp(prop)) {
1159
+ isAsync = true;
1160
+ isGenerator = this$1.options.ecmaVersion >= 9 && this$1.eat(tokTypes.star);
1161
+ this$1.parsePropertyName(prop);
1162
+ } else {
1163
+ isAsync = false;
1164
+ }
1165
+ if (isDummy(prop.key)) { if (isDummy(this$1.parseMaybeAssign())) { this$1.next(); } this$1.eat(tokTypes.comma); continue }
1166
+ if (this$1.eat(tokTypes.colon)) {
1167
+ prop.kind = "init";
1168
+ prop.value = this$1.parseMaybeAssign();
1169
+ } else if (this$1.options.ecmaVersion >= 6 && (this$1.tok.type === tokTypes.parenL || this$1.tok.type === tokTypes.braceL)) {
1170
+ prop.kind = "init";
1171
+ prop.method = true;
1172
+ prop.value = this$1.parseMethod(isGenerator, isAsync);
1173
+ } else if (this$1.options.ecmaVersion >= 5 && prop.key.type === "Identifier" &&
1174
+ !prop.computed && (prop.key.name === "get" || prop.key.name === "set") &&
1175
+ (this$1.tok.type != tokTypes.comma && this$1.tok.type != tokTypes.braceR && this$1.tok.type != tokTypes.eq)) {
1176
+ prop.kind = prop.key.name;
1177
+ this$1.parsePropertyName(prop);
1178
+ prop.value = this$1.parseMethod(false);
1179
+ } else {
1180
+ prop.kind = "init";
1181
+ if (this$1.options.ecmaVersion >= 6) {
1182
+ if (this$1.eat(tokTypes.eq)) {
1183
+ var assign = this$1.startNodeAt(start);
1184
+ assign.operator = "=";
1185
+ assign.left = prop.key;
1186
+ assign.right = this$1.parseMaybeAssign();
1187
+ prop.value = this$1.finishNode(assign, "AssignmentExpression");
1188
+ } else {
1189
+ prop.value = prop.key;
1190
+ }
1191
+ } else {
1192
+ prop.value = this$1.dummyIdent();
1193
+ }
1194
+ prop.shorthand = true;
1195
+ }
1196
+ node.properties.push(this$1.finishNode(prop, "Property"));
1197
+ this$1.eat(tokTypes.comma);
1198
+ }
1199
+ this.popCx();
1200
+ if (!this.eat(tokTypes.braceR)) {
1201
+ // If there is no closing brace, make the node span to the start
1202
+ // of the next token (this is useful for Tern)
1203
+ this.last.end = this.tok.start;
1204
+ if (this.options.locations) { this.last.loc.end = this.tok.loc.start; }
1205
+ }
1206
+ return this.finishNode(node, "ObjectExpression")
1207
+ };
1208
+
1209
+ lp$2.parsePropertyName = function(prop) {
1210
+ if (this.options.ecmaVersion >= 6) {
1211
+ if (this.eat(tokTypes.bracketL)) {
1212
+ prop.computed = true;
1213
+ prop.key = this.parseExpression();
1214
+ this.expect(tokTypes.bracketR);
1215
+ return
1216
+ } else {
1217
+ prop.computed = false;
1218
+ }
1219
+ }
1220
+ var key = (this.tok.type === tokTypes.num || this.tok.type === tokTypes.string) ? this.parseExprAtom() : this.parseIdent();
1221
+ prop.key = key || this.dummyIdent();
1222
+ };
1223
+
1224
+ lp$2.parsePropertyAccessor = function() {
1225
+ if (this.tok.type === tokTypes.name || this.tok.type.keyword) { return this.parseIdent() }
1226
+ };
1227
+
1228
+ lp$2.parseIdent = function() {
1229
+ var name = this.tok.type === tokTypes.name ? this.tok.value : this.tok.type.keyword;
1230
+ if (!name) { return this.dummyIdent() }
1231
+ var node = this.startNode();
1232
+ this.next();
1233
+ node.name = name;
1234
+ return this.finishNode(node, "Identifier")
1235
+ };
1236
+
1237
+ lp$2.initFunction = function(node) {
1238
+ node.id = null;
1239
+ node.params = [];
1240
+ if (this.options.ecmaVersion >= 6) {
1241
+ node.generator = false;
1242
+ node.expression = false;
1243
+ }
1244
+ if (this.options.ecmaVersion >= 8)
1245
+ { node.async = false; }
1246
+ };
1247
+
1248
+ // Convert existing expression atom to assignable pattern
1249
+ // if possible.
1250
+
1251
+ lp$2.toAssignable = function(node, binding) {
1252
+ var this$1 = this;
1253
+
1254
+ if (!node || node.type == "Identifier" || (node.type == "MemberExpression" && !binding)) {
1255
+ // Okay
1256
+ } else if (node.type == "ParenthesizedExpression") {
1257
+ this.toAssignable(node.expression, binding);
1258
+ } else if (this.options.ecmaVersion < 6) {
1259
+ return this.dummyIdent()
1260
+ } else if (node.type == "ObjectExpression") {
1261
+ node.type = "ObjectPattern";
1262
+ for (var i = 0, list = node.properties; i < list.length; i += 1)
1263
+ {
1264
+ var prop = list[i];
1265
+
1266
+ this$1.toAssignable(prop, binding);
1267
+ }
1268
+ } else if (node.type == "ArrayExpression") {
1269
+ node.type = "ArrayPattern";
1270
+ this.toAssignableList(node.elements, binding);
1271
+ } else if (node.type == "Property") {
1272
+ this.toAssignable(node.value, binding);
1273
+ } else if (node.type == "SpreadElement") {
1274
+ node.type = "RestElement";
1275
+ this.toAssignable(node.argument, binding);
1276
+ } else if (node.type == "AssignmentExpression") {
1277
+ node.type = "AssignmentPattern";
1278
+ delete node.operator;
1279
+ } else {
1280
+ return this.dummyIdent()
1281
+ }
1282
+ return node
1283
+ };
1284
+
1285
+ lp$2.toAssignableList = function(exprList, binding) {
1286
+ var this$1 = this;
1287
+
1288
+ for (var i = 0, list = exprList; i < list.length; i += 1)
1289
+ {
1290
+ var expr = list[i];
1291
+
1292
+ this$1.toAssignable(expr, binding);
1293
+ }
1294
+ return exprList
1295
+ };
1296
+
1297
+ lp$2.parseFunctionParams = function(params) {
1298
+ params = this.parseExprList(tokTypes.parenR);
1299
+ return this.toAssignableList(params, true)
1300
+ };
1301
+
1302
+ lp$2.parseMethod = function(isGenerator, isAsync) {
1303
+ var node = this.startNode(), oldInAsync = this.inAsync;
1304
+ this.initFunction(node);
1305
+ if (this.options.ecmaVersion >= 6)
1306
+ { node.generator = !!isGenerator; }
1307
+ if (this.options.ecmaVersion >= 8)
1308
+ { node.async = !!isAsync; }
1309
+ this.inAsync = node.async;
1310
+ node.params = this.parseFunctionParams();
1311
+ node.body = this.parseBlock();
1312
+ this.toks.adaptDirectivePrologue(node.body.body);
1313
+ this.inAsync = oldInAsync;
1314
+ return this.finishNode(node, "FunctionExpression")
1315
+ };
1316
+
1317
+ lp$2.parseArrowExpression = function(node, params, isAsync) {
1318
+ var oldInAsync = this.inAsync;
1319
+ this.initFunction(node);
1320
+ if (this.options.ecmaVersion >= 8)
1321
+ { node.async = !!isAsync; }
1322
+ this.inAsync = node.async;
1323
+ node.params = this.toAssignableList(params, true);
1324
+ node.expression = this.tok.type !== tokTypes.braceL;
1325
+ if (node.expression) {
1326
+ node.body = this.parseMaybeAssign();
1327
+ } else {
1328
+ node.body = this.parseBlock();
1329
+ this.toks.adaptDirectivePrologue(node.body.body);
1330
+ }
1331
+ this.inAsync = oldInAsync;
1332
+ return this.finishNode(node, "ArrowFunctionExpression")
1333
+ };
1334
+
1335
+ lp$2.parseExprList = function(close, allowEmpty) {
1336
+ var this$1 = this;
1337
+
1338
+ this.pushCx();
1339
+ var indent = this.curIndent, line = this.curLineStart, elts = [];
1340
+ this.next(); // Opening bracket
1341
+ while (!this.closes(close, indent + 1, line)) {
1342
+ if (this$1.eat(tokTypes.comma)) {
1343
+ elts.push(allowEmpty ? null : this$1.dummyIdent());
1344
+ continue
1345
+ }
1346
+ var elt = this$1.parseMaybeAssign();
1347
+ if (isDummy(elt)) {
1348
+ if (this$1.closes(close, indent, line)) { break }
1349
+ this$1.next();
1350
+ } else {
1351
+ elts.push(elt);
1352
+ }
1353
+ this$1.eat(tokTypes.comma);
1354
+ }
1355
+ this.popCx();
1356
+ if (!this.eat(close)) {
1357
+ // If there is no closing brace, make the node span to the start
1358
+ // of the next token (this is useful for Tern)
1359
+ this.last.end = this.tok.start;
1360
+ if (this.options.locations) { this.last.loc.end = this.tok.loc.start; }
1361
+ }
1362
+ return elts
1363
+ };
1364
+
1365
+ lp$2.parseAwait = function() {
1366
+ var node = this.startNode();
1367
+ this.next();
1368
+ node.argument = this.parseMaybeUnary();
1369
+ return this.finishNode(node, "AwaitExpression")
1370
+ };
1371
+
1372
+ // Acorn: Loose parser
1373
+ //
1374
+ // This module provides an alternative parser (`parse_dammit`) that
1375
+ // exposes that same interface as `parse`, but will try to parse
1376
+ // anything as JavaScript, repairing syntax error the best it can.
1377
+ // There are circumstances in which it will raise an error and give
1378
+ // up, but they are very rare. The resulting AST will be a mostly
1379
+ // valid JavaScript AST (as per the [Mozilla parser API][api], except
1380
+ // that:
1381
+ //
1382
+ // - Return outside functions is allowed
1383
+ //
1384
+ // - Label consistency (no conflicts, break only to existing labels)
1385
+ // is not enforced.
1386
+ //
1387
+ // - Bogus Identifier nodes with a name of `"✖"` are inserted whenever
1388
+ // the parser got too confused to return anything meaningful.
1389
+ //
1390
+ // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
1391
+ //
1392
+ // The expected use for this is to *first* try `acorn.parse`, and only
1393
+ // if that fails switch to `parse_dammit`. The loose parser might
1394
+ // parse badly indented code incorrectly, so **don't** use it as
1395
+ // your default parser.
1396
+ //
1397
+ // Quite a lot of acorn.js is duplicated here. The alternative was to
1398
+ // add a *lot* of extra cruft to that file, making it less readable
1399
+ // and slower. Copying and editing the code allowed me to make
1400
+ // invasive changes and simplifications without creating a complicated
1401
+ // tangle.
1402
+
1403
+ defaultOptions.tabSize = 4;
1404
+
1405
+ // eslint-disable-next-line camelcase
1406
+ function parse_dammit(input, options) {
1407
+ return new LooseParser(input, options).parse()
1408
+ }
1409
+
1410
+ addLooseExports(parse_dammit, LooseParser, pluginsLoose);
1411
+
1412
+ export { parse_dammit, LooseParser, pluginsLoose };