less 3.10.1 → 3.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1038) hide show
  1. package/.github/FUNDING.yml +12 -0
  2. package/CONTRIBUTING.md +2 -2
  3. package/Gruntfile.js +42 -212
  4. package/README.md +31 -1
  5. package/bin/lessc +10787 -12604
  6. package/dist/less.cjs.js +10411 -12115
  7. package/dist/less.js +10680 -13459
  8. package/dist/less.min.js +3 -3
  9. package/dist/less.min.js.map +1 -1
  10. package/lib/less/environment/abstract-file-manager.js +1 -1
  11. package/lib/less/functions/list.js +2 -1
  12. package/lib/less/functions/string.js +1 -2
  13. package/lib/less/index.js +1 -1
  14. package/lib/less/less-error.js +22 -2
  15. package/lib/less/parser/parser.js +9 -12
  16. package/lib/less/tree/namespace-value.js +1 -2
  17. package/lib/less/tree/quoted.js +3 -0
  18. package/lib/less/visitors/visitor.js +10 -2
  19. package/lib/less-node/file-manager.js +19 -49
  20. package/lib/lessc.js +2 -21
  21. package/package.json +17 -14
  22. package/packages/css-parser/node_modules/chevrotain/CHANGELOG.md +2 -0
  23. package/packages/css-parser/node_modules/chevrotain/LICENSE.txt +202 -0
  24. package/packages/css-parser/node_modules/chevrotain/README.md +20 -0
  25. package/packages/css-parser/node_modules/chevrotain/diagrams/README.md +1 -0
  26. package/packages/css-parser/node_modules/chevrotain/diagrams/diagrams.css +85 -0
  27. package/packages/css-parser/node_modules/chevrotain/diagrams/src/diagrams_behavior.js +225 -0
  28. package/packages/css-parser/node_modules/chevrotain/diagrams/src/diagrams_builder.js +211 -0
  29. package/packages/css-parser/node_modules/chevrotain/diagrams/src/diagrams_serializer.js +20 -0
  30. package/packages/css-parser/node_modules/chevrotain/diagrams/src/main.js +38 -0
  31. package/packages/css-parser/node_modules/chevrotain/diagrams/vendor/railroad-diagrams.js +1042 -0
  32. package/packages/css-parser/node_modules/chevrotain/lib/chevrotain.d.ts +2961 -0
  33. package/packages/css-parser/node_modules/chevrotain/lib/chevrotain.js +9785 -0
  34. package/packages/css-parser/node_modules/chevrotain/lib/chevrotain.min.js +2 -0
  35. package/packages/css-parser/node_modules/chevrotain/lib/src/api.js +70 -0
  36. package/packages/css-parser/node_modules/chevrotain/lib/src/diagrams/render_public.js +15 -0
  37. package/packages/css-parser/node_modules/chevrotain/lib/src/generate/generate.js +142 -0
  38. package/packages/css-parser/node_modules/chevrotain/lib/src/generate/generate_public.js +21 -0
  39. package/packages/css-parser/node_modules/chevrotain/lib/src/lang/lang_extensions.js +42 -0
  40. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/constants.js +5 -0
  41. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/cst/cst.js +194 -0
  42. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +129 -0
  43. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/errors_public.js +205 -0
  44. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/exceptions_public.js +58 -0
  45. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/checks.js +590 -0
  46. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/first.js +63 -0
  47. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/follow.js +67 -0
  48. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/gast/gast.js +170 -0
  49. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_public.js +262 -0
  50. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +39 -0
  51. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_visitor_public.js +48 -0
  52. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +548 -0
  53. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/keys.js +42 -0
  54. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +502 -0
  55. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +59 -0
  56. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/grammar/rest.js +112 -0
  57. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/parser.js +235 -0
  58. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/traits/context_assist.js +28 -0
  59. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +83 -0
  60. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +318 -0
  61. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +76 -0
  62. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +108 -0
  63. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/traits/parser_traits.js +7 -0
  64. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +53 -0
  65. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +343 -0
  66. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +645 -0
  67. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +309 -0
  68. package/packages/css-parser/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +290 -0
  69. package/packages/css-parser/node_modules/chevrotain/lib/src/scan/lexer.js +910 -0
  70. package/packages/css-parser/node_modules/chevrotain/lib/src/scan/lexer_errors_public.js +11 -0
  71. package/packages/css-parser/node_modules/chevrotain/lib/src/scan/lexer_public.js +674 -0
  72. package/packages/css-parser/node_modules/chevrotain/lib/src/scan/reg_exp.js +265 -0
  73. package/packages/css-parser/node_modules/chevrotain/lib/src/scan/reg_exp_parser.js +22 -0
  74. package/packages/css-parser/node_modules/chevrotain/lib/src/scan/tokens.js +129 -0
  75. package/packages/css-parser/node_modules/chevrotain/lib/src/scan/tokens_constants.js +4 -0
  76. package/packages/css-parser/node_modules/chevrotain/lib/src/scan/tokens_public.js +95 -0
  77. package/packages/css-parser/node_modules/chevrotain/lib/src/text/range.js +33 -0
  78. package/packages/css-parser/node_modules/chevrotain/lib/src/utils/utils.js +473 -0
  79. package/packages/css-parser/node_modules/chevrotain/lib/src/version.js +7 -0
  80. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/api.js +25 -0
  81. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/diagrams/render_public.js +12 -0
  82. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/generate/generate.js +131 -0
  83. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/generate/generate_public.js +17 -0
  84. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/lang/lang_extensions.js +37 -0
  85. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/constants.js +3 -0
  86. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/cst/cst.js +187 -0
  87. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/cst/cst_visitor.js +121 -0
  88. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/errors_public.js +203 -0
  89. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/exceptions_public.js +51 -0
  90. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/checks.js +574 -0
  91. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/first.js +57 -0
  92. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/follow.js +62 -0
  93. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast.js +163 -0
  94. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast_public.js +258 -0
  95. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast_resolver_public.js +34 -0
  96. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast_visitor_public.js +46 -0
  97. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/interpreter.js +544 -0
  98. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/keys.js +38 -0
  99. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/lookahead.js +489 -0
  100. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/resolver.js +56 -0
  101. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/grammar/rest.js +110 -0
  102. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/parser.js +232 -0
  103. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/traits/context_assist.js +26 -0
  104. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/traits/error_handler.js +81 -0
  105. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/traits/gast_recorder.js +316 -0
  106. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/traits/lexer_adapter.js +74 -0
  107. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/traits/looksahead.js +106 -0
  108. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/traits/parser_traits.js +5 -0
  109. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/traits/perf_tracer.js +51 -0
  110. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/traits/recognizer_api.js +341 -0
  111. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/traits/recognizer_engine.js +643 -0
  112. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/traits/recoverable.js +305 -0
  113. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/parse/parser/traits/tree_builder.js +288 -0
  114. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/scan/lexer.js +885 -0
  115. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/scan/lexer_errors_public.js +9 -0
  116. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/scan/lexer_public.js +672 -0
  117. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/scan/reg_exp.js +260 -0
  118. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/scan/reg_exp_parser.js +18 -0
  119. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/scan/tokens.js +114 -0
  120. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/scan/tokens_constants.js +2 -0
  121. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/scan/tokens_public.js +87 -0
  122. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/text/range.js +30 -0
  123. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/utils/utils.js +420 -0
  124. package/packages/css-parser/node_modules/chevrotain/lib_esm/src/version.js +5 -0
  125. package/packages/css-parser/node_modules/chevrotain/package.json +142 -0
  126. package/{test/browser/vendor → packages/less/.grunt/grunt-contrib-jasmine}/boot.js +8 -4
  127. package/packages/less/.grunt/grunt-contrib-jasmine/jasmine-html.js +473 -0
  128. package/packages/less/.grunt/grunt-contrib-jasmine/jasmine.css +58 -0
  129. package/packages/less/.grunt/grunt-contrib-jasmine/jasmine.js +3454 -0
  130. package/packages/less/.grunt/grunt-contrib-jasmine/jasmine_favicon.png +0 -0
  131. package/packages/less/.grunt/grunt-contrib-jasmine/json2.js +489 -0
  132. package/packages/less/.grunt/grunt-contrib-jasmine/reporter.js +132 -0
  133. package/packages/less/node_modules/@types/jasmine/LICENSE +21 -0
  134. package/packages/less/node_modules/@types/jasmine/README.md +16 -0
  135. package/packages/less/node_modules/@types/jasmine/index.d.ts +954 -0
  136. package/packages/less/node_modules/@types/jasmine/package.json +96 -0
  137. package/packages/less/node_modules/@types/jasmine/ts3.1/index.d.ts +980 -0
  138. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/CHANGELOG.md +263 -0
  139. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/LICENSE +21 -0
  140. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/README.md +187 -0
  141. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.json +75 -0
  142. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.json +7 -0
  143. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js +54 -0
  144. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js.map +1 -0
  145. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.json +37 -0
  146. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/index.js +19 -0
  147. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/index.js.map +1 -0
  148. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js +124 -0
  149. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js.map +1 -0
  150. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js +223 -0
  151. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js.map +1 -0
  152. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js +50 -0
  153. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js.map +1 -0
  154. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-ignore.js +47 -0
  155. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-ignore.js.map +1 -0
  156. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js +113 -0
  157. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js.map +1 -0
  158. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/camelcase.js +109 -0
  159. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/camelcase.js.map +1 -0
  160. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-name-casing.js +91 -0
  161. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-name-casing.js.map +1 -0
  162. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js +86 -0
  163. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js.map +1 -0
  164. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js +203 -0
  165. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js.map +1 -0
  166. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js +150 -0
  167. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js.map +1 -0
  168. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing.js +135 -0
  169. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing.js.map +1 -0
  170. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/generic-type-naming.js +52 -0
  171. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/generic-type-naming.js.map +1 -0
  172. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js +54 -0
  173. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js.map +1 -0
  174. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage.js +220 -0
  175. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage.js.map +1 -0
  176. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo.js +48 -0
  177. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo.js.map +1 -0
  178. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index.js +1138 -0
  179. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index.js.map +1 -0
  180. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js +386 -0
  181. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js.map +1 -0
  182. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js +132 -0
  183. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js.map +1 -0
  184. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/interface-name-prefix.js +65 -0
  185. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/interface-name-prefix.js.map +1 -0
  186. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js +195 -0
  187. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js.map +1 -0
  188. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-naming.js +85 -0
  189. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-naming.js.map +1 -0
  190. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js +320 -0
  191. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map +1 -0
  192. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-angle-bracket-type-assertion.js +41 -0
  193. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-angle-bracket-type-assertion.js.map +1 -0
  194. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js +58 -0
  195. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js.map +1 -0
  196. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js +89 -0
  197. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js.map +1 -0
  198. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js +70 -0
  199. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js.map +1 -0
  200. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js +157 -0
  201. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js.map +1 -0
  202. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js +152 -0
  203. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js.map +1 -0
  204. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js +107 -0
  205. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js.map +1 -0
  206. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js +135 -0
  207. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map +1 -0
  208. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js +49 -0
  209. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js.map +1 -0
  210. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js +180 -0
  211. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js.map +1 -0
  212. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js +147 -0
  213. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js.map +1 -0
  214. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js +91 -0
  215. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js.map +1 -0
  216. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js +209 -0
  217. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js.map +1 -0
  218. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js +63 -0
  219. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js.map +1 -0
  220. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js +37 -0
  221. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js.map +1 -0
  222. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-object-literal-type-assertion.js +78 -0
  223. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-object-literal-type-assertion.js.map +1 -0
  224. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties.js +93 -0
  225. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties.js.map +1 -0
  226. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js +43 -0
  227. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js.map +1 -0
  228. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js +71 -0
  229. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js.map +1 -0
  230. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-triple-slash-reference.js +49 -0
  231. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-triple-slash-reference.js.map +1 -0
  232. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js +208 -0
  233. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js.map +1 -0
  234. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js +137 -0
  235. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js.map +1 -0
  236. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js +225 -0
  237. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js.map +1 -0
  238. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js +83 -0
  239. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js.map +1 -0
  240. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js +217 -0
  241. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js.map +1 -0
  242. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js +70 -0
  243. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js.map +1 -0
  244. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js +43 -0
  245. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js.map +1 -0
  246. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js +166 -0
  247. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js.map +1 -0
  248. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js +125 -0
  249. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js.map +1 -0
  250. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js +170 -0
  251. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js.map +1 -0
  252. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-interface.js +58 -0
  253. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-interface.js.map +1 -0
  254. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js +53 -0
  255. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js.map +1 -0
  256. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js +236 -0
  257. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js.map +1 -0
  258. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js +54 -0
  259. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js.map +1 -0
  260. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js +440 -0
  261. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js.map +1 -0
  262. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js +113 -0
  263. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js.map +1 -0
  264. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js +55 -0
  265. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js.map +1 -0
  266. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js +107 -0
  267. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js.map +1 -0
  268. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js +107 -0
  269. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js.map +1 -0
  270. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/semi.js +66 -0
  271. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/semi.js.map +1 -0
  272. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js +87 -0
  273. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js.map +1 -0
  274. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js +113 -0
  275. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js.map +1 -0
  276. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js +161 -0
  277. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js.map +1 -0
  278. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js +105 -0
  279. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js.map +1 -0
  280. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js +374 -0
  281. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js.map +1 -0
  282. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js +4 -0
  283. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js.map +1 -0
  284. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js +7 -0
  285. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js.map +1 -0
  286. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParserServices.js +19 -0
  287. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParserServices.js.map +1 -0
  288. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js +17 -0
  289. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map +1 -0
  290. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js +65 -0
  291. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js.map +1 -0
  292. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js +159 -0
  293. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js.map +1 -0
  294. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md +89 -0
  295. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md +84 -0
  296. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md +33 -0
  297. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-ignore.md +37 -0
  298. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md +75 -0
  299. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md +202 -0
  300. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-name-casing.md +40 -0
  301. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md +74 -0
  302. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md +179 -0
  303. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md +261 -0
  304. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md +26 -0
  305. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/generic-type-naming.md +42 -0
  306. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md +713 -0
  307. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/interface-name-prefix.md +65 -0
  308. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md +194 -0
  309. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-naming.md +41 -0
  310. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md +649 -0
  311. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-angle-bracket-type-assertion.md +32 -0
  312. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md +34 -0
  313. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md +47 -0
  314. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md +64 -0
  315. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md +165 -0
  316. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md +22 -0
  317. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md +64 -0
  318. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md +46 -0
  319. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md +44 -0
  320. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md +146 -0
  321. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md +68 -0
  322. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md +41 -0
  323. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md +119 -0
  324. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md +107 -0
  325. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md +35 -0
  326. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-object-literal-type-assertion.md +33 -0
  327. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md +367 -0
  328. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md +34 -0
  329. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md +60 -0
  330. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-triple-slash-reference.md +43 -0
  331. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md +467 -0
  332. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +79 -0
  333. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +69 -0
  334. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md +305 -0
  335. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md +171 -0
  336. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md +78 -0
  337. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md +28 -0
  338. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md +41 -0
  339. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md +57 -0
  340. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md +71 -0
  341. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-interface.md +36 -0
  342. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md +22 -0
  343. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md +81 -0
  344. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md +53 -0
  345. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +54 -0
  346. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md +67 -0
  347. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md +50 -0
  348. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md +49 -0
  349. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md +27 -0
  350. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md +28 -0
  351. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md +57 -0
  352. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md +58 -0
  353. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md +289 -0
  354. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md +92 -0
  355. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md +33 -0
  356. package/packages/less/node_modules/@typescript-eslint/eslint-plugin/package.json +60 -0
  357. package/packages/less/node_modules/@typescript-eslint/parser/CHANGELOG.md +150 -0
  358. package/packages/less/node_modules/@typescript-eslint/parser/LICENSE +22 -0
  359. package/packages/less/node_modules/@typescript-eslint/parser/README.md +88 -0
  360. package/packages/less/node_modules/@typescript-eslint/parser/dist/analyze-scope.d.ts +4 -0
  361. package/packages/less/node_modules/@typescript-eslint/parser/dist/analyze-scope.d.ts.map +1 -0
  362. package/packages/less/node_modules/@typescript-eslint/parser/dist/analyze-scope.js +663 -0
  363. package/packages/less/node_modules/@typescript-eslint/parser/dist/analyze-scope.js.map +1 -0
  364. package/packages/less/node_modules/@typescript-eslint/parser/dist/parser-options.d.ts +3 -0
  365. package/packages/less/node_modules/@typescript-eslint/parser/dist/parser-options.d.ts.map +1 -0
  366. package/packages/less/node_modules/@typescript-eslint/parser/dist/parser-options.js +3 -0
  367. package/packages/less/node_modules/@typescript-eslint/parser/dist/parser-options.js.map +1 -0
  368. package/packages/less/node_modules/@typescript-eslint/parser/dist/parser.d.ts +17 -0
  369. package/packages/less/node_modules/@typescript-eslint/parser/dist/parser.d.ts.map +1 -0
  370. package/packages/less/node_modules/@typescript-eslint/parser/dist/parser.js +74 -0
  371. package/packages/less/node_modules/@typescript-eslint/parser/dist/parser.js.map +1 -0
  372. package/packages/less/node_modules/@typescript-eslint/parser/dist/scope/scope-manager.d.ts +14 -0
  373. package/packages/less/node_modules/@typescript-eslint/parser/dist/scope/scope-manager.d.ts.map +1 -0
  374. package/packages/less/node_modules/@typescript-eslint/parser/dist/scope/scope-manager.js +22 -0
  375. package/packages/less/node_modules/@typescript-eslint/parser/dist/scope/scope-manager.js.map +1 -0
  376. package/packages/less/node_modules/@typescript-eslint/parser/dist/scope/scopes.d.ts +11 -0
  377. package/packages/less/node_modules/@typescript-eslint/parser/dist/scope/scopes.d.ts.map +1 -0
  378. package/packages/less/node_modules/@typescript-eslint/parser/dist/scope/scopes.js +18 -0
  379. package/packages/less/node_modules/@typescript-eslint/parser/dist/scope/scopes.js.map +1 -0
  380. package/packages/less/node_modules/@typescript-eslint/parser/dist/simple-traverse.d.ts +7 -0
  381. package/packages/less/node_modules/@typescript-eslint/parser/dist/simple-traverse.d.ts.map +1 -0
  382. package/packages/less/node_modules/@typescript-eslint/parser/dist/simple-traverse.js +42 -0
  383. package/packages/less/node_modules/@typescript-eslint/parser/dist/simple-traverse.js.map +1 -0
  384. package/packages/less/node_modules/@typescript-eslint/parser/dist/visitor-keys.d.ts +3 -0
  385. package/packages/less/node_modules/@typescript-eslint/parser/dist/visitor-keys.d.ts.map +1 -0
  386. package/packages/less/node_modules/@typescript-eslint/parser/dist/visitor-keys.js +129 -0
  387. package/packages/less/node_modules/@typescript-eslint/parser/dist/visitor-keys.js.map +1 -0
  388. package/packages/less/node_modules/@typescript-eslint/parser/package.json +53 -0
  389. package/packages/less/node_modules/acorn/CHANGELOG.md +544 -0
  390. package/packages/less/node_modules/acorn/LICENSE +19 -0
  391. package/packages/less/node_modules/acorn/README.md +269 -0
  392. package/packages/less/node_modules/acorn/bin/acorn +4 -0
  393. package/packages/less/node_modules/acorn/dist/acorn.d.ts +209 -0
  394. package/packages/less/node_modules/acorn/dist/acorn.js +4968 -0
  395. package/packages/less/node_modules/acorn/dist/acorn.js.map +1 -0
  396. package/packages/less/node_modules/acorn/dist/acorn.mjs +4937 -0
  397. package/packages/less/node_modules/acorn/dist/acorn.mjs.map +1 -0
  398. package/packages/less/node_modules/acorn/dist/bin.js +64 -0
  399. package/packages/less/node_modules/acorn/package.json +34 -0
  400. package/packages/less/node_modules/ansi-regex/index.js +10 -0
  401. package/packages/less/node_modules/ansi-regex/license +9 -0
  402. package/packages/less/node_modules/ansi-regex/package.json +53 -0
  403. package/packages/less/node_modules/ansi-regex/readme.md +46 -0
  404. package/packages/less/node_modules/chevrotain/CHANGELOG.md +2 -0
  405. package/packages/less/node_modules/chevrotain/LICENSE.txt +202 -0
  406. package/packages/less/node_modules/chevrotain/README.md +20 -0
  407. package/packages/less/node_modules/chevrotain/diagrams/README.md +1 -0
  408. package/packages/less/node_modules/chevrotain/diagrams/diagrams.css +85 -0
  409. package/packages/less/node_modules/chevrotain/diagrams/src/diagrams_behavior.js +225 -0
  410. package/packages/less/node_modules/chevrotain/diagrams/src/diagrams_builder.js +211 -0
  411. package/packages/less/node_modules/chevrotain/diagrams/src/diagrams_serializer.js +20 -0
  412. package/packages/less/node_modules/chevrotain/diagrams/src/main.js +38 -0
  413. package/packages/less/node_modules/chevrotain/diagrams/vendor/railroad-diagrams.js +1042 -0
  414. package/packages/less/node_modules/chevrotain/lib/chevrotain.d.ts +2961 -0
  415. package/packages/less/node_modules/chevrotain/lib/chevrotain.js +9785 -0
  416. package/packages/less/node_modules/chevrotain/lib/chevrotain.min.js +2 -0
  417. package/packages/less/node_modules/chevrotain/lib/src/api.js +70 -0
  418. package/packages/less/node_modules/chevrotain/lib/src/diagrams/render_public.js +15 -0
  419. package/packages/less/node_modules/chevrotain/lib/src/generate/generate.js +142 -0
  420. package/packages/less/node_modules/chevrotain/lib/src/generate/generate_public.js +21 -0
  421. package/packages/less/node_modules/chevrotain/lib/src/lang/lang_extensions.js +42 -0
  422. package/packages/less/node_modules/chevrotain/lib/src/parse/constants.js +5 -0
  423. package/packages/less/node_modules/chevrotain/lib/src/parse/cst/cst.js +194 -0
  424. package/packages/less/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +129 -0
  425. package/packages/less/node_modules/chevrotain/lib/src/parse/errors_public.js +205 -0
  426. package/packages/less/node_modules/chevrotain/lib/src/parse/exceptions_public.js +58 -0
  427. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/checks.js +590 -0
  428. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/first.js +63 -0
  429. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/follow.js +67 -0
  430. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/gast/gast.js +170 -0
  431. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_public.js +262 -0
  432. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +39 -0
  433. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_visitor_public.js +48 -0
  434. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +548 -0
  435. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/keys.js +42 -0
  436. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +502 -0
  437. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +59 -0
  438. package/packages/less/node_modules/chevrotain/lib/src/parse/grammar/rest.js +112 -0
  439. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/parser.js +235 -0
  440. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/traits/context_assist.js +28 -0
  441. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +83 -0
  442. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +318 -0
  443. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +76 -0
  444. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +108 -0
  445. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/traits/parser_traits.js +7 -0
  446. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +53 -0
  447. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +343 -0
  448. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +645 -0
  449. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +309 -0
  450. package/packages/less/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +290 -0
  451. package/packages/less/node_modules/chevrotain/lib/src/scan/lexer.js +910 -0
  452. package/packages/less/node_modules/chevrotain/lib/src/scan/lexer_errors_public.js +11 -0
  453. package/packages/less/node_modules/chevrotain/lib/src/scan/lexer_public.js +674 -0
  454. package/packages/less/node_modules/chevrotain/lib/src/scan/reg_exp.js +265 -0
  455. package/packages/less/node_modules/chevrotain/lib/src/scan/reg_exp_parser.js +22 -0
  456. package/packages/less/node_modules/chevrotain/lib/src/scan/tokens.js +129 -0
  457. package/packages/less/node_modules/chevrotain/lib/src/scan/tokens_constants.js +4 -0
  458. package/packages/less/node_modules/chevrotain/lib/src/scan/tokens_public.js +95 -0
  459. package/packages/less/node_modules/chevrotain/lib/src/text/range.js +33 -0
  460. package/packages/less/node_modules/chevrotain/lib/src/utils/utils.js +473 -0
  461. package/packages/less/node_modules/chevrotain/lib/src/version.js +7 -0
  462. package/packages/less/node_modules/chevrotain/lib_esm/src/api.js +25 -0
  463. package/packages/less/node_modules/chevrotain/lib_esm/src/diagrams/render_public.js +12 -0
  464. package/packages/less/node_modules/chevrotain/lib_esm/src/generate/generate.js +131 -0
  465. package/packages/less/node_modules/chevrotain/lib_esm/src/generate/generate_public.js +17 -0
  466. package/packages/less/node_modules/chevrotain/lib_esm/src/lang/lang_extensions.js +37 -0
  467. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/constants.js +3 -0
  468. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/cst/cst.js +187 -0
  469. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/cst/cst_visitor.js +121 -0
  470. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/errors_public.js +203 -0
  471. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/exceptions_public.js +51 -0
  472. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/checks.js +574 -0
  473. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/first.js +57 -0
  474. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/follow.js +62 -0
  475. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast.js +163 -0
  476. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast_public.js +258 -0
  477. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast_resolver_public.js +34 -0
  478. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast_visitor_public.js +46 -0
  479. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/interpreter.js +544 -0
  480. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/keys.js +38 -0
  481. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/lookahead.js +489 -0
  482. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/resolver.js +56 -0
  483. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/grammar/rest.js +110 -0
  484. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/parser.js +232 -0
  485. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/traits/context_assist.js +26 -0
  486. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/traits/error_handler.js +81 -0
  487. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/traits/gast_recorder.js +316 -0
  488. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/traits/lexer_adapter.js +74 -0
  489. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/traits/looksahead.js +106 -0
  490. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/traits/parser_traits.js +5 -0
  491. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/traits/perf_tracer.js +51 -0
  492. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/traits/recognizer_api.js +341 -0
  493. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/traits/recognizer_engine.js +643 -0
  494. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/traits/recoverable.js +305 -0
  495. package/packages/less/node_modules/chevrotain/lib_esm/src/parse/parser/traits/tree_builder.js +288 -0
  496. package/packages/less/node_modules/chevrotain/lib_esm/src/scan/lexer.js +885 -0
  497. package/packages/less/node_modules/chevrotain/lib_esm/src/scan/lexer_errors_public.js +9 -0
  498. package/packages/less/node_modules/chevrotain/lib_esm/src/scan/lexer_public.js +672 -0
  499. package/packages/less/node_modules/chevrotain/lib_esm/src/scan/reg_exp.js +260 -0
  500. package/packages/less/node_modules/chevrotain/lib_esm/src/scan/reg_exp_parser.js +18 -0
  501. package/packages/less/node_modules/chevrotain/lib_esm/src/scan/tokens.js +114 -0
  502. package/packages/less/node_modules/chevrotain/lib_esm/src/scan/tokens_constants.js +2 -0
  503. package/packages/less/node_modules/chevrotain/lib_esm/src/scan/tokens_public.js +87 -0
  504. package/packages/less/node_modules/chevrotain/lib_esm/src/text/range.js +30 -0
  505. package/packages/less/node_modules/chevrotain/lib_esm/src/utils/utils.js +420 -0
  506. package/packages/less/node_modules/chevrotain/lib_esm/src/version.js +5 -0
  507. package/packages/less/node_modules/chevrotain/package.json +142 -0
  508. package/packages/less/node_modules/debug/CHANGELOG.md +395 -0
  509. package/packages/less/node_modules/debug/LICENSE +19 -0
  510. package/packages/less/node_modules/debug/README.md +455 -0
  511. package/packages/less/node_modules/debug/dist/debug.js +912 -0
  512. package/packages/less/node_modules/debug/package.json +63 -0
  513. package/packages/less/node_modules/debug/src/browser.js +264 -0
  514. package/packages/less/node_modules/debug/src/common.js +266 -0
  515. package/packages/less/node_modules/debug/src/index.js +10 -0
  516. package/packages/less/node_modules/debug/src/node.js +257 -0
  517. package/packages/less/node_modules/eslint/CHANGELOG.md +5110 -0
  518. package/packages/less/node_modules/eslint/LICENSE +19 -0
  519. package/packages/less/node_modules/eslint/README.md +293 -0
  520. package/packages/less/node_modules/eslint/bin/eslint.js +79 -0
  521. package/packages/less/node_modules/eslint/conf/category-list.json +40 -0
  522. package/packages/less/node_modules/eslint/conf/config-schema.js +70 -0
  523. package/packages/less/node_modules/eslint/conf/default-cli-options.js +31 -0
  524. package/packages/less/node_modules/eslint/conf/environments.js +109 -0
  525. package/packages/less/node_modules/eslint/conf/eslint-all.js +29 -0
  526. package/packages/less/node_modules/eslint/conf/eslint-recommended.js +15 -0
  527. package/packages/less/node_modules/eslint/conf/replacements.json +22 -0
  528. package/packages/less/node_modules/eslint/lib/api.js +28 -0
  529. package/packages/less/node_modules/eslint/lib/built-in-rules-index.js +278 -0
  530. package/packages/less/node_modules/eslint/lib/cli-engine.js +796 -0
  531. package/packages/less/node_modules/eslint/lib/cli.js +235 -0
  532. package/packages/less/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js +683 -0
  533. package/packages/less/node_modules/eslint/lib/code-path-analysis/code-path-segment.js +245 -0
  534. package/packages/less/node_modules/eslint/lib/code-path-analysis/code-path-state.js +1440 -0
  535. package/packages/less/node_modules/eslint/lib/code-path-analysis/code-path.js +239 -0
  536. package/packages/less/node_modules/eslint/lib/code-path-analysis/debug-helpers.js +200 -0
  537. package/packages/less/node_modules/eslint/lib/code-path-analysis/fork-context.js +260 -0
  538. package/packages/less/node_modules/eslint/lib/code-path-analysis/id-generator.js +46 -0
  539. package/packages/less/node_modules/eslint/lib/config/autoconfig.js +358 -0
  540. package/packages/less/node_modules/eslint/lib/config/config-cache.js +130 -0
  541. package/packages/less/node_modules/eslint/lib/config/config-file.js +640 -0
  542. package/packages/less/node_modules/eslint/lib/config/config-initializer.js +654 -0
  543. package/packages/less/node_modules/eslint/lib/config/config-ops.js +404 -0
  544. package/packages/less/node_modules/eslint/lib/config/config-rule.js +319 -0
  545. package/packages/less/node_modules/eslint/lib/config/config-validator.js +279 -0
  546. package/packages/less/node_modules/eslint/lib/config/environments.js +84 -0
  547. package/packages/less/node_modules/eslint/lib/config/plugins.js +169 -0
  548. package/packages/less/node_modules/eslint/lib/config.js +377 -0
  549. package/packages/less/node_modules/eslint/lib/formatters/checkstyle.js +60 -0
  550. package/packages/less/node_modules/eslint/lib/formatters/codeframe.js +138 -0
  551. package/packages/less/node_modules/eslint/lib/formatters/compact.js +60 -0
  552. package/packages/less/node_modules/eslint/lib/formatters/html-template-message.html +8 -0
  553. package/packages/less/node_modules/eslint/lib/formatters/html-template-page.html +115 -0
  554. package/packages/less/node_modules/eslint/lib/formatters/html-template-result.html +6 -0
  555. package/packages/less/node_modules/eslint/lib/formatters/html.js +139 -0
  556. package/packages/less/node_modules/eslint/lib/formatters/jslint-xml.js +41 -0
  557. package/packages/less/node_modules/eslint/lib/formatters/json-with-metadata.js +16 -0
  558. package/packages/less/node_modules/eslint/lib/formatters/json.js +13 -0
  559. package/packages/less/node_modules/eslint/lib/formatters/junit.js +70 -0
  560. package/packages/less/node_modules/eslint/lib/formatters/stylish.js +100 -0
  561. package/packages/less/node_modules/eslint/lib/formatters/table.js +159 -0
  562. package/packages/less/node_modules/eslint/lib/formatters/tap.js +95 -0
  563. package/packages/less/node_modules/eslint/lib/formatters/unix.js +58 -0
  564. package/packages/less/node_modules/eslint/lib/formatters/visualstudio.js +63 -0
  565. package/packages/less/node_modules/eslint/lib/linter.js +1085 -0
  566. package/packages/less/node_modules/eslint/lib/load-rules.js +46 -0
  567. package/packages/less/node_modules/eslint/lib/options.js +246 -0
  568. package/packages/less/node_modules/eslint/lib/rules/accessor-pairs.js +167 -0
  569. package/packages/less/node_modules/eslint/lib/rules/array-bracket-newline.js +261 -0
  570. package/packages/less/node_modules/eslint/lib/rules/array-bracket-spacing.js +241 -0
  571. package/packages/less/node_modules/eslint/lib/rules/array-callback-return.js +258 -0
  572. package/packages/less/node_modules/eslint/lib/rules/array-element-newline.js +262 -0
  573. package/packages/less/node_modules/eslint/lib/rules/arrow-body-style.js +240 -0
  574. package/packages/less/node_modules/eslint/lib/rules/arrow-parens.js +164 -0
  575. package/packages/less/node_modules/eslint/lib/rules/arrow-spacing.js +161 -0
  576. package/packages/less/node_modules/eslint/lib/rules/block-scoped-var.js +122 -0
  577. package/packages/less/node_modules/eslint/lib/rules/block-spacing.js +147 -0
  578. package/packages/less/node_modules/eslint/lib/rules/brace-style.js +188 -0
  579. package/packages/less/node_modules/eslint/lib/rules/callback-return.js +182 -0
  580. package/packages/less/node_modules/eslint/lib/rules/camelcase.js +228 -0
  581. package/packages/less/node_modules/eslint/lib/rules/capitalized-comments.js +307 -0
  582. package/packages/less/node_modules/eslint/lib/rules/class-methods-use-this.js +118 -0
  583. package/packages/less/node_modules/eslint/lib/rules/comma-dangle.js +345 -0
  584. package/packages/less/node_modules/eslint/lib/rules/comma-spacing.js +195 -0
  585. package/packages/less/node_modules/eslint/lib/rules/comma-style.js +315 -0
  586. package/packages/less/node_modules/eslint/lib/rules/complexity.js +160 -0
  587. package/packages/less/node_modules/eslint/lib/rules/computed-property-spacing.js +187 -0
  588. package/packages/less/node_modules/eslint/lib/rules/consistent-return.js +197 -0
  589. package/packages/less/node_modules/eslint/lib/rules/consistent-this.js +151 -0
  590. package/packages/less/node_modules/eslint/lib/rules/constructor-super.js +397 -0
  591. package/packages/less/node_modules/eslint/lib/rules/curly.js +382 -0
  592. package/packages/less/node_modules/eslint/lib/rules/default-case.js +97 -0
  593. package/packages/less/node_modules/eslint/lib/rules/dot-location.js +96 -0
  594. package/packages/less/node_modules/eslint/lib/rules/dot-notation.js +169 -0
  595. package/packages/less/node_modules/eslint/lib/rules/eol-last.js +112 -0
  596. package/packages/less/node_modules/eslint/lib/rules/eqeqeq.js +186 -0
  597. package/packages/less/node_modules/eslint/lib/rules/for-direction.js +126 -0
  598. package/packages/less/node_modules/eslint/lib/rules/func-call-spacing.js +168 -0
  599. package/packages/less/node_modules/eslint/lib/rules/func-name-matching.js +251 -0
  600. package/packages/less/node_modules/eslint/lib/rules/func-names.js +179 -0
  601. package/packages/less/node_modules/eslint/lib/rules/func-style.js +98 -0
  602. package/packages/less/node_modules/eslint/lib/rules/function-paren-newline.js +233 -0
  603. package/packages/less/node_modules/eslint/lib/rules/generator-star-spacing.js +211 -0
  604. package/packages/less/node_modules/eslint/lib/rules/getter-return.js +186 -0
  605. package/packages/less/node_modules/eslint/lib/rules/global-require.js +81 -0
  606. package/packages/less/node_modules/eslint/lib/rules/guard-for-in.js +76 -0
  607. package/packages/less/node_modules/eslint/lib/rules/handle-callback-err.js +95 -0
  608. package/packages/less/node_modules/eslint/lib/rules/id-blacklist.js +127 -0
  609. package/packages/less/node_modules/eslint/lib/rules/id-length.js +122 -0
  610. package/packages/less/node_modules/eslint/lib/rules/id-match.js +225 -0
  611. package/packages/less/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js +81 -0
  612. package/packages/less/node_modules/eslint/lib/rules/indent-legacy.js +1141 -0
  613. package/packages/less/node_modules/eslint/lib/rules/indent.js +1608 -0
  614. package/packages/less/node_modules/eslint/lib/rules/init-declarations.js +139 -0
  615. package/packages/less/node_modules/eslint/lib/rules/jsx-quotes.js +95 -0
  616. package/packages/less/node_modules/eslint/lib/rules/key-spacing.js +652 -0
  617. package/packages/less/node_modules/eslint/lib/rules/keyword-spacing.js +590 -0
  618. package/packages/less/node_modules/eslint/lib/rules/line-comment-position.js +123 -0
  619. package/packages/less/node_modules/eslint/lib/rules/linebreak-style.js +99 -0
  620. package/packages/less/node_modules/eslint/lib/rules/lines-around-comment.js +404 -0
  621. package/packages/less/node_modules/eslint/lib/rules/lines-around-directive.js +201 -0
  622. package/packages/less/node_modules/eslint/lib/rules/lines-between-class-members.js +144 -0
  623. package/packages/less/node_modules/eslint/lib/rules/max-classes-per-file.js +64 -0
  624. package/packages/less/node_modules/eslint/lib/rules/max-depth.js +154 -0
  625. package/packages/less/node_modules/eslint/lib/rules/max-len.js +386 -0
  626. package/packages/less/node_modules/eslint/lib/rules/max-lines-per-function.js +219 -0
  627. package/packages/less/node_modules/eslint/lib/rules/max-lines.js +148 -0
  628. package/packages/less/node_modules/eslint/lib/rules/max-nested-callbacks.js +117 -0
  629. package/packages/less/node_modules/eslint/lib/rules/max-params.js +103 -0
  630. package/packages/less/node_modules/eslint/lib/rules/max-statements-per-line.js +200 -0
  631. package/packages/less/node_modules/eslint/lib/rules/max-statements.js +175 -0
  632. package/packages/less/node_modules/eslint/lib/rules/multiline-comment-style.js +299 -0
  633. package/packages/less/node_modules/eslint/lib/rules/multiline-ternary.js +95 -0
  634. package/packages/less/node_modules/eslint/lib/rules/new-cap.js +282 -0
  635. package/packages/less/node_modules/eslint/lib/rules/new-parens.js +63 -0
  636. package/packages/less/node_modules/eslint/lib/rules/newline-after-var.js +256 -0
  637. package/packages/less/node_modules/eslint/lib/rules/newline-before-return.js +218 -0
  638. package/packages/less/node_modules/eslint/lib/rules/newline-per-chained-call.js +112 -0
  639. package/packages/less/node_modules/eslint/lib/rules/no-alert.js +127 -0
  640. package/packages/less/node_modules/eslint/lib/rules/no-array-constructor.js +54 -0
  641. package/packages/less/node_modules/eslint/lib/rules/no-async-promise-executor.js +39 -0
  642. package/packages/less/node_modules/eslint/lib/rules/no-await-in-loop.js +106 -0
  643. package/packages/less/node_modules/eslint/lib/rules/no-bitwise.js +119 -0
  644. package/packages/less/node_modules/eslint/lib/rules/no-buffer-constructor.js +45 -0
  645. package/packages/less/node_modules/eslint/lib/rules/no-caller.js +46 -0
  646. package/packages/less/node_modules/eslint/lib/rules/no-case-declarations.js +64 -0
  647. package/packages/less/node_modules/eslint/lib/rules/no-catch-shadow.js +80 -0
  648. package/packages/less/node_modules/eslint/lib/rules/no-class-assign.js +61 -0
  649. package/packages/less/node_modules/eslint/lib/rules/no-compare-neg-zero.js +61 -0
  650. package/packages/less/node_modules/eslint/lib/rules/no-cond-assign.js +149 -0
  651. package/packages/less/node_modules/eslint/lib/rules/no-confusing-arrow.js +83 -0
  652. package/packages/less/node_modules/eslint/lib/rules/no-console.js +138 -0
  653. package/packages/less/node_modules/eslint/lib/rules/no-const-assign.js +54 -0
  654. package/packages/less/node_modules/eslint/lib/rules/no-constant-condition.js +239 -0
  655. package/packages/less/node_modules/eslint/lib/rules/no-continue.js +39 -0
  656. package/packages/less/node_modules/eslint/lib/rules/no-control-regex.js +113 -0
  657. package/packages/less/node_modules/eslint/lib/rules/no-debugger.js +43 -0
  658. package/packages/less/node_modules/eslint/lib/rules/no-delete-var.js +42 -0
  659. package/packages/less/node_modules/eslint/lib/rules/no-div-regex.js +45 -0
  660. package/packages/less/node_modules/eslint/lib/rules/no-dupe-args.js +80 -0
  661. package/packages/less/node_modules/eslint/lib/rules/no-dupe-class-members.js +116 -0
  662. package/packages/less/node_modules/eslint/lib/rules/no-dupe-keys.js +142 -0
  663. package/packages/less/node_modules/eslint/lib/rules/no-duplicate-case.js +50 -0
  664. package/packages/less/node_modules/eslint/lib/rules/no-duplicate-imports.js +146 -0
  665. package/packages/less/node_modules/eslint/lib/rules/no-else-return.js +285 -0
  666. package/packages/less/node_modules/eslint/lib/rules/no-empty-character-class.js +64 -0
  667. package/packages/less/node_modules/eslint/lib/rules/no-empty-function.js +167 -0
  668. package/packages/less/node_modules/eslint/lib/rules/no-empty-pattern.js +43 -0
  669. package/packages/less/node_modules/eslint/lib/rules/no-empty.js +86 -0
  670. package/packages/less/node_modules/eslint/lib/rules/no-eq-null.js +46 -0
  671. package/packages/less/node_modules/eslint/lib/rules/no-eval.js +314 -0
  672. package/packages/less/node_modules/eslint/lib/rules/no-ex-assign.js +52 -0
  673. package/packages/less/node_modules/eslint/lib/rules/no-extend-native.js +181 -0
  674. package/packages/less/node_modules/eslint/lib/rules/no-extra-bind.js +173 -0
  675. package/packages/less/node_modules/eslint/lib/rules/no-extra-boolean-cast.js +129 -0
  676. package/packages/less/node_modules/eslint/lib/rules/no-extra-label.js +146 -0
  677. package/packages/less/node_modules/eslint/lib/rules/no-extra-parens.js +756 -0
  678. package/packages/less/node_modules/eslint/lib/rules/no-extra-semi.js +127 -0
  679. package/packages/less/node_modules/eslint/lib/rules/no-fallthrough.js +142 -0
  680. package/packages/less/node_modules/eslint/lib/rules/no-floating-decimal.js +70 -0
  681. package/packages/less/node_modules/eslint/lib/rules/no-func-assign.js +66 -0
  682. package/packages/less/node_modules/eslint/lib/rules/no-global-assign.js +88 -0
  683. package/packages/less/node_modules/eslint/lib/rules/no-implicit-coercion.js +296 -0
  684. package/packages/less/node_modules/eslint/lib/rules/no-implicit-globals.js +58 -0
  685. package/packages/less/node_modules/eslint/lib/rules/no-implied-eval.js +164 -0
  686. package/packages/less/node_modules/eslint/lib/rules/no-inline-comments.js +68 -0
  687. package/packages/less/node_modules/eslint/lib/rules/no-inner-declarations.js +92 -0
  688. package/packages/less/node_modules/eslint/lib/rules/no-invalid-regexp.js +126 -0
  689. package/packages/less/node_modules/eslint/lib/rules/no-invalid-this.js +126 -0
  690. package/packages/less/node_modules/eslint/lib/rules/no-irregular-whitespace.js +239 -0
  691. package/packages/less/node_modules/eslint/lib/rules/no-iterator.js +41 -0
  692. package/packages/less/node_modules/eslint/lib/rules/no-label-var.js +72 -0
  693. package/packages/less/node_modules/eslint/lib/rules/no-labels.js +146 -0
  694. package/packages/less/node_modules/eslint/lib/rules/no-lone-blocks.js +115 -0
  695. package/packages/less/node_modules/eslint/lib/rules/no-lonely-if.js +85 -0
  696. package/packages/less/node_modules/eslint/lib/rules/no-loop-func.js +202 -0
  697. package/packages/less/node_modules/eslint/lib/rules/no-magic-numbers.js +167 -0
  698. package/packages/less/node_modules/eslint/lib/rules/no-misleading-character-class.js +193 -0
  699. package/packages/less/node_modules/eslint/lib/rules/no-mixed-operators.js +214 -0
  700. package/packages/less/node_modules/eslint/lib/rules/no-mixed-requires.js +223 -0
  701. package/packages/less/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +146 -0
  702. package/packages/less/node_modules/eslint/lib/rules/no-multi-assign.js +45 -0
  703. package/packages/less/node_modules/eslint/lib/rules/no-multi-spaces.js +134 -0
  704. package/packages/less/node_modules/eslint/lib/rules/no-multi-str.js +58 -0
  705. package/packages/less/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +139 -0
  706. package/packages/less/node_modules/eslint/lib/rules/no-native-reassign.js +93 -0
  707. package/packages/less/node_modules/eslint/lib/rules/no-negated-condition.js +85 -0
  708. package/packages/less/node_modules/eslint/lib/rules/no-negated-in-lhs.js +42 -0
  709. package/packages/less/node_modules/eslint/lib/rules/no-nested-ternary.js +37 -0
  710. package/packages/less/node_modules/eslint/lib/rules/no-new-func.js +48 -0
  711. package/packages/less/node_modules/eslint/lib/rules/no-new-object.js +38 -0
  712. package/packages/less/node_modules/eslint/lib/rules/no-new-require.js +38 -0
  713. package/packages/less/node_modules/eslint/lib/rules/no-new-symbol.js +46 -0
  714. package/packages/less/node_modules/eslint/lib/rules/no-new-wrappers.js +40 -0
  715. package/packages/less/node_modules/eslint/lib/rules/no-new.js +36 -0
  716. package/packages/less/node_modules/eslint/lib/rules/no-obj-calls.js +42 -0
  717. package/packages/less/node_modules/eslint/lib/rules/no-octal-escape.js +50 -0
  718. package/packages/less/node_modules/eslint/lib/rules/no-octal.js +38 -0
  719. package/packages/less/node_modules/eslint/lib/rules/no-param-reassign.js +184 -0
  720. package/packages/less/node_modules/eslint/lib/rules/no-path-concat.js +52 -0
  721. package/packages/less/node_modules/eslint/lib/rules/no-plusplus.js +65 -0
  722. package/packages/less/node_modules/eslint/lib/rules/no-process-env.js +42 -0
  723. package/packages/less/node_modules/eslint/lib/rules/no-process-exit.js +38 -0
  724. package/packages/less/node_modules/eslint/lib/rules/no-proto.js +41 -0
  725. package/packages/less/node_modules/eslint/lib/rules/no-prototype-builtins.js +57 -0
  726. package/packages/less/node_modules/eslint/lib/rules/no-redeclare.js +104 -0
  727. package/packages/less/node_modules/eslint/lib/rules/no-regex-spaces.js +116 -0
  728. package/packages/less/node_modules/eslint/lib/rules/no-restricted-globals.js +123 -0
  729. package/packages/less/node_modules/eslint/lib/rules/no-restricted-imports.js +282 -0
  730. package/packages/less/node_modules/eslint/lib/rules/no-restricted-modules.js +180 -0
  731. package/packages/less/node_modules/eslint/lib/rules/no-restricted-properties.js +176 -0
  732. package/packages/less/node_modules/eslint/lib/rules/no-restricted-syntax.js +65 -0
  733. package/packages/less/node_modules/eslint/lib/rules/no-return-assign.js +75 -0
  734. package/packages/less/node_modules/eslint/lib/rules/no-return-await.js +101 -0
  735. package/packages/less/node_modules/eslint/lib/rules/no-script-url.js +44 -0
  736. package/packages/less/node_modules/eslint/lib/rules/no-self-assign.js +219 -0
  737. package/packages/less/node_modules/eslint/lib/rules/no-self-compare.js +56 -0
  738. package/packages/less/node_modules/eslint/lib/rules/no-sequences.js +115 -0
  739. package/packages/less/node_modules/eslint/lib/rules/no-shadow-restricted-names.js +60 -0
  740. package/packages/less/node_modules/eslint/lib/rules/no-shadow.js +191 -0
  741. package/packages/less/node_modules/eslint/lib/rules/no-spaced-func.js +79 -0
  742. package/packages/less/node_modules/eslint/lib/rules/no-sparse-arrays.js +46 -0
  743. package/packages/less/node_modules/eslint/lib/rules/no-sync.js +57 -0
  744. package/packages/less/node_modules/eslint/lib/rules/no-tabs.js +68 -0
  745. package/packages/less/node_modules/eslint/lib/rules/no-template-curly-in-string.js +40 -0
  746. package/packages/less/node_modules/eslint/lib/rules/no-ternary.js +37 -0
  747. package/packages/less/node_modules/eslint/lib/rules/no-this-before-super.js +301 -0
  748. package/packages/less/node_modules/eslint/lib/rules/no-throw-literal.js +46 -0
  749. package/packages/less/node_modules/eslint/lib/rules/no-trailing-spaces.js +174 -0
  750. package/packages/less/node_modules/eslint/lib/rules/no-undef-init.js +65 -0
  751. package/packages/less/node_modules/eslint/lib/rules/no-undef.js +78 -0
  752. package/packages/less/node_modules/eslint/lib/rules/no-undefined.js +80 -0
  753. package/packages/less/node_modules/eslint/lib/rules/no-underscore-dangle.js +209 -0
  754. package/packages/less/node_modules/eslint/lib/rules/no-unexpected-multiline.js +102 -0
  755. package/packages/less/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js +369 -0
  756. package/packages/less/node_modules/eslint/lib/rules/no-unneeded-ternary.js +159 -0
  757. package/packages/less/node_modules/eslint/lib/rules/no-unreachable.js +214 -0
  758. package/packages/less/node_modules/eslint/lib/rules/no-unsafe-finally.js +110 -0
  759. package/packages/less/node_modules/eslint/lib/rules/no-unsafe-negation.js +87 -0
  760. package/packages/less/node_modules/eslint/lib/rules/no-unused-expressions.js +132 -0
  761. package/packages/less/node_modules/eslint/lib/rules/no-unused-labels.js +113 -0
  762. package/packages/less/node_modules/eslint/lib/rules/no-unused-vars.js +656 -0
  763. package/packages/less/node_modules/eslint/lib/rules/no-use-before-define.js +234 -0
  764. package/packages/less/node_modules/eslint/lib/rules/no-useless-call.js +83 -0
  765. package/packages/less/node_modules/eslint/lib/rules/no-useless-catch.js +52 -0
  766. package/packages/less/node_modules/eslint/lib/rules/no-useless-computed-key.js +77 -0
  767. package/packages/less/node_modules/eslint/lib/rules/no-useless-concat.js +111 -0
  768. package/packages/less/node_modules/eslint/lib/rules/no-useless-constructor.js +185 -0
  769. package/packages/less/node_modules/eslint/lib/rules/no-useless-escape.js +226 -0
  770. package/packages/less/node_modules/eslint/lib/rules/no-useless-rename.js +152 -0
  771. package/packages/less/node_modules/eslint/lib/rules/no-useless-return.js +300 -0
  772. package/packages/less/node_modules/eslint/lib/rules/no-var.js +331 -0
  773. package/packages/less/node_modules/eslint/lib/rules/no-void.js +40 -0
  774. package/packages/less/node_modules/eslint/lib/rules/no-warning-comments.js +159 -0
  775. package/packages/less/node_modules/eslint/lib/rules/no-whitespace-before-property.js +97 -0
  776. package/packages/less/node_modules/eslint/lib/rules/no-with.js +35 -0
  777. package/packages/less/node_modules/eslint/lib/rules/nonblock-statement-body-position.js +119 -0
  778. package/packages/less/node_modules/eslint/lib/rules/object-curly-newline.js +302 -0
  779. package/packages/less/node_modules/eslint/lib/rules/object-curly-spacing.js +302 -0
  780. package/packages/less/node_modules/eslint/lib/rules/object-property-newline.js +94 -0
  781. package/packages/less/node_modules/eslint/lib/rules/object-shorthand.js +463 -0
  782. package/packages/less/node_modules/eslint/lib/rules/one-var-declaration-per-line.js +89 -0
  783. package/packages/less/node_modules/eslint/lib/rules/one-var.js +526 -0
  784. package/packages/less/node_modules/eslint/lib/rules/operator-assignment.js +213 -0
  785. package/packages/less/node_modules/eslint/lib/rules/operator-linebreak.js +255 -0
  786. package/packages/less/node_modules/eslint/lib/rules/padded-blocks.js +282 -0
  787. package/packages/less/node_modules/eslint/lib/rules/padding-line-between-statements.js +643 -0
  788. package/packages/less/node_modules/eslint/lib/rules/prefer-arrow-callback.js +310 -0
  789. package/packages/less/node_modules/eslint/lib/rules/prefer-const.js +471 -0
  790. package/packages/less/node_modules/eslint/lib/rules/prefer-destructuring.js +274 -0
  791. package/packages/less/node_modules/eslint/lib/rules/prefer-named-capture-group.js +123 -0
  792. package/packages/less/node_modules/eslint/lib/rules/prefer-numeric-literals.js +114 -0
  793. package/packages/less/node_modules/eslint/lib/rules/prefer-object-spread.js +265 -0
  794. package/packages/less/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js +129 -0
  795. package/packages/less/node_modules/eslint/lib/rules/prefer-reflect.js +123 -0
  796. package/packages/less/node_modules/eslint/lib/rules/prefer-rest-params.js +114 -0
  797. package/packages/less/node_modules/eslint/lib/rules/prefer-spread.js +87 -0
  798. package/packages/less/node_modules/eslint/lib/rules/prefer-template.js +289 -0
  799. package/packages/less/node_modules/eslint/lib/rules/quote-props.js +301 -0
  800. package/packages/less/node_modules/eslint/lib/rules/quotes.js +323 -0
  801. package/packages/less/node_modules/eslint/lib/rules/radix.js +174 -0
  802. package/packages/less/node_modules/eslint/lib/rules/require-atomic-updates.js +300 -0
  803. package/packages/less/node_modules/eslint/lib/rules/require-await.js +104 -0
  804. package/packages/less/node_modules/eslint/lib/rules/require-jsdoc.js +117 -0
  805. package/packages/less/node_modules/eslint/lib/rules/require-unicode-regexp.js +69 -0
  806. package/packages/less/node_modules/eslint/lib/rules/require-yield.js +74 -0
  807. package/packages/less/node_modules/eslint/lib/rules/rest-spread-spacing.js +118 -0
  808. package/packages/less/node_modules/eslint/lib/rules/semi-spacing.js +212 -0
  809. package/packages/less/node_modules/eslint/lib/rules/semi-style.js +147 -0
  810. package/packages/less/node_modules/eslint/lib/rules/semi.js +328 -0
  811. package/packages/less/node_modules/eslint/lib/rules/sort-imports.js +208 -0
  812. package/packages/less/node_modules/eslint/lib/rules/sort-keys.js +169 -0
  813. package/packages/less/node_modules/eslint/lib/rules/sort-vars.js +100 -0
  814. package/packages/less/node_modules/eslint/lib/rules/space-before-blocks.js +160 -0
  815. package/packages/less/node_modules/eslint/lib/rules/space-before-function-paren.js +145 -0
  816. package/packages/less/node_modules/eslint/lib/rules/space-in-parens.js +276 -0
  817. package/packages/less/node_modules/eslint/lib/rules/space-infix-ops.js +165 -0
  818. package/packages/less/node_modules/eslint/lib/rules/space-unary-ops.js +321 -0
  819. package/packages/less/node_modules/eslint/lib/rules/spaced-comment.js +375 -0
  820. package/packages/less/node_modules/eslint/lib/rules/strict.js +279 -0
  821. package/packages/less/node_modules/eslint/lib/rules/switch-colon-spacing.js +141 -0
  822. package/packages/less/node_modules/eslint/lib/rules/symbol-description.js +72 -0
  823. package/packages/less/node_modules/eslint/lib/rules/template-curly-spacing.js +124 -0
  824. package/packages/less/node_modules/eslint/lib/rules/template-tag-spacing.js +84 -0
  825. package/packages/less/node_modules/eslint/lib/rules/unicode-bom.js +73 -0
  826. package/packages/less/node_modules/eslint/lib/rules/use-isnan.js +40 -0
  827. package/packages/less/node_modules/eslint/lib/rules/valid-jsdoc.js +515 -0
  828. package/packages/less/node_modules/eslint/lib/rules/valid-typeof.js +85 -0
  829. package/packages/less/node_modules/eslint/lib/rules/vars-on-top.js +144 -0
  830. package/packages/less/node_modules/eslint/lib/rules/wrap-iife.js +160 -0
  831. package/packages/less/node_modules/eslint/lib/rules/wrap-regex.js +59 -0
  832. package/packages/less/node_modules/eslint/lib/rules/yield-star-spacing.js +127 -0
  833. package/packages/less/node_modules/eslint/lib/rules/yoda.js +318 -0
  834. package/packages/less/node_modules/eslint/lib/rules.js +110 -0
  835. package/packages/less/node_modules/eslint/lib/testers/rule-tester.js +602 -0
  836. package/packages/less/node_modules/eslint/lib/token-store/backward-token-comment-cursor.js +57 -0
  837. package/packages/less/node_modules/eslint/lib/token-store/backward-token-cursor.js +58 -0
  838. package/packages/less/node_modules/eslint/lib/token-store/cursor.js +76 -0
  839. package/packages/less/node_modules/eslint/lib/token-store/cursors.js +92 -0
  840. package/packages/less/node_modules/eslint/lib/token-store/decorative-cursor.js +39 -0
  841. package/packages/less/node_modules/eslint/lib/token-store/filter-cursor.js +43 -0
  842. package/packages/less/node_modules/eslint/lib/token-store/forward-token-comment-cursor.js +57 -0
  843. package/packages/less/node_modules/eslint/lib/token-store/forward-token-cursor.js +63 -0
  844. package/packages/less/node_modules/eslint/lib/token-store/index.js +633 -0
  845. package/packages/less/node_modules/eslint/lib/token-store/limit-cursor.js +40 -0
  846. package/packages/less/node_modules/eslint/lib/token-store/padded-token-cursor.js +38 -0
  847. package/packages/less/node_modules/eslint/lib/token-store/skip-cursor.js +42 -0
  848. package/packages/less/node_modules/eslint/lib/token-store/utils.js +104 -0
  849. package/packages/less/node_modules/eslint/lib/util/ajv.js +31 -0
  850. package/packages/less/node_modules/eslint/lib/util/apply-disable-directives.js +159 -0
  851. package/packages/less/node_modules/eslint/lib/util/ast-utils.js +1346 -0
  852. package/packages/less/node_modules/eslint/lib/util/config-comment-parser.js +141 -0
  853. package/packages/less/node_modules/eslint/lib/util/file-finder.js +144 -0
  854. package/packages/less/node_modules/eslint/lib/util/fix-tracker.js +120 -0
  855. package/packages/less/node_modules/eslint/lib/util/glob-utils.js +285 -0
  856. package/packages/less/node_modules/eslint/lib/util/glob.js +63 -0
  857. package/packages/less/node_modules/eslint/lib/util/hash.js +35 -0
  858. package/packages/less/node_modules/eslint/lib/util/ignored-paths.js +381 -0
  859. package/packages/less/node_modules/eslint/lib/util/interpolate.js +28 -0
  860. package/packages/less/node_modules/eslint/lib/util/keywords.js +67 -0
  861. package/packages/less/node_modules/eslint/lib/util/lint-result-cache.js +146 -0
  862. package/packages/less/node_modules/eslint/lib/util/logging.js +28 -0
  863. package/packages/less/node_modules/eslint/lib/util/module-resolver.js +83 -0
  864. package/packages/less/node_modules/eslint/lib/util/naming.js +107 -0
  865. package/packages/less/node_modules/eslint/lib/util/node-event-generator.js +308 -0
  866. package/packages/less/node_modules/eslint/lib/util/npm-utils.js +183 -0
  867. package/packages/less/node_modules/eslint/lib/util/path-utils.js +72 -0
  868. package/packages/less/node_modules/eslint/lib/util/patterns/letters.js +36 -0
  869. package/packages/less/node_modules/eslint/lib/util/report-translator.js +281 -0
  870. package/packages/less/node_modules/eslint/lib/util/rule-fixer.js +140 -0
  871. package/packages/less/node_modules/eslint/lib/util/safe-emitter.js +52 -0
  872. package/packages/less/node_modules/eslint/lib/util/source-code-fixer.js +152 -0
  873. package/packages/less/node_modules/eslint/lib/util/source-code-utils.js +105 -0
  874. package/packages/less/node_modules/eslint/lib/util/source-code.js +507 -0
  875. package/packages/less/node_modules/eslint/lib/util/timing.js +139 -0
  876. package/packages/less/node_modules/eslint/lib/util/traverser.js +193 -0
  877. package/packages/less/node_modules/eslint/lib/util/unicode/index.js +11 -0
  878. package/packages/less/node_modules/eslint/lib/util/unicode/is-combining-character.js +13 -0
  879. package/packages/less/node_modules/eslint/lib/util/unicode/is-emoji-modifier.js +13 -0
  880. package/packages/less/node_modules/eslint/lib/util/unicode/is-regional-indicator-symbol.js +13 -0
  881. package/packages/less/node_modules/eslint/lib/util/unicode/is-surrogate-pair.js +14 -0
  882. package/packages/less/node_modules/eslint/lib/util/xml-escape.js +34 -0
  883. package/packages/less/node_modules/eslint/messages/all-files-ignored.txt +8 -0
  884. package/packages/less/node_modules/eslint/messages/extend-config-missing.txt +3 -0
  885. package/packages/less/node_modules/eslint/messages/failed-to-read-json.txt +3 -0
  886. package/packages/less/node_modules/eslint/messages/file-not-found.txt +2 -0
  887. package/packages/less/node_modules/eslint/messages/no-config-found.txt +7 -0
  888. package/packages/less/node_modules/eslint/messages/plugin-missing.txt +11 -0
  889. package/packages/less/node_modules/eslint/messages/whitespace-found.txt +3 -0
  890. package/packages/less/node_modules/eslint/package.json +128 -0
  891. package/packages/less/node_modules/espree/CHANGELOG.md +446 -0
  892. package/packages/less/node_modules/espree/LICENSE +22 -0
  893. package/packages/less/node_modules/espree/README.md +164 -0
  894. package/packages/less/node_modules/espree/espree.js +172 -0
  895. package/packages/less/node_modules/espree/lib/ast-node-types.js +96 -0
  896. package/packages/less/node_modules/espree/lib/espree.js +309 -0
  897. package/packages/less/node_modules/espree/lib/features.js +29 -0
  898. package/packages/less/node_modules/espree/lib/token-translator.js +262 -0
  899. package/packages/less/node_modules/espree/lib/visitor-keys.js +123 -0
  900. package/packages/less/node_modules/espree/package.json +62 -0
  901. package/packages/less/node_modules/source-map/CHANGELOG.md +301 -0
  902. package/packages/less/node_modules/source-map/LICENSE +28 -0
  903. package/packages/less/node_modules/source-map/README.md +742 -0
  904. package/packages/less/node_modules/source-map/dist/source-map.debug.js +3234 -0
  905. package/packages/less/node_modules/source-map/dist/source-map.js +3233 -0
  906. package/packages/less/node_modules/source-map/dist/source-map.min.js +2 -0
  907. package/packages/less/node_modules/source-map/dist/source-map.min.js.map +1 -0
  908. package/packages/less/node_modules/source-map/lib/array-set.js +121 -0
  909. package/packages/less/node_modules/source-map/lib/base64-vlq.js +140 -0
  910. package/packages/less/node_modules/source-map/lib/base64.js +67 -0
  911. package/packages/less/node_modules/source-map/lib/binary-search.js +111 -0
  912. package/packages/less/node_modules/source-map/lib/mapping-list.js +79 -0
  913. package/packages/less/node_modules/source-map/lib/quick-sort.js +114 -0
  914. package/packages/less/node_modules/source-map/lib/source-map-consumer.js +1145 -0
  915. package/packages/less/node_modules/source-map/lib/source-map-generator.js +425 -0
  916. package/packages/less/node_modules/source-map/lib/source-node.js +413 -0
  917. package/packages/less/node_modules/source-map/lib/util.js +488 -0
  918. package/packages/less/node_modules/source-map/package.json +73 -0
  919. package/packages/less/node_modules/source-map/source-map.d.ts +98 -0
  920. package/packages/less/node_modules/source-map/source-map.js +8 -0
  921. package/packages/less/node_modules/strip-ansi/index.js +4 -0
  922. package/packages/less/node_modules/strip-ansi/license +9 -0
  923. package/packages/less/node_modules/strip-ansi/package.json +52 -0
  924. package/packages/less/node_modules/strip-ansi/readme.md +39 -0
  925. package/packages/less/tmp/less.cjs.js +10536 -0
  926. package/test/browser/common.js +11 -49
  927. package/test/browser/generator/benchmark.config.js +50 -0
  928. package/test/browser/generator/generate.js +78 -0
  929. package/test/browser/generator/runner.config.js +180 -0
  930. package/test/browser/generator/runner.js +2 -0
  931. package/test/browser/generator/template.js +83 -0
  932. package/test/browser/less.min.js +3 -3
  933. package/test/browser/less.min.js.map +1 -1
  934. package/test/browser/runner-browser-options.js +0 -6
  935. package/test/browser/runner-browser-spec.js +1 -1
  936. package/test/browser/runner-main-spec.js +1 -1
  937. package/test/browser/runner-modify-vars-spec.js +1 -1
  938. package/test/browser/runner-production-spec.js +1 -1
  939. package/test/css/comments.css +1 -1
  940. package/test/css/css-3.css +5 -5
  941. package/test/css/css-escapes.css +1 -0
  942. package/test/css/css-guards.css +1 -1
  943. package/test/css/debug/linenumbers-all.css +5 -5
  944. package/test/css/debug/linenumbers-comments.css +5 -5
  945. package/test/css/debug/linenumbers-mediaquery.css +5 -5
  946. package/test/css/extend-chaining.css +3 -3
  947. package/test/css/extend-media.css +1 -1
  948. package/test/css/extend-nest.css +1 -1
  949. package/test/css/filemanagerPlugin/filemanager.css +1 -1
  950. package/test/css/functions-each.css +1 -1
  951. package/test/css/import-once.css +2 -2
  952. package/test/css/import-reference-issues.css +1 -1
  953. package/test/css/import-reference.css +6 -6
  954. package/test/css/import.css +1 -1
  955. package/test/css/javascript.css +1 -1
  956. package/test/css/legacy/legacy.css +1 -1
  957. package/test/css/math/parens-division/mixins-args.css +1 -1
  958. package/test/css/math/parens-division/parens.css +1 -1
  959. package/test/css/math/strict/mixins-args.css +1 -1
  960. package/test/css/math/strict/parens.css +1 -1
  961. package/test/css/math/strict-legacy/mixins-args.css +1 -1
  962. package/test/css/math/strict-legacy/parens.css +1 -1
  963. package/test/css/media.css +14 -14
  964. package/test/css/merge.css +10 -10
  965. package/test/css/mixins-guards.css +6 -6
  966. package/test/css/mixins.css +2 -2
  967. package/test/css/namespacing/namespacing-3.css +16 -1
  968. package/test/css/namespacing/namespacing-4.css +1 -1
  969. package/test/css/namespacing/namespacing-functions.css +6 -0
  970. package/test/css/no-strict-math/mixins-guards.css +1 -1
  971. package/test/css/permissive-parse.css +1 -1
  972. package/test/css/plugin.css +9 -9
  973. package/test/css/postProcessorPlugin/postProcessor.css +2 -2
  974. package/test/css/preProcessorPlugin/preProcessor.css +1 -1
  975. package/test/css/selectors.css +2 -2
  976. package/test/css/variables.css +1 -1
  977. package/test/css/visitorPlugin/visitor.css +1 -1
  978. package/test/less/comments.less +1 -1
  979. package/test/less/css-3.less +5 -5
  980. package/test/less/css-escapes.less +3 -1
  981. package/test/less/css-guards.less +2 -2
  982. package/test/less/debug/import/test.less +2 -2
  983. package/test/less/debug/linenumbers.less +3 -3
  984. package/test/less/errors/color-func-invalid-color.less +1 -1
  985. package/test/less/errors/color-func-invalid-color.txt +1 -1
  986. package/test/less/errors/plugin-1.txt +2 -2
  987. package/test/less/errors/plugin-2.txt +1 -2
  988. package/test/less/errors/plugin-3.txt +1 -2
  989. package/test/less/errors/property-ie5-hack.less +1 -1
  990. package/test/less/extend-chaining.less +3 -3
  991. package/test/less/extend-media.less +1 -1
  992. package/test/less/extend-nest.less +1 -1
  993. package/test/less/filemanagerPlugin/filemanager.less +1 -1
  994. package/test/less/functions-each.less +1 -1
  995. package/test/less/import/import-reference.less +1 -1
  996. package/test/less/import/import-test-f.less +1 -1
  997. package/test/less/import-reference-issues/global-scope-import.less +2 -2
  998. package/test/less/import-reference-issues/global-scope-nested.less +1 -1
  999. package/test/less/import-reference-issues.less +2 -2
  1000. package/test/less/import-reference.less +1 -1
  1001. package/test/less/javascript.less +1 -1
  1002. package/test/less/legacy/legacy.less +1 -1
  1003. package/test/less/math/parens-division/mixins-args.less +4 -4
  1004. package/test/less/math/parens-division/parens.less +1 -1
  1005. package/test/less/math/strict/mixins-args.less +4 -4
  1006. package/test/less/math/strict/parens.less +1 -1
  1007. package/test/less/math/strict-legacy/mixins-args.less +4 -4
  1008. package/test/less/math/strict-legacy/parens.less +1 -1
  1009. package/test/less/media.less +9 -9
  1010. package/test/less/merge.less +10 -10
  1011. package/test/less/mixins-guards.less +8 -8
  1012. package/test/less/mixins-important.less +3 -3
  1013. package/test/less/mixins.less +2 -2
  1014. package/test/less/namespacing/namespacing-3.less +25 -2
  1015. package/test/less/namespacing/namespacing-4.less +1 -1
  1016. package/test/less/namespacing/namespacing-5.less +2 -2
  1017. package/test/less/namespacing/namespacing-functions.less +26 -0
  1018. package/test/less/no-strict-math/mixins-guards.less +2 -2
  1019. package/test/less/permissive-parse.less +1 -1
  1020. package/test/less/plugin.less +9 -9
  1021. package/test/less/postProcessorPlugin/postProcessor.less +2 -2
  1022. package/test/less/preProcessorPlugin/preProcessor.less +1 -1
  1023. package/test/less/selectors.less +1 -1
  1024. package/test/less/sourcemaps/imported.css +1 -1
  1025. package/test/less/variables.less +1 -1
  1026. package/test/less/visitorPlugin/visitor.less +1 -1
  1027. package/test/less-test.js +1 -9
  1028. package/test/less.js +11 -0
  1029. package/.DS_Store +0 -0
  1030. package/test/.DS_Store +0 -0
  1031. package/test/browser/onload.js +0 -13
  1032. package/test/browser/test-runner-template.tmpl +0 -105
  1033. package/test/browser/vendor/jasmine-jsreporter.js +0 -391
  1034. package/test/browser/vendor/promise.js +0 -2
  1035. package/test/css/.DS_Store +0 -0
  1036. package/test/css/math/.DS_Store +0 -0
  1037. package/test/less/.DS_Store +0 -0
  1038. package/test/less/math/.DS_Store +0 -0
@@ -0,0 +1,4937 @@
1
+ // Reserved word lists for various dialects of the language
2
+
3
+ var reservedWords = {
4
+ 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
5
+ 5: "class enum extends super const export import",
6
+ 6: "enum",
7
+ strict: "implements interface let package private protected public static yield",
8
+ strictBind: "eval arguments"
9
+ };
10
+
11
+ // And the keywords
12
+
13
+ var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";
14
+
15
+ var keywords = {
16
+ 5: ecma5AndLessKeywords,
17
+ "5module": ecma5AndLessKeywords + " export import",
18
+ 6: ecma5AndLessKeywords + " const class extends export import super"
19
+ };
20
+
21
+ var keywordRelationalOperator = /^in(stanceof)?$/;
22
+
23
+ // ## Character categories
24
+
25
+ // Big ugly regular expressions that match characters in the
26
+ // whitespace, identifier, and identifier-start categories. These
27
+ // are only applied when a character is found to actually have a
28
+ // code point above 128.
29
+ // Generated by `bin/generate-identifier-regex.js`.
30
+ var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
31
+ var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
32
+
33
+ var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
34
+ var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
35
+
36
+ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
37
+
38
+ // These are a run-length and offset encoded representation of the
39
+ // >0xffff code points that are a valid part of identifiers. The
40
+ // offset starts at 0x10000, and each pair of numbers represents an
41
+ // offset to the next range, and then a size of the range. They were
42
+ // generated by bin/generate-identifier-regex.js
43
+
44
+ // eslint-disable-next-line comma-spacing
45
+ var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541];
46
+
47
+ // eslint-disable-next-line comma-spacing
48
+ var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239];
49
+
50
+ // This has a complexity linear to the value of the code. The
51
+ // assumption is that looking up astral identifier characters is
52
+ // rare.
53
+ function isInAstralSet(code, set) {
54
+ var pos = 0x10000;
55
+ for (var i = 0; i < set.length; i += 2) {
56
+ pos += set[i];
57
+ if (pos > code) { return false }
58
+ pos += set[i + 1];
59
+ if (pos >= code) { return true }
60
+ }
61
+ }
62
+
63
+ // Test whether a given character code starts an identifier.
64
+
65
+ function isIdentifierStart(code, astral) {
66
+ if (code < 65) { return code === 36 }
67
+ if (code < 91) { return true }
68
+ if (code < 97) { return code === 95 }
69
+ if (code < 123) { return true }
70
+ if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }
71
+ if (astral === false) { return false }
72
+ return isInAstralSet(code, astralIdentifierStartCodes)
73
+ }
74
+
75
+ // Test whether a given character is part of an identifier.
76
+
77
+ function isIdentifierChar(code, astral) {
78
+ if (code < 48) { return code === 36 }
79
+ if (code < 58) { return true }
80
+ if (code < 65) { return false }
81
+ if (code < 91) { return true }
82
+ if (code < 97) { return code === 95 }
83
+ if (code < 123) { return true }
84
+ if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }
85
+ if (astral === false) { return false }
86
+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)
87
+ }
88
+
89
+ // ## Token types
90
+
91
+ // The assignment of fine-grained, information-carrying type objects
92
+ // allows the tokenizer to store the information it has about a
93
+ // token in a way that is very cheap for the parser to look up.
94
+
95
+ // All token type variables start with an underscore, to make them
96
+ // easy to recognize.
97
+
98
+ // The `beforeExpr` property is used to disambiguate between regular
99
+ // expressions and divisions. It is set on all token types that can
100
+ // be followed by an expression (thus, a slash after them would be a
101
+ // regular expression).
102
+ //
103
+ // The `startsExpr` property is used to check if the token ends a
104
+ // `yield` expression. It is set on all token types that either can
105
+ // directly start an expression (like a quotation mark) or can
106
+ // continue an expression (like the body of a string).
107
+ //
108
+ // `isLoop` marks a keyword as starting a loop, which is important
109
+ // to know when parsing a label, in order to allow or disallow
110
+ // continue jumps to that label.
111
+
112
+ var TokenType = function TokenType(label, conf) {
113
+ if ( conf === void 0 ) conf = {};
114
+
115
+ this.label = label;
116
+ this.keyword = conf.keyword;
117
+ this.beforeExpr = !!conf.beforeExpr;
118
+ this.startsExpr = !!conf.startsExpr;
119
+ this.isLoop = !!conf.isLoop;
120
+ this.isAssign = !!conf.isAssign;
121
+ this.prefix = !!conf.prefix;
122
+ this.postfix = !!conf.postfix;
123
+ this.binop = conf.binop || null;
124
+ this.updateContext = null;
125
+ };
126
+
127
+ function binop(name, prec) {
128
+ return new TokenType(name, {beforeExpr: true, binop: prec})
129
+ }
130
+ var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};
131
+
132
+ // Map keyword names to token types.
133
+
134
+ var keywords$1 = {};
135
+
136
+ // Succinct definitions of keyword token types
137
+ function kw(name, options) {
138
+ if ( options === void 0 ) options = {};
139
+
140
+ options.keyword = name;
141
+ return keywords$1[name] = new TokenType(name, options)
142
+ }
143
+
144
+ var types = {
145
+ num: new TokenType("num", startsExpr),
146
+ regexp: new TokenType("regexp", startsExpr),
147
+ string: new TokenType("string", startsExpr),
148
+ name: new TokenType("name", startsExpr),
149
+ eof: new TokenType("eof"),
150
+
151
+ // Punctuation token types.
152
+ bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}),
153
+ bracketR: new TokenType("]"),
154
+ braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}),
155
+ braceR: new TokenType("}"),
156
+ parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}),
157
+ parenR: new TokenType(")"),
158
+ comma: new TokenType(",", beforeExpr),
159
+ semi: new TokenType(";", beforeExpr),
160
+ colon: new TokenType(":", beforeExpr),
161
+ dot: new TokenType("."),
162
+ question: new TokenType("?", beforeExpr),
163
+ arrow: new TokenType("=>", beforeExpr),
164
+ template: new TokenType("template"),
165
+ invalidTemplate: new TokenType("invalidTemplate"),
166
+ ellipsis: new TokenType("...", beforeExpr),
167
+ backQuote: new TokenType("`", startsExpr),
168
+ dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}),
169
+
170
+ // Operators. These carry several kinds of properties to help the
171
+ // parser use them properly (the presence of these properties is
172
+ // what categorizes them as operators).
173
+ //
174
+ // `binop`, when present, specifies that this operator is a binary
175
+ // operator, and will refer to its precedence.
176
+ //
177
+ // `prefix` and `postfix` mark the operator as a prefix or postfix
178
+ // unary operator.
179
+ //
180
+ // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
181
+ // binary operators with a very low precedence, that should result
182
+ // in AssignmentExpression nodes.
183
+
184
+ eq: new TokenType("=", {beforeExpr: true, isAssign: true}),
185
+ assign: new TokenType("_=", {beforeExpr: true, isAssign: true}),
186
+ incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}),
187
+ prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}),
188
+ logicalOR: binop("||", 1),
189
+ logicalAND: binop("&&", 2),
190
+ bitwiseOR: binop("|", 3),
191
+ bitwiseXOR: binop("^", 4),
192
+ bitwiseAND: binop("&", 5),
193
+ equality: binop("==/!=/===/!==", 6),
194
+ relational: binop("</>/<=/>=", 7),
195
+ bitShift: binop("<</>>/>>>", 8),
196
+ plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),
197
+ modulo: binop("%", 10),
198
+ star: binop("*", 10),
199
+ slash: binop("/", 10),
200
+ starstar: new TokenType("**", {beforeExpr: true}),
201
+
202
+ // Keyword token types.
203
+ _break: kw("break"),
204
+ _case: kw("case", beforeExpr),
205
+ _catch: kw("catch"),
206
+ _continue: kw("continue"),
207
+ _debugger: kw("debugger"),
208
+ _default: kw("default", beforeExpr),
209
+ _do: kw("do", {isLoop: true, beforeExpr: true}),
210
+ _else: kw("else", beforeExpr),
211
+ _finally: kw("finally"),
212
+ _for: kw("for", {isLoop: true}),
213
+ _function: kw("function", startsExpr),
214
+ _if: kw("if"),
215
+ _return: kw("return", beforeExpr),
216
+ _switch: kw("switch"),
217
+ _throw: kw("throw", beforeExpr),
218
+ _try: kw("try"),
219
+ _var: kw("var"),
220
+ _const: kw("const"),
221
+ _while: kw("while", {isLoop: true}),
222
+ _with: kw("with"),
223
+ _new: kw("new", {beforeExpr: true, startsExpr: true}),
224
+ _this: kw("this", startsExpr),
225
+ _super: kw("super", startsExpr),
226
+ _class: kw("class", startsExpr),
227
+ _extends: kw("extends", beforeExpr),
228
+ _export: kw("export"),
229
+ _import: kw("import", startsExpr),
230
+ _null: kw("null", startsExpr),
231
+ _true: kw("true", startsExpr),
232
+ _false: kw("false", startsExpr),
233
+ _in: kw("in", {beforeExpr: true, binop: 7}),
234
+ _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}),
235
+ _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}),
236
+ _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}),
237
+ _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true})
238
+ };
239
+
240
+ // Matches a whole line break (where CRLF is considered a single
241
+ // line break). Used to count lines.
242
+
243
+ var lineBreak = /\r\n?|\n|\u2028|\u2029/;
244
+ var lineBreakG = new RegExp(lineBreak.source, "g");
245
+
246
+ function isNewLine(code, ecma2019String) {
247
+ return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029))
248
+ }
249
+
250
+ var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
251
+
252
+ var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
253
+
254
+ var ref = Object.prototype;
255
+ var hasOwnProperty = ref.hasOwnProperty;
256
+ var toString = ref.toString;
257
+
258
+ // Checks if an object has a property.
259
+
260
+ function has(obj, propName) {
261
+ return hasOwnProperty.call(obj, propName)
262
+ }
263
+
264
+ var isArray = Array.isArray || (function (obj) { return (
265
+ toString.call(obj) === "[object Array]"
266
+ ); });
267
+
268
+ function wordsRegexp(words) {
269
+ return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
270
+ }
271
+
272
+ // These are used when `options.locations` is on, for the
273
+ // `startLoc` and `endLoc` properties.
274
+
275
+ var Position = function Position(line, col) {
276
+ this.line = line;
277
+ this.column = col;
278
+ };
279
+
280
+ Position.prototype.offset = function offset (n) {
281
+ return new Position(this.line, this.column + n)
282
+ };
283
+
284
+ var SourceLocation = function SourceLocation(p, start, end) {
285
+ this.start = start;
286
+ this.end = end;
287
+ if (p.sourceFile !== null) { this.source = p.sourceFile; }
288
+ };
289
+
290
+ // The `getLineInfo` function is mostly useful when the
291
+ // `locations` option is off (for performance reasons) and you
292
+ // want to find the line/column position for a given character
293
+ // offset. `input` should be the code string that the offset refers
294
+ // into.
295
+
296
+ function getLineInfo(input, offset) {
297
+ for (var line = 1, cur = 0;;) {
298
+ lineBreakG.lastIndex = cur;
299
+ var match = lineBreakG.exec(input);
300
+ if (match && match.index < offset) {
301
+ ++line;
302
+ cur = match.index + match[0].length;
303
+ } else {
304
+ return new Position(line, offset - cur)
305
+ }
306
+ }
307
+ }
308
+
309
+ // A second optional argument can be given to further configure
310
+ // the parser process. These options are recognized:
311
+
312
+ var defaultOptions = {
313
+ // `ecmaVersion` indicates the ECMAScript version to parse. Must be
314
+ // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10
315
+ // (2019). This influences support for strict mode, the set of
316
+ // reserved words, and support for new syntax features. The default
317
+ // is 9.
318
+ ecmaVersion: 9,
319
+ // `sourceType` indicates the mode the code should be parsed in.
320
+ // Can be either `"script"` or `"module"`. This influences global
321
+ // strict mode and parsing of `import` and `export` declarations.
322
+ sourceType: "script",
323
+ // `onInsertedSemicolon` can be a callback that will be called
324
+ // when a semicolon is automatically inserted. It will be passed
325
+ // the position of the comma as an offset, and if `locations` is
326
+ // enabled, it is given the location as a `{line, column}` object
327
+ // as second argument.
328
+ onInsertedSemicolon: null,
329
+ // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
330
+ // trailing commas.
331
+ onTrailingComma: null,
332
+ // By default, reserved words are only enforced if ecmaVersion >= 5.
333
+ // Set `allowReserved` to a boolean value to explicitly turn this on
334
+ // an off. When this option has the value "never", reserved words
335
+ // and keywords can also not be used as property names.
336
+ allowReserved: null,
337
+ // When enabled, a return at the top level is not considered an
338
+ // error.
339
+ allowReturnOutsideFunction: false,
340
+ // When enabled, import/export statements are not constrained to
341
+ // appearing at the top of the program.
342
+ allowImportExportEverywhere: false,
343
+ // When enabled, await identifiers are allowed to appear at the top-level scope,
344
+ // but they are still not allowed in non-async functions.
345
+ allowAwaitOutsideFunction: false,
346
+ // When enabled, hashbang directive in the beginning of file
347
+ // is allowed and treated as a line comment.
348
+ allowHashBang: false,
349
+ // When `locations` is on, `loc` properties holding objects with
350
+ // `start` and `end` properties in `{line, column}` form (with
351
+ // line being 1-based and column 0-based) will be attached to the
352
+ // nodes.
353
+ locations: false,
354
+ // A function can be passed as `onToken` option, which will
355
+ // cause Acorn to call that function with object in the same
356
+ // format as tokens returned from `tokenizer().getToken()`. Note
357
+ // that you are not allowed to call the parser from the
358
+ // callback—that will corrupt its internal state.
359
+ onToken: null,
360
+ // A function can be passed as `onComment` option, which will
361
+ // cause Acorn to call that function with `(block, text, start,
362
+ // end)` parameters whenever a comment is skipped. `block` is a
363
+ // boolean indicating whether this is a block (`/* */`) comment,
364
+ // `text` is the content of the comment, and `start` and `end` are
365
+ // character offsets that denote the start and end of the comment.
366
+ // When the `locations` option is on, two more parameters are
367
+ // passed, the full `{line, column}` locations of the start and
368
+ // end of the comments. Note that you are not allowed to call the
369
+ // parser from the callback—that will corrupt its internal state.
370
+ onComment: null,
371
+ // Nodes have their start and end characters offsets recorded in
372
+ // `start` and `end` properties (directly on the node, rather than
373
+ // the `loc` object, which holds line/column data. To also add a
374
+ // [semi-standardized][range] `range` property holding a `[start,
375
+ // end]` array with the same numbers, set the `ranges` option to
376
+ // `true`.
377
+ //
378
+ // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
379
+ ranges: false,
380
+ // It is possible to parse multiple files into a single AST by
381
+ // passing the tree produced by parsing the first file as
382
+ // `program` option in subsequent parses. This will add the
383
+ // toplevel forms of the parsed file to the `Program` (top) node
384
+ // of an existing parse tree.
385
+ program: null,
386
+ // When `locations` is on, you can pass this to record the source
387
+ // file in every node's `loc` object.
388
+ sourceFile: null,
389
+ // This value, if given, is stored in every node, whether
390
+ // `locations` is on or off.
391
+ directSourceFile: null,
392
+ // When enabled, parenthesized expressions are represented by
393
+ // (non-standard) ParenthesizedExpression nodes
394
+ preserveParens: false
395
+ };
396
+
397
+ // Interpret and default an options object
398
+
399
+ function getOptions(opts) {
400
+ var options = {};
401
+
402
+ for (var opt in defaultOptions)
403
+ { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; }
404
+
405
+ if (options.ecmaVersion >= 2015)
406
+ { options.ecmaVersion -= 2009; }
407
+
408
+ if (options.allowReserved == null)
409
+ { options.allowReserved = options.ecmaVersion < 5; }
410
+
411
+ if (isArray(options.onToken)) {
412
+ var tokens = options.onToken;
413
+ options.onToken = function (token) { return tokens.push(token); };
414
+ }
415
+ if (isArray(options.onComment))
416
+ { options.onComment = pushComment(options, options.onComment); }
417
+
418
+ return options
419
+ }
420
+
421
+ function pushComment(options, array) {
422
+ return function(block, text, start, end, startLoc, endLoc) {
423
+ var comment = {
424
+ type: block ? "Block" : "Line",
425
+ value: text,
426
+ start: start,
427
+ end: end
428
+ };
429
+ if (options.locations)
430
+ { comment.loc = new SourceLocation(this, startLoc, endLoc); }
431
+ if (options.ranges)
432
+ { comment.range = [start, end]; }
433
+ array.push(comment);
434
+ }
435
+ }
436
+
437
+ // Each scope gets a bitset that may contain these flags
438
+ var
439
+ SCOPE_TOP = 1,
440
+ SCOPE_FUNCTION = 2,
441
+ SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION,
442
+ SCOPE_ASYNC = 4,
443
+ SCOPE_GENERATOR = 8,
444
+ SCOPE_ARROW = 16,
445
+ SCOPE_SIMPLE_CATCH = 32,
446
+ SCOPE_SUPER = 64,
447
+ SCOPE_DIRECT_SUPER = 128;
448
+
449
+ function functionFlags(async, generator) {
450
+ return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)
451
+ }
452
+
453
+ // Used in checkLVal and declareName to determine the type of a binding
454
+ var
455
+ BIND_NONE = 0, // Not a binding
456
+ BIND_VAR = 1, // Var-style binding
457
+ BIND_LEXICAL = 2, // Let- or const-style binding
458
+ BIND_FUNCTION = 3, // Function declaration
459
+ BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding
460
+ BIND_OUTSIDE = 5; // Special case for function names as bound inside the function
461
+
462
+ var Parser = function Parser(options, input, startPos) {
463
+ this.options = options = getOptions(options);
464
+ this.sourceFile = options.sourceFile;
465
+ this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
466
+ var reserved = "";
467
+ if (options.allowReserved !== true) {
468
+ for (var v = options.ecmaVersion;; v--)
469
+ { if (reserved = reservedWords[v]) { break } }
470
+ if (options.sourceType === "module") { reserved += " await"; }
471
+ }
472
+ this.reservedWords = wordsRegexp(reserved);
473
+ var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict;
474
+ this.reservedWordsStrict = wordsRegexp(reservedStrict);
475
+ this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
476
+ this.input = String(input);
477
+
478
+ // Used to signal to callers of `readWord1` whether the word
479
+ // contained any escape sequences. This is needed because words with
480
+ // escape sequences must not be interpreted as keywords.
481
+ this.containsEsc = false;
482
+
483
+ // Set up token state
484
+
485
+ // The current position of the tokenizer in the input.
486
+ if (startPos) {
487
+ this.pos = startPos;
488
+ this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
489
+ this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
490
+ } else {
491
+ this.pos = this.lineStart = 0;
492
+ this.curLine = 1;
493
+ }
494
+
495
+ // Properties of the current token:
496
+ // Its type
497
+ this.type = types.eof;
498
+ // For tokens that include more information than their type, the value
499
+ this.value = null;
500
+ // Its start and end offset
501
+ this.start = this.end = this.pos;
502
+ // And, if locations are used, the {line, column} object
503
+ // corresponding to those offsets
504
+ this.startLoc = this.endLoc = this.curPosition();
505
+
506
+ // Position information for the previous token
507
+ this.lastTokEndLoc = this.lastTokStartLoc = null;
508
+ this.lastTokStart = this.lastTokEnd = this.pos;
509
+
510
+ // The context stack is used to superficially track syntactic
511
+ // context to predict whether a regular expression is allowed in a
512
+ // given position.
513
+ this.context = this.initialContext();
514
+ this.exprAllowed = true;
515
+
516
+ // Figure out if it's a module code.
517
+ this.inModule = options.sourceType === "module";
518
+ this.strict = this.inModule || this.strictDirective(this.pos);
519
+
520
+ // Used to signify the start of a potential arrow function
521
+ this.potentialArrowAt = -1;
522
+
523
+ // Positions to delayed-check that yield/await does not exist in default parameters.
524
+ this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
525
+ // Labels in scope.
526
+ this.labels = [];
527
+ // Thus-far undefined exports.
528
+ this.undefinedExports = {};
529
+
530
+ // If enabled, skip leading hashbang line.
531
+ if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!")
532
+ { this.skipLineComment(2); }
533
+
534
+ // Scope tracking for duplicate variable names (see scope.js)
535
+ this.scopeStack = [];
536
+ this.enterScope(SCOPE_TOP);
537
+
538
+ // For RegExp validation
539
+ this.regexpState = null;
540
+ };
541
+
542
+ var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true } };
543
+
544
+ Parser.prototype.parse = function parse () {
545
+ var node = this.options.program || this.startNode();
546
+ this.nextToken();
547
+ return this.parseTopLevel(node)
548
+ };
549
+
550
+ prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
551
+ prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };
552
+ prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };
553
+ prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 };
554
+ prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };
555
+ prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };
556
+
557
+ // Switch to a getter for 7.0.0.
558
+ Parser.prototype.inNonArrowFunction = function inNonArrowFunction () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 };
559
+
560
+ Parser.extend = function extend () {
561
+ var plugins = [], len = arguments.length;
562
+ while ( len-- ) plugins[ len ] = arguments[ len ];
563
+
564
+ var cls = this;
565
+ for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }
566
+ return cls
567
+ };
568
+
569
+ Parser.parse = function parse (input, options) {
570
+ return new this(options, input).parse()
571
+ };
572
+
573
+ Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) {
574
+ var parser = new this(options, input, pos);
575
+ parser.nextToken();
576
+ return parser.parseExpression()
577
+ };
578
+
579
+ Parser.tokenizer = function tokenizer (input, options) {
580
+ return new this(options, input)
581
+ };
582
+
583
+ Object.defineProperties( Parser.prototype, prototypeAccessors );
584
+
585
+ var pp = Parser.prototype;
586
+
587
+ // ## Parser utilities
588
+
589
+ var literal = /^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)")/;
590
+ pp.strictDirective = function(start) {
591
+ for (;;) {
592
+ // Try to find string literal.
593
+ skipWhiteSpace.lastIndex = start;
594
+ start += skipWhiteSpace.exec(this.input)[0].length;
595
+ var match = literal.exec(this.input.slice(start));
596
+ if (!match) { return false }
597
+ if ((match[1] || match[2]) === "use strict") { return true }
598
+ start += match[0].length;
599
+
600
+ // Skip semicolon, if any.
601
+ skipWhiteSpace.lastIndex = start;
602
+ start += skipWhiteSpace.exec(this.input)[0].length;
603
+ if (this.input[start] === ";")
604
+ { start++; }
605
+ }
606
+ };
607
+
608
+ // Predicate that tests whether the next token is of the given
609
+ // type, and if yes, consumes it as a side effect.
610
+
611
+ pp.eat = function(type) {
612
+ if (this.type === type) {
613
+ this.next();
614
+ return true
615
+ } else {
616
+ return false
617
+ }
618
+ };
619
+
620
+ // Tests whether parsed token is a contextual keyword.
621
+
622
+ pp.isContextual = function(name) {
623
+ return this.type === types.name && this.value === name && !this.containsEsc
624
+ };
625
+
626
+ // Consumes contextual keyword if possible.
627
+
628
+ pp.eatContextual = function(name) {
629
+ if (!this.isContextual(name)) { return false }
630
+ this.next();
631
+ return true
632
+ };
633
+
634
+ // Asserts that following token is given contextual keyword.
635
+
636
+ pp.expectContextual = function(name) {
637
+ if (!this.eatContextual(name)) { this.unexpected(); }
638
+ };
639
+
640
+ // Test whether a semicolon can be inserted at the current position.
641
+
642
+ pp.canInsertSemicolon = function() {
643
+ return this.type === types.eof ||
644
+ this.type === types.braceR ||
645
+ lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
646
+ };
647
+
648
+ pp.insertSemicolon = function() {
649
+ if (this.canInsertSemicolon()) {
650
+ if (this.options.onInsertedSemicolon)
651
+ { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }
652
+ return true
653
+ }
654
+ };
655
+
656
+ // Consume a semicolon, or, failing that, see if we are allowed to
657
+ // pretend that there is a semicolon at this position.
658
+
659
+ pp.semicolon = function() {
660
+ if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); }
661
+ };
662
+
663
+ pp.afterTrailingComma = function(tokType, notNext) {
664
+ if (this.type === tokType) {
665
+ if (this.options.onTrailingComma)
666
+ { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }
667
+ if (!notNext)
668
+ { this.next(); }
669
+ return true
670
+ }
671
+ };
672
+
673
+ // Expect a token of a given type. If found, consume it, otherwise,
674
+ // raise an unexpected token error.
675
+
676
+ pp.expect = function(type) {
677
+ this.eat(type) || this.unexpected();
678
+ };
679
+
680
+ // Raise an unexpected token error.
681
+
682
+ pp.unexpected = function(pos) {
683
+ this.raise(pos != null ? pos : this.start, "Unexpected token");
684
+ };
685
+
686
+ function DestructuringErrors() {
687
+ this.shorthandAssign =
688
+ this.trailingComma =
689
+ this.parenthesizedAssign =
690
+ this.parenthesizedBind =
691
+ this.doubleProto =
692
+ -1;
693
+ }
694
+
695
+ pp.checkPatternErrors = function(refDestructuringErrors, isAssign) {
696
+ if (!refDestructuringErrors) { return }
697
+ if (refDestructuringErrors.trailingComma > -1)
698
+ { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); }
699
+ var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
700
+ if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); }
701
+ };
702
+
703
+ pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
704
+ if (!refDestructuringErrors) { return false }
705
+ var shorthandAssign = refDestructuringErrors.shorthandAssign;
706
+ var doubleProto = refDestructuringErrors.doubleProto;
707
+ if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }
708
+ if (shorthandAssign >= 0)
709
+ { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); }
710
+ if (doubleProto >= 0)
711
+ { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); }
712
+ };
713
+
714
+ pp.checkYieldAwaitInDefaultParams = function() {
715
+ if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))
716
+ { this.raise(this.yieldPos, "Yield expression cannot be a default value"); }
717
+ if (this.awaitPos)
718
+ { this.raise(this.awaitPos, "Await expression cannot be a default value"); }
719
+ };
720
+
721
+ pp.isSimpleAssignTarget = function(expr) {
722
+ if (expr.type === "ParenthesizedExpression")
723
+ { return this.isSimpleAssignTarget(expr.expression) }
724
+ return expr.type === "Identifier" || expr.type === "MemberExpression"
725
+ };
726
+
727
+ var pp$1 = Parser.prototype;
728
+
729
+ // ### Statement parsing
730
+
731
+ // Parse a program. Initializes the parser, reads any number of
732
+ // statements, and wraps them in a Program node. Optionally takes a
733
+ // `program` argument. If present, the statements will be appended
734
+ // to its body instead of creating a new node.
735
+
736
+ pp$1.parseTopLevel = function(node) {
737
+ var exports = {};
738
+ if (!node.body) { node.body = []; }
739
+ while (this.type !== types.eof) {
740
+ var stmt = this.parseStatement(null, true, exports);
741
+ node.body.push(stmt);
742
+ }
743
+ if (this.inModule)
744
+ { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)
745
+ {
746
+ var name = list[i];
747
+
748
+ this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined"));
749
+ } }
750
+ this.adaptDirectivePrologue(node.body);
751
+ this.next();
752
+ node.sourceType = this.options.sourceType;
753
+ return this.finishNode(node, "Program")
754
+ };
755
+
756
+ var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"};
757
+
758
+ pp$1.isLet = function(context) {
759
+ if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
760
+ skipWhiteSpace.lastIndex = this.pos;
761
+ var skip = skipWhiteSpace.exec(this.input);
762
+ var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
763
+ // For ambiguous cases, determine if a LexicalDeclaration (or only a
764
+ // Statement) is allowed here. If context is not empty then only a Statement
765
+ // is allowed. However, `let [` is an explicit negative lookahead for
766
+ // ExpressionStatement, so special-case it first.
767
+ if (nextCh === 91) { return true } // '['
768
+ if (context) { return false }
769
+
770
+ if (nextCh === 123) { return true } // '{'
771
+ if (isIdentifierStart(nextCh, true)) {
772
+ var pos = next + 1;
773
+ while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; }
774
+ var ident = this.input.slice(next, pos);
775
+ if (!keywordRelationalOperator.test(ident)) { return true }
776
+ }
777
+ return false
778
+ };
779
+
780
+ // check 'async [no LineTerminator here] function'
781
+ // - 'async /*foo*/ function' is OK.
782
+ // - 'async /*\n*/ function' is invalid.
783
+ pp$1.isAsyncFunction = function() {
784
+ if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
785
+ { return false }
786
+
787
+ skipWhiteSpace.lastIndex = this.pos;
788
+ var skip = skipWhiteSpace.exec(this.input);
789
+ var next = this.pos + skip[0].length;
790
+ return !lineBreak.test(this.input.slice(this.pos, next)) &&
791
+ this.input.slice(next, next + 8) === "function" &&
792
+ (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8)))
793
+ };
794
+
795
+ // Parse a single statement.
796
+ //
797
+ // If expecting a statement and finding a slash operator, parse a
798
+ // regular expression literal. This is to handle cases like
799
+ // `if (foo) /blah/.exec(foo)`, where looking at the previous token
800
+ // does not help.
801
+
802
+ pp$1.parseStatement = function(context, topLevel, exports) {
803
+ var starttype = this.type, node = this.startNode(), kind;
804
+
805
+ if (this.isLet(context)) {
806
+ starttype = types._var;
807
+ kind = "let";
808
+ }
809
+
810
+ // Most types of statements are recognized by the keyword they
811
+ // start with. Many are trivial to parse, some require a bit of
812
+ // complexity.
813
+
814
+ switch (starttype) {
815
+ case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword)
816
+ case types._debugger: return this.parseDebuggerStatement(node)
817
+ case types._do: return this.parseDoStatement(node)
818
+ case types._for: return this.parseForStatement(node)
819
+ case types._function:
820
+ // Function as sole body of either an if statement or a labeled statement
821
+ // works, but not when it is part of a labeled statement that is the sole
822
+ // body of an if statement.
823
+ if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); }
824
+ return this.parseFunctionStatement(node, false, !context)
825
+ case types._class:
826
+ if (context) { this.unexpected(); }
827
+ return this.parseClass(node, true)
828
+ case types._if: return this.parseIfStatement(node)
829
+ case types._return: return this.parseReturnStatement(node)
830
+ case types._switch: return this.parseSwitchStatement(node)
831
+ case types._throw: return this.parseThrowStatement(node)
832
+ case types._try: return this.parseTryStatement(node)
833
+ case types._const: case types._var:
834
+ kind = kind || this.value;
835
+ if (context && kind !== "var") { this.unexpected(); }
836
+ return this.parseVarStatement(node, kind)
837
+ case types._while: return this.parseWhileStatement(node)
838
+ case types._with: return this.parseWithStatement(node)
839
+ case types.braceL: return this.parseBlock(true, node)
840
+ case types.semi: return this.parseEmptyStatement(node)
841
+ case types._export:
842
+ case types._import:
843
+ if (this.options.ecmaVersion > 10 && starttype === types._import) {
844
+ skipWhiteSpace.lastIndex = this.pos;
845
+ var skip = skipWhiteSpace.exec(this.input);
846
+ var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
847
+ if (nextCh === 40) // '('
848
+ { return this.parseExpressionStatement(node, this.parseExpression()) }
849
+ }
850
+
851
+ if (!this.options.allowImportExportEverywhere) {
852
+ if (!topLevel)
853
+ { this.raise(this.start, "'import' and 'export' may only appear at the top level"); }
854
+ if (!this.inModule)
855
+ { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
856
+ }
857
+ return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports)
858
+
859
+ // If the statement does not start with a statement keyword or a
860
+ // brace, it's an ExpressionStatement or LabeledStatement. We
861
+ // simply start parsing an expression, and afterwards, if the
862
+ // next token is a colon and the expression was a simple
863
+ // Identifier node, we switch to interpreting it as a label.
864
+ default:
865
+ if (this.isAsyncFunction()) {
866
+ if (context) { this.unexpected(); }
867
+ this.next();
868
+ return this.parseFunctionStatement(node, true, !context)
869
+ }
870
+
871
+ var maybeName = this.value, expr = this.parseExpression();
872
+ if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon))
873
+ { return this.parseLabeledStatement(node, maybeName, expr, context) }
874
+ else { return this.parseExpressionStatement(node, expr) }
875
+ }
876
+ };
877
+
878
+ pp$1.parseBreakContinueStatement = function(node, keyword) {
879
+ var isBreak = keyword === "break";
880
+ this.next();
881
+ if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; }
882
+ else if (this.type !== types.name) { this.unexpected(); }
883
+ else {
884
+ node.label = this.parseIdent();
885
+ this.semicolon();
886
+ }
887
+
888
+ // Verify that there is an actual destination to break or
889
+ // continue to.
890
+ var i = 0;
891
+ for (; i < this.labels.length; ++i) {
892
+ var lab = this.labels[i];
893
+ if (node.label == null || lab.name === node.label.name) {
894
+ if (lab.kind != null && (isBreak || lab.kind === "loop")) { break }
895
+ if (node.label && isBreak) { break }
896
+ }
897
+ }
898
+ if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); }
899
+ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
900
+ };
901
+
902
+ pp$1.parseDebuggerStatement = function(node) {
903
+ this.next();
904
+ this.semicolon();
905
+ return this.finishNode(node, "DebuggerStatement")
906
+ };
907
+
908
+ pp$1.parseDoStatement = function(node) {
909
+ this.next();
910
+ this.labels.push(loopLabel);
911
+ node.body = this.parseStatement("do");
912
+ this.labels.pop();
913
+ this.expect(types._while);
914
+ node.test = this.parseParenExpression();
915
+ if (this.options.ecmaVersion >= 6)
916
+ { this.eat(types.semi); }
917
+ else
918
+ { this.semicolon(); }
919
+ return this.finishNode(node, "DoWhileStatement")
920
+ };
921
+
922
+ // Disambiguating between a `for` and a `for`/`in` or `for`/`of`
923
+ // loop is non-trivial. Basically, we have to parse the init `var`
924
+ // statement or expression, disallowing the `in` operator (see
925
+ // the second parameter to `parseExpression`), and then check
926
+ // whether the next token is `in` or `of`. When there is no init
927
+ // part (semicolon immediately after the opening parenthesis), it
928
+ // is a regular `for` loop.
929
+
930
+ pp$1.parseForStatement = function(node) {
931
+ this.next();
932
+ var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1;
933
+ this.labels.push(loopLabel);
934
+ this.enterScope(0);
935
+ this.expect(types.parenL);
936
+ if (this.type === types.semi) {
937
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
938
+ return this.parseFor(node, null)
939
+ }
940
+ var isLet = this.isLet();
941
+ if (this.type === types._var || this.type === types._const || isLet) {
942
+ var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
943
+ this.next();
944
+ this.parseVar(init$1, true, kind);
945
+ this.finishNode(init$1, "VariableDeclaration");
946
+ if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) {
947
+ if (this.options.ecmaVersion >= 9) {
948
+ if (this.type === types._in) {
949
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
950
+ } else { node.await = awaitAt > -1; }
951
+ }
952
+ return this.parseForIn(node, init$1)
953
+ }
954
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
955
+ return this.parseFor(node, init$1)
956
+ }
957
+ var refDestructuringErrors = new DestructuringErrors;
958
+ var init = this.parseExpression(true, refDestructuringErrors);
959
+ if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
960
+ if (this.options.ecmaVersion >= 9) {
961
+ if (this.type === types._in) {
962
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
963
+ } else { node.await = awaitAt > -1; }
964
+ }
965
+ this.toAssignable(init, false, refDestructuringErrors);
966
+ this.checkLVal(init);
967
+ return this.parseForIn(node, init)
968
+ } else {
969
+ this.checkExpressionErrors(refDestructuringErrors, true);
970
+ }
971
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
972
+ return this.parseFor(node, init)
973
+ };
974
+
975
+ pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) {
976
+ this.next();
977
+ return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
978
+ };
979
+
980
+ pp$1.parseIfStatement = function(node) {
981
+ this.next();
982
+ node.test = this.parseParenExpression();
983
+ // allow function declarations in branches, but only in non-strict mode
984
+ node.consequent = this.parseStatement("if");
985
+ node.alternate = this.eat(types._else) ? this.parseStatement("if") : null;
986
+ return this.finishNode(node, "IfStatement")
987
+ };
988
+
989
+ pp$1.parseReturnStatement = function(node) {
990
+ if (!this.inFunction && !this.options.allowReturnOutsideFunction)
991
+ { this.raise(this.start, "'return' outside of function"); }
992
+ this.next();
993
+
994
+ // In `return` (and `break`/`continue`), the keywords with
995
+ // optional arguments, we eagerly look for a semicolon or the
996
+ // possibility to insert one.
997
+
998
+ if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; }
999
+ else { node.argument = this.parseExpression(); this.semicolon(); }
1000
+ return this.finishNode(node, "ReturnStatement")
1001
+ };
1002
+
1003
+ pp$1.parseSwitchStatement = function(node) {
1004
+ this.next();
1005
+ node.discriminant = this.parseParenExpression();
1006
+ node.cases = [];
1007
+ this.expect(types.braceL);
1008
+ this.labels.push(switchLabel);
1009
+ this.enterScope(0);
1010
+
1011
+ // Statements under must be grouped (by label) in SwitchCase
1012
+ // nodes. `cur` is used to keep the node that we are currently
1013
+ // adding statements to.
1014
+
1015
+ var cur;
1016
+ for (var sawDefault = false; this.type !== types.braceR;) {
1017
+ if (this.type === types._case || this.type === types._default) {
1018
+ var isCase = this.type === types._case;
1019
+ if (cur) { this.finishNode(cur, "SwitchCase"); }
1020
+ node.cases.push(cur = this.startNode());
1021
+ cur.consequent = [];
1022
+ this.next();
1023
+ if (isCase) {
1024
+ cur.test = this.parseExpression();
1025
+ } else {
1026
+ if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); }
1027
+ sawDefault = true;
1028
+ cur.test = null;
1029
+ }
1030
+ this.expect(types.colon);
1031
+ } else {
1032
+ if (!cur) { this.unexpected(); }
1033
+ cur.consequent.push(this.parseStatement(null));
1034
+ }
1035
+ }
1036
+ this.exitScope();
1037
+ if (cur) { this.finishNode(cur, "SwitchCase"); }
1038
+ this.next(); // Closing brace
1039
+ this.labels.pop();
1040
+ return this.finishNode(node, "SwitchStatement")
1041
+ };
1042
+
1043
+ pp$1.parseThrowStatement = function(node) {
1044
+ this.next();
1045
+ if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))
1046
+ { this.raise(this.lastTokEnd, "Illegal newline after throw"); }
1047
+ node.argument = this.parseExpression();
1048
+ this.semicolon();
1049
+ return this.finishNode(node, "ThrowStatement")
1050
+ };
1051
+
1052
+ // Reused empty array added for node fields that are always empty.
1053
+
1054
+ var empty = [];
1055
+
1056
+ pp$1.parseTryStatement = function(node) {
1057
+ this.next();
1058
+ node.block = this.parseBlock();
1059
+ node.handler = null;
1060
+ if (this.type === types._catch) {
1061
+ var clause = this.startNode();
1062
+ this.next();
1063
+ if (this.eat(types.parenL)) {
1064
+ clause.param = this.parseBindingAtom();
1065
+ var simple = clause.param.type === "Identifier";
1066
+ this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
1067
+ this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
1068
+ this.expect(types.parenR);
1069
+ } else {
1070
+ if (this.options.ecmaVersion < 10) { this.unexpected(); }
1071
+ clause.param = null;
1072
+ this.enterScope(0);
1073
+ }
1074
+ clause.body = this.parseBlock(false);
1075
+ this.exitScope();
1076
+ node.handler = this.finishNode(clause, "CatchClause");
1077
+ }
1078
+ node.finalizer = this.eat(types._finally) ? this.parseBlock() : null;
1079
+ if (!node.handler && !node.finalizer)
1080
+ { this.raise(node.start, "Missing catch or finally clause"); }
1081
+ return this.finishNode(node, "TryStatement")
1082
+ };
1083
+
1084
+ pp$1.parseVarStatement = function(node, kind) {
1085
+ this.next();
1086
+ this.parseVar(node, false, kind);
1087
+ this.semicolon();
1088
+ return this.finishNode(node, "VariableDeclaration")
1089
+ };
1090
+
1091
+ pp$1.parseWhileStatement = function(node) {
1092
+ this.next();
1093
+ node.test = this.parseParenExpression();
1094
+ this.labels.push(loopLabel);
1095
+ node.body = this.parseStatement("while");
1096
+ this.labels.pop();
1097
+ return this.finishNode(node, "WhileStatement")
1098
+ };
1099
+
1100
+ pp$1.parseWithStatement = function(node) {
1101
+ if (this.strict) { this.raise(this.start, "'with' in strict mode"); }
1102
+ this.next();
1103
+ node.object = this.parseParenExpression();
1104
+ node.body = this.parseStatement("with");
1105
+ return this.finishNode(node, "WithStatement")
1106
+ };
1107
+
1108
+ pp$1.parseEmptyStatement = function(node) {
1109
+ this.next();
1110
+ return this.finishNode(node, "EmptyStatement")
1111
+ };
1112
+
1113
+ pp$1.parseLabeledStatement = function(node, maybeName, expr, context) {
1114
+ for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)
1115
+ {
1116
+ var label = list[i$1];
1117
+
1118
+ if (label.name === maybeName)
1119
+ { this.raise(expr.start, "Label '" + maybeName + "' is already declared");
1120
+ } }
1121
+ var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null;
1122
+ for (var i = this.labels.length - 1; i >= 0; i--) {
1123
+ var label$1 = this.labels[i];
1124
+ if (label$1.statementStart === node.start) {
1125
+ // Update information about previous labels on this node
1126
+ label$1.statementStart = this.start;
1127
+ label$1.kind = kind;
1128
+ } else { break }
1129
+ }
1130
+ this.labels.push({name: maybeName, kind: kind, statementStart: this.start});
1131
+ node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
1132
+ this.labels.pop();
1133
+ node.label = expr;
1134
+ return this.finishNode(node, "LabeledStatement")
1135
+ };
1136
+
1137
+ pp$1.parseExpressionStatement = function(node, expr) {
1138
+ node.expression = expr;
1139
+ this.semicolon();
1140
+ return this.finishNode(node, "ExpressionStatement")
1141
+ };
1142
+
1143
+ // Parse a semicolon-enclosed block of statements, handling `"use
1144
+ // strict"` declarations when `allowStrict` is true (used for
1145
+ // function bodies).
1146
+
1147
+ pp$1.parseBlock = function(createNewLexicalScope, node) {
1148
+ if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
1149
+ if ( node === void 0 ) node = this.startNode();
1150
+
1151
+ node.body = [];
1152
+ this.expect(types.braceL);
1153
+ if (createNewLexicalScope) { this.enterScope(0); }
1154
+ while (!this.eat(types.braceR)) {
1155
+ var stmt = this.parseStatement(null);
1156
+ node.body.push(stmt);
1157
+ }
1158
+ if (createNewLexicalScope) { this.exitScope(); }
1159
+ return this.finishNode(node, "BlockStatement")
1160
+ };
1161
+
1162
+ // Parse a regular `for` loop. The disambiguation code in
1163
+ // `parseStatement` will already have parsed the init statement or
1164
+ // expression.
1165
+
1166
+ pp$1.parseFor = function(node, init) {
1167
+ node.init = init;
1168
+ this.expect(types.semi);
1169
+ node.test = this.type === types.semi ? null : this.parseExpression();
1170
+ this.expect(types.semi);
1171
+ node.update = this.type === types.parenR ? null : this.parseExpression();
1172
+ this.expect(types.parenR);
1173
+ node.body = this.parseStatement("for");
1174
+ this.exitScope();
1175
+ this.labels.pop();
1176
+ return this.finishNode(node, "ForStatement")
1177
+ };
1178
+
1179
+ // Parse a `for`/`in` and `for`/`of` loop, which are almost
1180
+ // same from parser's perspective.
1181
+
1182
+ pp$1.parseForIn = function(node, init) {
1183
+ var isForIn = this.type === types._in;
1184
+ this.next();
1185
+
1186
+ if (
1187
+ init.type === "VariableDeclaration" &&
1188
+ init.declarations[0].init != null &&
1189
+ (
1190
+ !isForIn ||
1191
+ this.options.ecmaVersion < 8 ||
1192
+ this.strict ||
1193
+ init.kind !== "var" ||
1194
+ init.declarations[0].id.type !== "Identifier"
1195
+ )
1196
+ ) {
1197
+ this.raise(
1198
+ init.start,
1199
+ ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer")
1200
+ );
1201
+ } else if (init.type === "AssignmentPattern") {
1202
+ this.raise(init.start, "Invalid left-hand side in for-loop");
1203
+ }
1204
+ node.left = init;
1205
+ node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
1206
+ this.expect(types.parenR);
1207
+ node.body = this.parseStatement("for");
1208
+ this.exitScope();
1209
+ this.labels.pop();
1210
+ return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement")
1211
+ };
1212
+
1213
+ // Parse a list of variable declarations.
1214
+
1215
+ pp$1.parseVar = function(node, isFor, kind) {
1216
+ node.declarations = [];
1217
+ node.kind = kind;
1218
+ for (;;) {
1219
+ var decl = this.startNode();
1220
+ this.parseVarId(decl, kind);
1221
+ if (this.eat(types.eq)) {
1222
+ decl.init = this.parseMaybeAssign(isFor);
1223
+ } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
1224
+ this.unexpected();
1225
+ } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) {
1226
+ this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
1227
+ } else {
1228
+ decl.init = null;
1229
+ }
1230
+ node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
1231
+ if (!this.eat(types.comma)) { break }
1232
+ }
1233
+ return node
1234
+ };
1235
+
1236
+ pp$1.parseVarId = function(decl, kind) {
1237
+ decl.id = this.parseBindingAtom();
1238
+ this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
1239
+ };
1240
+
1241
+ var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;
1242
+
1243
+ // Parse a function declaration or literal (depending on the
1244
+ // `statement & FUNC_STATEMENT`).
1245
+
1246
+ // Remove `allowExpressionBody` for 7.0.0, as it is only called with false
1247
+ pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) {
1248
+ this.initFunction(node);
1249
+ if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
1250
+ if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT))
1251
+ { this.unexpected(); }
1252
+ node.generator = this.eat(types.star);
1253
+ }
1254
+ if (this.options.ecmaVersion >= 8)
1255
+ { node.async = !!isAsync; }
1256
+
1257
+ if (statement & FUNC_STATEMENT) {
1258
+ node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent();
1259
+ if (node.id && !(statement & FUNC_HANGING_STATEMENT))
1260
+ // If it is a regular function declaration in sloppy mode, then it is
1261
+ // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding
1262
+ // mode depends on properties of the current scope (see
1263
+ // treatFunctionsAsVar).
1264
+ { this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }
1265
+ }
1266
+
1267
+ var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
1268
+ this.yieldPos = 0;
1269
+ this.awaitPos = 0;
1270
+ this.awaitIdentPos = 0;
1271
+ this.enterScope(functionFlags(node.async, node.generator));
1272
+
1273
+ if (!(statement & FUNC_STATEMENT))
1274
+ { node.id = this.type === types.name ? this.parseIdent() : null; }
1275
+
1276
+ this.parseFunctionParams(node);
1277
+ this.parseFunctionBody(node, allowExpressionBody, false);
1278
+
1279
+ this.yieldPos = oldYieldPos;
1280
+ this.awaitPos = oldAwaitPos;
1281
+ this.awaitIdentPos = oldAwaitIdentPos;
1282
+ return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression")
1283
+ };
1284
+
1285
+ pp$1.parseFunctionParams = function(node) {
1286
+ this.expect(types.parenL);
1287
+ node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8);
1288
+ this.checkYieldAwaitInDefaultParams();
1289
+ };
1290
+
1291
+ // Parse a class declaration or literal (depending on the
1292
+ // `isStatement` parameter).
1293
+
1294
+ pp$1.parseClass = function(node, isStatement) {
1295
+ this.next();
1296
+
1297
+ // ecma-262 14.6 Class Definitions
1298
+ // A class definition is always strict mode code.
1299
+ var oldStrict = this.strict;
1300
+ this.strict = true;
1301
+
1302
+ this.parseClassId(node, isStatement);
1303
+ this.parseClassSuper(node);
1304
+ var classBody = this.startNode();
1305
+ var hadConstructor = false;
1306
+ classBody.body = [];
1307
+ this.expect(types.braceL);
1308
+ while (!this.eat(types.braceR)) {
1309
+ var element = this.parseClassElement(node.superClass !== null);
1310
+ if (element) {
1311
+ classBody.body.push(element);
1312
+ if (element.type === "MethodDefinition" && element.kind === "constructor") {
1313
+ if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); }
1314
+ hadConstructor = true;
1315
+ }
1316
+ }
1317
+ }
1318
+ node.body = this.finishNode(classBody, "ClassBody");
1319
+ this.strict = oldStrict;
1320
+ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
1321
+ };
1322
+
1323
+ pp$1.parseClassElement = function(constructorAllowsSuper) {
1324
+ var this$1 = this;
1325
+
1326
+ if (this.eat(types.semi)) { return null }
1327
+
1328
+ var method = this.startNode();
1329
+ var tryContextual = function (k, noLineBreak) {
1330
+ if ( noLineBreak === void 0 ) noLineBreak = false;
1331
+
1332
+ var start = this$1.start, startLoc = this$1.startLoc;
1333
+ if (!this$1.eatContextual(k)) { return false }
1334
+ if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true }
1335
+ if (method.key) { this$1.unexpected(); }
1336
+ method.computed = false;
1337
+ method.key = this$1.startNodeAt(start, startLoc);
1338
+ method.key.name = k;
1339
+ this$1.finishNode(method.key, "Identifier");
1340
+ return false
1341
+ };
1342
+
1343
+ method.kind = "method";
1344
+ method.static = tryContextual("static");
1345
+ var isGenerator = this.eat(types.star);
1346
+ var isAsync = false;
1347
+ if (!isGenerator) {
1348
+ if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) {
1349
+ isAsync = true;
1350
+ isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star);
1351
+ } else if (tryContextual("get")) {
1352
+ method.kind = "get";
1353
+ } else if (tryContextual("set")) {
1354
+ method.kind = "set";
1355
+ }
1356
+ }
1357
+ if (!method.key) { this.parsePropertyName(method); }
1358
+ var key = method.key;
1359
+ var allowsDirectSuper = false;
1360
+ if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" ||
1361
+ key.type === "Literal" && key.value === "constructor")) {
1362
+ if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); }
1363
+ if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
1364
+ if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
1365
+ method.kind = "constructor";
1366
+ allowsDirectSuper = constructorAllowsSuper;
1367
+ } else if (method.static && key.type === "Identifier" && key.name === "prototype") {
1368
+ this.raise(key.start, "Classes may not have a static property named prototype");
1369
+ }
1370
+ this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper);
1371
+ if (method.kind === "get" && method.value.params.length !== 0)
1372
+ { this.raiseRecoverable(method.value.start, "getter should have no params"); }
1373
+ if (method.kind === "set" && method.value.params.length !== 1)
1374
+ { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); }
1375
+ if (method.kind === "set" && method.value.params[0].type === "RestElement")
1376
+ { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); }
1377
+ return method
1378
+ };
1379
+
1380
+ pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
1381
+ method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
1382
+ return this.finishNode(method, "MethodDefinition")
1383
+ };
1384
+
1385
+ pp$1.parseClassId = function(node, isStatement) {
1386
+ if (this.type === types.name) {
1387
+ node.id = this.parseIdent();
1388
+ if (isStatement)
1389
+ { this.checkLVal(node.id, BIND_LEXICAL, false); }
1390
+ } else {
1391
+ if (isStatement === true)
1392
+ { this.unexpected(); }
1393
+ node.id = null;
1394
+ }
1395
+ };
1396
+
1397
+ pp$1.parseClassSuper = function(node) {
1398
+ node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
1399
+ };
1400
+
1401
+ // Parses module export declaration.
1402
+
1403
+ pp$1.parseExport = function(node, exports) {
1404
+ this.next();
1405
+ // export * from '...'
1406
+ if (this.eat(types.star)) {
1407
+ this.expectContextual("from");
1408
+ if (this.type !== types.string) { this.unexpected(); }
1409
+ node.source = this.parseExprAtom();
1410
+ this.semicolon();
1411
+ return this.finishNode(node, "ExportAllDeclaration")
1412
+ }
1413
+ if (this.eat(types._default)) { // export default ...
1414
+ this.checkExport(exports, "default", this.lastTokStart);
1415
+ var isAsync;
1416
+ if (this.type === types._function || (isAsync = this.isAsyncFunction())) {
1417
+ var fNode = this.startNode();
1418
+ this.next();
1419
+ if (isAsync) { this.next(); }
1420
+ node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);
1421
+ } else if (this.type === types._class) {
1422
+ var cNode = this.startNode();
1423
+ node.declaration = this.parseClass(cNode, "nullableID");
1424
+ } else {
1425
+ node.declaration = this.parseMaybeAssign();
1426
+ this.semicolon();
1427
+ }
1428
+ return this.finishNode(node, "ExportDefaultDeclaration")
1429
+ }
1430
+ // export var|const|let|function|class ...
1431
+ if (this.shouldParseExportStatement()) {
1432
+ node.declaration = this.parseStatement(null);
1433
+ if (node.declaration.type === "VariableDeclaration")
1434
+ { this.checkVariableExport(exports, node.declaration.declarations); }
1435
+ else
1436
+ { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); }
1437
+ node.specifiers = [];
1438
+ node.source = null;
1439
+ } else { // export { x, y as z } [from '...']
1440
+ node.declaration = null;
1441
+ node.specifiers = this.parseExportSpecifiers(exports);
1442
+ if (this.eatContextual("from")) {
1443
+ if (this.type !== types.string) { this.unexpected(); }
1444
+ node.source = this.parseExprAtom();
1445
+ } else {
1446
+ for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
1447
+ // check for keywords used as local names
1448
+ var spec = list[i];
1449
+
1450
+ this.checkUnreserved(spec.local);
1451
+ // check if export is defined
1452
+ this.checkLocalExport(spec.local);
1453
+ }
1454
+
1455
+ node.source = null;
1456
+ }
1457
+ this.semicolon();
1458
+ }
1459
+ return this.finishNode(node, "ExportNamedDeclaration")
1460
+ };
1461
+
1462
+ pp$1.checkExport = function(exports, name, pos) {
1463
+ if (!exports) { return }
1464
+ if (has(exports, name))
1465
+ { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
1466
+ exports[name] = true;
1467
+ };
1468
+
1469
+ pp$1.checkPatternExport = function(exports, pat) {
1470
+ var type = pat.type;
1471
+ if (type === "Identifier")
1472
+ { this.checkExport(exports, pat.name, pat.start); }
1473
+ else if (type === "ObjectPattern")
1474
+ { for (var i = 0, list = pat.properties; i < list.length; i += 1)
1475
+ {
1476
+ var prop = list[i];
1477
+
1478
+ this.checkPatternExport(exports, prop);
1479
+ } }
1480
+ else if (type === "ArrayPattern")
1481
+ { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
1482
+ var elt = list$1[i$1];
1483
+
1484
+ if (elt) { this.checkPatternExport(exports, elt); }
1485
+ } }
1486
+ else if (type === "Property")
1487
+ { this.checkPatternExport(exports, pat.value); }
1488
+ else if (type === "AssignmentPattern")
1489
+ { this.checkPatternExport(exports, pat.left); }
1490
+ else if (type === "RestElement")
1491
+ { this.checkPatternExport(exports, pat.argument); }
1492
+ else if (type === "ParenthesizedExpression")
1493
+ { this.checkPatternExport(exports, pat.expression); }
1494
+ };
1495
+
1496
+ pp$1.checkVariableExport = function(exports, decls) {
1497
+ if (!exports) { return }
1498
+ for (var i = 0, list = decls; i < list.length; i += 1)
1499
+ {
1500
+ var decl = list[i];
1501
+
1502
+ this.checkPatternExport(exports, decl.id);
1503
+ }
1504
+ };
1505
+
1506
+ pp$1.shouldParseExportStatement = function() {
1507
+ return this.type.keyword === "var" ||
1508
+ this.type.keyword === "const" ||
1509
+ this.type.keyword === "class" ||
1510
+ this.type.keyword === "function" ||
1511
+ this.isLet() ||
1512
+ this.isAsyncFunction()
1513
+ };
1514
+
1515
+ // Parses a comma-separated list of module exports.
1516
+
1517
+ pp$1.parseExportSpecifiers = function(exports) {
1518
+ var nodes = [], first = true;
1519
+ // export { x, y as z } [from '...']
1520
+ this.expect(types.braceL);
1521
+ while (!this.eat(types.braceR)) {
1522
+ if (!first) {
1523
+ this.expect(types.comma);
1524
+ if (this.afterTrailingComma(types.braceR)) { break }
1525
+ } else { first = false; }
1526
+
1527
+ var node = this.startNode();
1528
+ node.local = this.parseIdent(true);
1529
+ node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local;
1530
+ this.checkExport(exports, node.exported.name, node.exported.start);
1531
+ nodes.push(this.finishNode(node, "ExportSpecifier"));
1532
+ }
1533
+ return nodes
1534
+ };
1535
+
1536
+ // Parses import declaration.
1537
+
1538
+ pp$1.parseImport = function(node) {
1539
+ this.next();
1540
+ // import '...'
1541
+ if (this.type === types.string) {
1542
+ node.specifiers = empty;
1543
+ node.source = this.parseExprAtom();
1544
+ } else {
1545
+ node.specifiers = this.parseImportSpecifiers();
1546
+ this.expectContextual("from");
1547
+ node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected();
1548
+ }
1549
+ this.semicolon();
1550
+ return this.finishNode(node, "ImportDeclaration")
1551
+ };
1552
+
1553
+ // Parses a comma-separated list of module imports.
1554
+
1555
+ pp$1.parseImportSpecifiers = function() {
1556
+ var nodes = [], first = true;
1557
+ if (this.type === types.name) {
1558
+ // import defaultObj, { x, y as z } from '...'
1559
+ var node = this.startNode();
1560
+ node.local = this.parseIdent();
1561
+ this.checkLVal(node.local, BIND_LEXICAL);
1562
+ nodes.push(this.finishNode(node, "ImportDefaultSpecifier"));
1563
+ if (!this.eat(types.comma)) { return nodes }
1564
+ }
1565
+ if (this.type === types.star) {
1566
+ var node$1 = this.startNode();
1567
+ this.next();
1568
+ this.expectContextual("as");
1569
+ node$1.local = this.parseIdent();
1570
+ this.checkLVal(node$1.local, BIND_LEXICAL);
1571
+ nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"));
1572
+ return nodes
1573
+ }
1574
+ this.expect(types.braceL);
1575
+ while (!this.eat(types.braceR)) {
1576
+ if (!first) {
1577
+ this.expect(types.comma);
1578
+ if (this.afterTrailingComma(types.braceR)) { break }
1579
+ } else { first = false; }
1580
+
1581
+ var node$2 = this.startNode();
1582
+ node$2.imported = this.parseIdent(true);
1583
+ if (this.eatContextual("as")) {
1584
+ node$2.local = this.parseIdent();
1585
+ } else {
1586
+ this.checkUnreserved(node$2.imported);
1587
+ node$2.local = node$2.imported;
1588
+ }
1589
+ this.checkLVal(node$2.local, BIND_LEXICAL);
1590
+ nodes.push(this.finishNode(node$2, "ImportSpecifier"));
1591
+ }
1592
+ return nodes
1593
+ };
1594
+
1595
+ // Set `ExpressionStatement#directive` property for directive prologues.
1596
+ pp$1.adaptDirectivePrologue = function(statements) {
1597
+ for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
1598
+ statements[i].directive = statements[i].expression.raw.slice(1, -1);
1599
+ }
1600
+ };
1601
+ pp$1.isDirectiveCandidate = function(statement) {
1602
+ return (
1603
+ statement.type === "ExpressionStatement" &&
1604
+ statement.expression.type === "Literal" &&
1605
+ typeof statement.expression.value === "string" &&
1606
+ // Reject parenthesized strings.
1607
+ (this.input[statement.start] === "\"" || this.input[statement.start] === "'")
1608
+ )
1609
+ };
1610
+
1611
+ var pp$2 = Parser.prototype;
1612
+
1613
+ // Convert existing expression atom to assignable pattern
1614
+ // if possible.
1615
+
1616
+ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) {
1617
+ if (this.options.ecmaVersion >= 6 && node) {
1618
+ switch (node.type) {
1619
+ case "Identifier":
1620
+ if (this.inAsync && node.name === "await")
1621
+ { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); }
1622
+ break
1623
+
1624
+ case "ObjectPattern":
1625
+ case "ArrayPattern":
1626
+ case "RestElement":
1627
+ break
1628
+
1629
+ case "ObjectExpression":
1630
+ node.type = "ObjectPattern";
1631
+ if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
1632
+ for (var i = 0, list = node.properties; i < list.length; i += 1) {
1633
+ var prop = list[i];
1634
+
1635
+ this.toAssignable(prop, isBinding);
1636
+ // Early error:
1637
+ // AssignmentRestProperty[Yield, Await] :
1638
+ // `...` DestructuringAssignmentTarget[Yield, Await]
1639
+ //
1640
+ // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.
1641
+ if (
1642
+ prop.type === "RestElement" &&
1643
+ (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")
1644
+ ) {
1645
+ this.raise(prop.argument.start, "Unexpected token");
1646
+ }
1647
+ }
1648
+ break
1649
+
1650
+ case "Property":
1651
+ // AssignmentProperty has type === "Property"
1652
+ if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); }
1653
+ this.toAssignable(node.value, isBinding);
1654
+ break
1655
+
1656
+ case "ArrayExpression":
1657
+ node.type = "ArrayPattern";
1658
+ if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
1659
+ this.toAssignableList(node.elements, isBinding);
1660
+ break
1661
+
1662
+ case "SpreadElement":
1663
+ node.type = "RestElement";
1664
+ this.toAssignable(node.argument, isBinding);
1665
+ if (node.argument.type === "AssignmentPattern")
1666
+ { this.raise(node.argument.start, "Rest elements cannot have a default value"); }
1667
+ break
1668
+
1669
+ case "AssignmentExpression":
1670
+ if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); }
1671
+ node.type = "AssignmentPattern";
1672
+ delete node.operator;
1673
+ this.toAssignable(node.left, isBinding);
1674
+ // falls through to AssignmentPattern
1675
+
1676
+ case "AssignmentPattern":
1677
+ break
1678
+
1679
+ case "ParenthesizedExpression":
1680
+ this.toAssignable(node.expression, isBinding, refDestructuringErrors);
1681
+ break
1682
+
1683
+ case "MemberExpression":
1684
+ if (!isBinding) { break }
1685
+
1686
+ default:
1687
+ this.raise(node.start, "Assigning to rvalue");
1688
+ }
1689
+ } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
1690
+ return node
1691
+ };
1692
+
1693
+ // Convert list of expression atoms to binding list.
1694
+
1695
+ pp$2.toAssignableList = function(exprList, isBinding) {
1696
+ var end = exprList.length;
1697
+ for (var i = 0; i < end; i++) {
1698
+ var elt = exprList[i];
1699
+ if (elt) { this.toAssignable(elt, isBinding); }
1700
+ }
1701
+ if (end) {
1702
+ var last = exprList[end - 1];
1703
+ if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier")
1704
+ { this.unexpected(last.argument.start); }
1705
+ }
1706
+ return exprList
1707
+ };
1708
+
1709
+ // Parses spread element.
1710
+
1711
+ pp$2.parseSpread = function(refDestructuringErrors) {
1712
+ var node = this.startNode();
1713
+ this.next();
1714
+ node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
1715
+ return this.finishNode(node, "SpreadElement")
1716
+ };
1717
+
1718
+ pp$2.parseRestBinding = function() {
1719
+ var node = this.startNode();
1720
+ this.next();
1721
+
1722
+ // RestElement inside of a function parameter must be an identifier
1723
+ if (this.options.ecmaVersion === 6 && this.type !== types.name)
1724
+ { this.unexpected(); }
1725
+
1726
+ node.argument = this.parseBindingAtom();
1727
+
1728
+ return this.finishNode(node, "RestElement")
1729
+ };
1730
+
1731
+ // Parses lvalue (assignable) atom.
1732
+
1733
+ pp$2.parseBindingAtom = function() {
1734
+ if (this.options.ecmaVersion >= 6) {
1735
+ switch (this.type) {
1736
+ case types.bracketL:
1737
+ var node = this.startNode();
1738
+ this.next();
1739
+ node.elements = this.parseBindingList(types.bracketR, true, true);
1740
+ return this.finishNode(node, "ArrayPattern")
1741
+
1742
+ case types.braceL:
1743
+ return this.parseObj(true)
1744
+ }
1745
+ }
1746
+ return this.parseIdent()
1747
+ };
1748
+
1749
+ pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
1750
+ var elts = [], first = true;
1751
+ while (!this.eat(close)) {
1752
+ if (first) { first = false; }
1753
+ else { this.expect(types.comma); }
1754
+ if (allowEmpty && this.type === types.comma) {
1755
+ elts.push(null);
1756
+ } else if (allowTrailingComma && this.afterTrailingComma(close)) {
1757
+ break
1758
+ } else if (this.type === types.ellipsis) {
1759
+ var rest = this.parseRestBinding();
1760
+ this.parseBindingListItem(rest);
1761
+ elts.push(rest);
1762
+ if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
1763
+ this.expect(close);
1764
+ break
1765
+ } else {
1766
+ var elem = this.parseMaybeDefault(this.start, this.startLoc);
1767
+ this.parseBindingListItem(elem);
1768
+ elts.push(elem);
1769
+ }
1770
+ }
1771
+ return elts
1772
+ };
1773
+
1774
+ pp$2.parseBindingListItem = function(param) {
1775
+ return param
1776
+ };
1777
+
1778
+ // Parses assignment pattern around given atom if possible.
1779
+
1780
+ pp$2.parseMaybeDefault = function(startPos, startLoc, left) {
1781
+ left = left || this.parseBindingAtom();
1782
+ if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left }
1783
+ var node = this.startNodeAt(startPos, startLoc);
1784
+ node.left = left;
1785
+ node.right = this.parseMaybeAssign();
1786
+ return this.finishNode(node, "AssignmentPattern")
1787
+ };
1788
+
1789
+ // Verify that a node is an lval — something that can be assigned
1790
+ // to.
1791
+ // bindingType can be either:
1792
+ // 'var' indicating that the lval creates a 'var' binding
1793
+ // 'let' indicating that the lval creates a lexical ('let' or 'const') binding
1794
+ // 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references
1795
+
1796
+ pp$2.checkLVal = function(expr, bindingType, checkClashes) {
1797
+ if ( bindingType === void 0 ) bindingType = BIND_NONE;
1798
+
1799
+ switch (expr.type) {
1800
+ case "Identifier":
1801
+ if (bindingType === BIND_LEXICAL && expr.name === "let")
1802
+ { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
1803
+ if (this.strict && this.reservedWordsStrictBind.test(expr.name))
1804
+ { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); }
1805
+ if (checkClashes) {
1806
+ if (has(checkClashes, expr.name))
1807
+ { this.raiseRecoverable(expr.start, "Argument name clash"); }
1808
+ checkClashes[expr.name] = true;
1809
+ }
1810
+ if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
1811
+ break
1812
+
1813
+ case "MemberExpression":
1814
+ if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); }
1815
+ break
1816
+
1817
+ case "ObjectPattern":
1818
+ for (var i = 0, list = expr.properties; i < list.length; i += 1)
1819
+ {
1820
+ var prop = list[i];
1821
+
1822
+ this.checkLVal(prop, bindingType, checkClashes);
1823
+ }
1824
+ break
1825
+
1826
+ case "Property":
1827
+ // AssignmentProperty has type === "Property"
1828
+ this.checkLVal(expr.value, bindingType, checkClashes);
1829
+ break
1830
+
1831
+ case "ArrayPattern":
1832
+ for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
1833
+ var elem = list$1[i$1];
1834
+
1835
+ if (elem) { this.checkLVal(elem, bindingType, checkClashes); }
1836
+ }
1837
+ break
1838
+
1839
+ case "AssignmentPattern":
1840
+ this.checkLVal(expr.left, bindingType, checkClashes);
1841
+ break
1842
+
1843
+ case "RestElement":
1844
+ this.checkLVal(expr.argument, bindingType, checkClashes);
1845
+ break
1846
+
1847
+ case "ParenthesizedExpression":
1848
+ this.checkLVal(expr.expression, bindingType, checkClashes);
1849
+ break
1850
+
1851
+ default:
1852
+ this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue");
1853
+ }
1854
+ };
1855
+
1856
+ // A recursive descent parser operates by defining functions for all
1857
+
1858
+ var pp$3 = Parser.prototype;
1859
+
1860
+ // Check if property name clashes with already added.
1861
+ // Object/class getters and setters are not allowed to clash —
1862
+ // either with each other or with an init property — and in
1863
+ // strict mode, init properties are also not allowed to be repeated.
1864
+
1865
+ pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) {
1866
+ if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement")
1867
+ { return }
1868
+ if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
1869
+ { return }
1870
+ var key = prop.key;
1871
+ var name;
1872
+ switch (key.type) {
1873
+ case "Identifier": name = key.name; break
1874
+ case "Literal": name = String(key.value); break
1875
+ default: return
1876
+ }
1877
+ var kind = prop.kind;
1878
+ if (this.options.ecmaVersion >= 6) {
1879
+ if (name === "__proto__" && kind === "init") {
1880
+ if (propHash.proto) {
1881
+ if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; }
1882
+ // Backwards-compat kludge. Can be removed in version 6.0
1883
+ else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
1884
+ }
1885
+ propHash.proto = true;
1886
+ }
1887
+ return
1888
+ }
1889
+ name = "$" + name;
1890
+ var other = propHash[name];
1891
+ if (other) {
1892
+ var redefinition;
1893
+ if (kind === "init") {
1894
+ redefinition = this.strict && other.init || other.get || other.set;
1895
+ } else {
1896
+ redefinition = other.init || other[kind];
1897
+ }
1898
+ if (redefinition)
1899
+ { this.raiseRecoverable(key.start, "Redefinition of property"); }
1900
+ } else {
1901
+ other = propHash[name] = {
1902
+ init: false,
1903
+ get: false,
1904
+ set: false
1905
+ };
1906
+ }
1907
+ other[kind] = true;
1908
+ };
1909
+
1910
+ // ### Expression parsing
1911
+
1912
+ // These nest, from the most general expression type at the top to
1913
+ // 'atomic', nondivisible expression types at the bottom. Most of
1914
+ // the functions will simply let the function(s) below them parse,
1915
+ // and, *if* the syntactic construct they handle is present, wrap
1916
+ // the AST node that the inner parser gave them in another node.
1917
+
1918
+ // Parse a full expression. The optional arguments are used to
1919
+ // forbid the `in` operator (in for loops initalization expressions)
1920
+ // and provide reference for storing '=' operator inside shorthand
1921
+ // property assignment in contexts where both object expression
1922
+ // and object pattern might appear (so it's possible to raise
1923
+ // delayed syntax error at correct position).
1924
+
1925
+ pp$3.parseExpression = function(noIn, refDestructuringErrors) {
1926
+ var startPos = this.start, startLoc = this.startLoc;
1927
+ var expr = this.parseMaybeAssign(noIn, refDestructuringErrors);
1928
+ if (this.type === types.comma) {
1929
+ var node = this.startNodeAt(startPos, startLoc);
1930
+ node.expressions = [expr];
1931
+ while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); }
1932
+ return this.finishNode(node, "SequenceExpression")
1933
+ }
1934
+ return expr
1935
+ };
1936
+
1937
+ // Parse an assignment expression. This includes applications of
1938
+ // operators like `+=`.
1939
+
1940
+ pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
1941
+ if (this.isContextual("yield")) {
1942
+ if (this.inGenerator) { return this.parseYield(noIn) }
1943
+ // The tokenizer will assume an expression is allowed after
1944
+ // `yield`, but this isn't that kind of yield
1945
+ else { this.exprAllowed = false; }
1946
+ }
1947
+
1948
+ var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1;
1949
+ if (refDestructuringErrors) {
1950
+ oldParenAssign = refDestructuringErrors.parenthesizedAssign;
1951
+ oldTrailingComma = refDestructuringErrors.trailingComma;
1952
+ oldShorthandAssign = refDestructuringErrors.shorthandAssign;
1953
+ refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1;
1954
+ } else {
1955
+ refDestructuringErrors = new DestructuringErrors;
1956
+ ownDestructuringErrors = true;
1957
+ }
1958
+
1959
+ var startPos = this.start, startLoc = this.startLoc;
1960
+ if (this.type === types.parenL || this.type === types.name)
1961
+ { this.potentialArrowAt = this.start; }
1962
+ var left = this.parseMaybeConditional(noIn, refDestructuringErrors);
1963
+ if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }
1964
+ if (this.type.isAssign) {
1965
+ var node = this.startNodeAt(startPos, startLoc);
1966
+ node.operator = this.value;
1967
+ node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left;
1968
+ if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); }
1969
+ refDestructuringErrors.shorthandAssign = -1; // reset because shorthand default was used correctly
1970
+ this.checkLVal(left);
1971
+ this.next();
1972
+ node.right = this.parseMaybeAssign(noIn);
1973
+ return this.finishNode(node, "AssignmentExpression")
1974
+ } else {
1975
+ if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
1976
+ }
1977
+ if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
1978
+ if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
1979
+ if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; }
1980
+ return left
1981
+ };
1982
+
1983
+ // Parse a ternary conditional (`?:`) operator.
1984
+
1985
+ pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) {
1986
+ var startPos = this.start, startLoc = this.startLoc;
1987
+ var expr = this.parseExprOps(noIn, refDestructuringErrors);
1988
+ if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
1989
+ if (this.eat(types.question)) {
1990
+ var node = this.startNodeAt(startPos, startLoc);
1991
+ node.test = expr;
1992
+ node.consequent = this.parseMaybeAssign();
1993
+ this.expect(types.colon);
1994
+ node.alternate = this.parseMaybeAssign(noIn);
1995
+ return this.finishNode(node, "ConditionalExpression")
1996
+ }
1997
+ return expr
1998
+ };
1999
+
2000
+ // Start the precedence parser.
2001
+
2002
+ pp$3.parseExprOps = function(noIn, refDestructuringErrors) {
2003
+ var startPos = this.start, startLoc = this.startLoc;
2004
+ var expr = this.parseMaybeUnary(refDestructuringErrors, false);
2005
+ if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
2006
+ return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn)
2007
+ };
2008
+
2009
+ // Parse binary operators with the operator precedence parsing
2010
+ // algorithm. `left` is the left-hand side of the operator.
2011
+ // `minPrec` provides context that allows the function to stop and
2012
+ // defer further parser to one of its callers when it encounters an
2013
+ // operator that has a lower precedence than the set it is parsing.
2014
+
2015
+ pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {
2016
+ var prec = this.type.binop;
2017
+ if (prec != null && (!noIn || this.type !== types._in)) {
2018
+ if (prec > minPrec) {
2019
+ var logical = this.type === types.logicalOR || this.type === types.logicalAND;
2020
+ var op = this.value;
2021
+ this.next();
2022
+ var startPos = this.start, startLoc = this.startLoc;
2023
+ var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn);
2024
+ var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical);
2025
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)
2026
+ }
2027
+ }
2028
+ return left
2029
+ };
2030
+
2031
+ pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) {
2032
+ var node = this.startNodeAt(startPos, startLoc);
2033
+ node.left = left;
2034
+ node.operator = op;
2035
+ node.right = right;
2036
+ return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression")
2037
+ };
2038
+
2039
+ // Parse unary operators, both prefix and postfix.
2040
+
2041
+ pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {
2042
+ var startPos = this.start, startLoc = this.startLoc, expr;
2043
+ if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) {
2044
+ expr = this.parseAwait();
2045
+ sawUnary = true;
2046
+ } else if (this.type.prefix) {
2047
+ var node = this.startNode(), update = this.type === types.incDec;
2048
+ node.operator = this.value;
2049
+ node.prefix = true;
2050
+ this.next();
2051
+ node.argument = this.parseMaybeUnary(null, true);
2052
+ this.checkExpressionErrors(refDestructuringErrors, true);
2053
+ if (update) { this.checkLVal(node.argument); }
2054
+ else if (this.strict && node.operator === "delete" &&
2055
+ node.argument.type === "Identifier")
2056
+ { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
2057
+ else { sawUnary = true; }
2058
+ expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
2059
+ } else {
2060
+ expr = this.parseExprSubscripts(refDestructuringErrors);
2061
+ if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
2062
+ while (this.type.postfix && !this.canInsertSemicolon()) {
2063
+ var node$1 = this.startNodeAt(startPos, startLoc);
2064
+ node$1.operator = this.value;
2065
+ node$1.prefix = false;
2066
+ node$1.argument = expr;
2067
+ this.checkLVal(expr);
2068
+ this.next();
2069
+ expr = this.finishNode(node$1, "UpdateExpression");
2070
+ }
2071
+ }
2072
+
2073
+ if (!sawUnary && this.eat(types.starstar))
2074
+ { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) }
2075
+ else
2076
+ { return expr }
2077
+ };
2078
+
2079
+ // Parse call, dot, and `[]`-subscript expressions.
2080
+
2081
+ pp$3.parseExprSubscripts = function(refDestructuringErrors) {
2082
+ var startPos = this.start, startLoc = this.startLoc;
2083
+ var expr = this.parseExprAtom(refDestructuringErrors);
2084
+ var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")";
2085
+ if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr }
2086
+ var result = this.parseSubscripts(expr, startPos, startLoc);
2087
+ if (refDestructuringErrors && result.type === "MemberExpression") {
2088
+ if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
2089
+ if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }
2090
+ }
2091
+ return result
2092
+ };
2093
+
2094
+ pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) {
2095
+ var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
2096
+ this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async";
2097
+ while (true) {
2098
+ var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow);
2099
+ if (element === base || element.type === "ArrowFunctionExpression") { return element }
2100
+ base = element;
2101
+ }
2102
+ };
2103
+
2104
+ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow) {
2105
+ var computed = this.eat(types.bracketL);
2106
+ if (computed || this.eat(types.dot)) {
2107
+ var node = this.startNodeAt(startPos, startLoc);
2108
+ node.object = base;
2109
+ node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never");
2110
+ node.computed = !!computed;
2111
+ if (computed) { this.expect(types.bracketR); }
2112
+ base = this.finishNode(node, "MemberExpression");
2113
+ } else if (!noCalls && this.eat(types.parenL)) {
2114
+ var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
2115
+ this.yieldPos = 0;
2116
+ this.awaitPos = 0;
2117
+ this.awaitIdentPos = 0;
2118
+ var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && base.type !== "Import", false, refDestructuringErrors);
2119
+ if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
2120
+ this.checkPatternErrors(refDestructuringErrors, false);
2121
+ this.checkYieldAwaitInDefaultParams();
2122
+ if (this.awaitIdentPos > 0)
2123
+ { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); }
2124
+ this.yieldPos = oldYieldPos;
2125
+ this.awaitPos = oldAwaitPos;
2126
+ this.awaitIdentPos = oldAwaitIdentPos;
2127
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true)
2128
+ }
2129
+ this.checkExpressionErrors(refDestructuringErrors, true);
2130
+ this.yieldPos = oldYieldPos || this.yieldPos;
2131
+ this.awaitPos = oldAwaitPos || this.awaitPos;
2132
+ this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
2133
+ var node$1 = this.startNodeAt(startPos, startLoc);
2134
+ node$1.callee = base;
2135
+ node$1.arguments = exprList;
2136
+ if (node$1.callee.type === "Import") {
2137
+ if (node$1.arguments.length !== 1) {
2138
+ this.raise(node$1.start, "import() requires exactly one argument");
2139
+ }
2140
+
2141
+ var importArg = node$1.arguments[0];
2142
+ if (importArg && importArg.type === "SpreadElement") {
2143
+ this.raise(importArg.start, "... is not allowed in import()");
2144
+ }
2145
+ }
2146
+ base = this.finishNode(node$1, "CallExpression");
2147
+ } else if (this.type === types.backQuote) {
2148
+ var node$2 = this.startNodeAt(startPos, startLoc);
2149
+ node$2.tag = base;
2150
+ node$2.quasi = this.parseTemplate({isTagged: true});
2151
+ base = this.finishNode(node$2, "TaggedTemplateExpression");
2152
+ }
2153
+ return base
2154
+ };
2155
+
2156
+ // Parse an atomic expression — either a single token that is an
2157
+ // expression, an expression started by a keyword like `function` or
2158
+ // `new`, or an expression wrapped in punctuation like `()`, `[]`,
2159
+ // or `{}`.
2160
+
2161
+ pp$3.parseExprAtom = function(refDestructuringErrors) {
2162
+ // If a division operator appears in an expression position, the
2163
+ // tokenizer got confused, and we force it to read a regexp instead.
2164
+ if (this.type === types.slash) { this.readRegexp(); }
2165
+
2166
+ var node, canBeArrow = this.potentialArrowAt === this.start;
2167
+ switch (this.type) {
2168
+ case types._super:
2169
+ if (!this.allowSuper)
2170
+ { this.raise(this.start, "'super' keyword outside a method"); }
2171
+ node = this.startNode();
2172
+ this.next();
2173
+ if (this.type === types.parenL && !this.allowDirectSuper)
2174
+ { this.raise(node.start, "super() call outside constructor of a subclass"); }
2175
+ // The `super` keyword can appear at below:
2176
+ // SuperProperty:
2177
+ // super [ Expression ]
2178
+ // super . IdentifierName
2179
+ // SuperCall:
2180
+ // super Arguments
2181
+ if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL)
2182
+ { this.unexpected(); }
2183
+ return this.finishNode(node, "Super")
2184
+
2185
+ case types._this:
2186
+ node = this.startNode();
2187
+ this.next();
2188
+ return this.finishNode(node, "ThisExpression")
2189
+
2190
+ case types.name:
2191
+ var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
2192
+ var id = this.parseIdent(false);
2193
+ if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function))
2194
+ { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) }
2195
+ if (canBeArrow && !this.canInsertSemicolon()) {
2196
+ if (this.eat(types.arrow))
2197
+ { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) }
2198
+ if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) {
2199
+ id = this.parseIdent(false);
2200
+ if (this.canInsertSemicolon() || !this.eat(types.arrow))
2201
+ { this.unexpected(); }
2202
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true)
2203
+ }
2204
+ }
2205
+ return id
2206
+
2207
+ case types.regexp:
2208
+ var value = this.value;
2209
+ node = this.parseLiteral(value.value);
2210
+ node.regex = {pattern: value.pattern, flags: value.flags};
2211
+ return node
2212
+
2213
+ case types.num: case types.string:
2214
+ return this.parseLiteral(this.value)
2215
+
2216
+ case types._null: case types._true: case types._false:
2217
+ node = this.startNode();
2218
+ node.value = this.type === types._null ? null : this.type === types._true;
2219
+ node.raw = this.type.keyword;
2220
+ this.next();
2221
+ return this.finishNode(node, "Literal")
2222
+
2223
+ case types.parenL:
2224
+ var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow);
2225
+ if (refDestructuringErrors) {
2226
+ if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
2227
+ { refDestructuringErrors.parenthesizedAssign = start; }
2228
+ if (refDestructuringErrors.parenthesizedBind < 0)
2229
+ { refDestructuringErrors.parenthesizedBind = start; }
2230
+ }
2231
+ return expr
2232
+
2233
+ case types.bracketL:
2234
+ node = this.startNode();
2235
+ this.next();
2236
+ node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors);
2237
+ return this.finishNode(node, "ArrayExpression")
2238
+
2239
+ case types.braceL:
2240
+ return this.parseObj(false, refDestructuringErrors)
2241
+
2242
+ case types._function:
2243
+ node = this.startNode();
2244
+ this.next();
2245
+ return this.parseFunction(node, 0)
2246
+
2247
+ case types._class:
2248
+ return this.parseClass(this.startNode(), false)
2249
+
2250
+ case types._new:
2251
+ return this.parseNew()
2252
+
2253
+ case types.backQuote:
2254
+ return this.parseTemplate()
2255
+
2256
+ case types._import:
2257
+ if (this.options.ecmaVersion > 10) {
2258
+ return this.parseDynamicImport()
2259
+ } else {
2260
+ return this.unexpected()
2261
+ }
2262
+
2263
+ default:
2264
+ this.unexpected();
2265
+ }
2266
+ };
2267
+
2268
+ pp$3.parseDynamicImport = function() {
2269
+ var node = this.startNode();
2270
+ this.next();
2271
+ if (this.type !== types.parenL) {
2272
+ this.unexpected();
2273
+ }
2274
+ return this.finishNode(node, "Import")
2275
+ };
2276
+
2277
+ pp$3.parseLiteral = function(value) {
2278
+ var node = this.startNode();
2279
+ node.value = value;
2280
+ node.raw = this.input.slice(this.start, this.end);
2281
+ if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1); }
2282
+ this.next();
2283
+ return this.finishNode(node, "Literal")
2284
+ };
2285
+
2286
+ pp$3.parseParenExpression = function() {
2287
+ this.expect(types.parenL);
2288
+ var val = this.parseExpression();
2289
+ this.expect(types.parenR);
2290
+ return val
2291
+ };
2292
+
2293
+ pp$3.parseParenAndDistinguishExpression = function(canBeArrow) {
2294
+ var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
2295
+ if (this.options.ecmaVersion >= 6) {
2296
+ this.next();
2297
+
2298
+ var innerStartPos = this.start, innerStartLoc = this.startLoc;
2299
+ var exprList = [], first = true, lastIsComma = false;
2300
+ var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
2301
+ this.yieldPos = 0;
2302
+ this.awaitPos = 0;
2303
+ // Do not save awaitIdentPos to allow checking awaits nested in parameters
2304
+ while (this.type !== types.parenR) {
2305
+ first ? first = false : this.expect(types.comma);
2306
+ if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) {
2307
+ lastIsComma = true;
2308
+ break
2309
+ } else if (this.type === types.ellipsis) {
2310
+ spreadStart = this.start;
2311
+ exprList.push(this.parseParenItem(this.parseRestBinding()));
2312
+ if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
2313
+ break
2314
+ } else {
2315
+ exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
2316
+ }
2317
+ }
2318
+ var innerEndPos = this.start, innerEndLoc = this.startLoc;
2319
+ this.expect(types.parenR);
2320
+
2321
+ if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
2322
+ this.checkPatternErrors(refDestructuringErrors, false);
2323
+ this.checkYieldAwaitInDefaultParams();
2324
+ this.yieldPos = oldYieldPos;
2325
+ this.awaitPos = oldAwaitPos;
2326
+ return this.parseParenArrowList(startPos, startLoc, exprList)
2327
+ }
2328
+
2329
+ if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }
2330
+ if (spreadStart) { this.unexpected(spreadStart); }
2331
+ this.checkExpressionErrors(refDestructuringErrors, true);
2332
+ this.yieldPos = oldYieldPos || this.yieldPos;
2333
+ this.awaitPos = oldAwaitPos || this.awaitPos;
2334
+
2335
+ if (exprList.length > 1) {
2336
+ val = this.startNodeAt(innerStartPos, innerStartLoc);
2337
+ val.expressions = exprList;
2338
+ this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
2339
+ } else {
2340
+ val = exprList[0];
2341
+ }
2342
+ } else {
2343
+ val = this.parseParenExpression();
2344
+ }
2345
+
2346
+ if (this.options.preserveParens) {
2347
+ var par = this.startNodeAt(startPos, startLoc);
2348
+ par.expression = val;
2349
+ return this.finishNode(par, "ParenthesizedExpression")
2350
+ } else {
2351
+ return val
2352
+ }
2353
+ };
2354
+
2355
+ pp$3.parseParenItem = function(item) {
2356
+ return item
2357
+ };
2358
+
2359
+ pp$3.parseParenArrowList = function(startPos, startLoc, exprList) {
2360
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)
2361
+ };
2362
+
2363
+ // New's precedence is slightly tricky. It must allow its argument to
2364
+ // be a `[]` or dot subscript expression, but not a call — at least,
2365
+ // not without wrapping it in parentheses. Thus, it uses the noCalls
2366
+ // argument to parseSubscripts to prevent it from consuming the
2367
+ // argument list.
2368
+
2369
+ var empty$1 = [];
2370
+
2371
+ pp$3.parseNew = function() {
2372
+ var node = this.startNode();
2373
+ var meta = this.parseIdent(true);
2374
+ if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) {
2375
+ node.meta = meta;
2376
+ var containsEsc = this.containsEsc;
2377
+ node.property = this.parseIdent(true);
2378
+ if (node.property.name !== "target" || containsEsc)
2379
+ { this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); }
2380
+ if (!this.inNonArrowFunction())
2381
+ { this.raiseRecoverable(node.start, "new.target can only be used in functions"); }
2382
+ return this.finishNode(node, "MetaProperty")
2383
+ }
2384
+ var startPos = this.start, startLoc = this.startLoc;
2385
+ node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
2386
+ if (this.options.ecmaVersion > 10 && node.callee.type === "Import") {
2387
+ this.raise(node.callee.start, "Cannot use new with import(...)");
2388
+ }
2389
+ if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && node.callee.type !== "Import", false); }
2390
+ else { node.arguments = empty$1; }
2391
+ return this.finishNode(node, "NewExpression")
2392
+ };
2393
+
2394
+ // Parse template expression.
2395
+
2396
+ pp$3.parseTemplateElement = function(ref) {
2397
+ var isTagged = ref.isTagged;
2398
+
2399
+ var elem = this.startNode();
2400
+ if (this.type === types.invalidTemplate) {
2401
+ if (!isTagged) {
2402
+ this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
2403
+ }
2404
+ elem.value = {
2405
+ raw: this.value,
2406
+ cooked: null
2407
+ };
2408
+ } else {
2409
+ elem.value = {
2410
+ raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
2411
+ cooked: this.value
2412
+ };
2413
+ }
2414
+ this.next();
2415
+ elem.tail = this.type === types.backQuote;
2416
+ return this.finishNode(elem, "TemplateElement")
2417
+ };
2418
+
2419
+ pp$3.parseTemplate = function(ref) {
2420
+ if ( ref === void 0 ) ref = {};
2421
+ var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;
2422
+
2423
+ var node = this.startNode();
2424
+ this.next();
2425
+ node.expressions = [];
2426
+ var curElt = this.parseTemplateElement({isTagged: isTagged});
2427
+ node.quasis = [curElt];
2428
+ while (!curElt.tail) {
2429
+ if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); }
2430
+ this.expect(types.dollarBraceL);
2431
+ node.expressions.push(this.parseExpression());
2432
+ this.expect(types.braceR);
2433
+ node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));
2434
+ }
2435
+ this.next();
2436
+ return this.finishNode(node, "TemplateLiteral")
2437
+ };
2438
+
2439
+ pp$3.isAsyncProp = function(prop) {
2440
+ return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
2441
+ (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) &&
2442
+ !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
2443
+ };
2444
+
2445
+ // Parse an object literal or binding pattern.
2446
+
2447
+ pp$3.parseObj = function(isPattern, refDestructuringErrors) {
2448
+ var node = this.startNode(), first = true, propHash = {};
2449
+ node.properties = [];
2450
+ this.next();
2451
+ while (!this.eat(types.braceR)) {
2452
+ if (!first) {
2453
+ this.expect(types.comma);
2454
+ if (this.afterTrailingComma(types.braceR)) { break }
2455
+ } else { first = false; }
2456
+
2457
+ var prop = this.parseProperty(isPattern, refDestructuringErrors);
2458
+ if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }
2459
+ node.properties.push(prop);
2460
+ }
2461
+ return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
2462
+ };
2463
+
2464
+ pp$3.parseProperty = function(isPattern, refDestructuringErrors) {
2465
+ var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
2466
+ if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) {
2467
+ if (isPattern) {
2468
+ prop.argument = this.parseIdent(false);
2469
+ if (this.type === types.comma) {
2470
+ this.raise(this.start, "Comma is not permitted after the rest element");
2471
+ }
2472
+ return this.finishNode(prop, "RestElement")
2473
+ }
2474
+ // To disallow parenthesized identifier via `this.toAssignable()`.
2475
+ if (this.type === types.parenL && refDestructuringErrors) {
2476
+ if (refDestructuringErrors.parenthesizedAssign < 0) {
2477
+ refDestructuringErrors.parenthesizedAssign = this.start;
2478
+ }
2479
+ if (refDestructuringErrors.parenthesizedBind < 0) {
2480
+ refDestructuringErrors.parenthesizedBind = this.start;
2481
+ }
2482
+ }
2483
+ // Parse argument.
2484
+ prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
2485
+ // To disallow trailing comma via `this.toAssignable()`.
2486
+ if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
2487
+ refDestructuringErrors.trailingComma = this.start;
2488
+ }
2489
+ // Finish
2490
+ return this.finishNode(prop, "SpreadElement")
2491
+ }
2492
+ if (this.options.ecmaVersion >= 6) {
2493
+ prop.method = false;
2494
+ prop.shorthand = false;
2495
+ if (isPattern || refDestructuringErrors) {
2496
+ startPos = this.start;
2497
+ startLoc = this.startLoc;
2498
+ }
2499
+ if (!isPattern)
2500
+ { isGenerator = this.eat(types.star); }
2501
+ }
2502
+ var containsEsc = this.containsEsc;
2503
+ this.parsePropertyName(prop);
2504
+ if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
2505
+ isAsync = true;
2506
+ isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star);
2507
+ this.parsePropertyName(prop, refDestructuringErrors);
2508
+ } else {
2509
+ isAsync = false;
2510
+ }
2511
+ this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
2512
+ return this.finishNode(prop, "Property")
2513
+ };
2514
+
2515
+ pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
2516
+ if ((isGenerator || isAsync) && this.type === types.colon)
2517
+ { this.unexpected(); }
2518
+
2519
+ if (this.eat(types.colon)) {
2520
+ prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
2521
+ prop.kind = "init";
2522
+ } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) {
2523
+ if (isPattern) { this.unexpected(); }
2524
+ prop.kind = "init";
2525
+ prop.method = true;
2526
+ prop.value = this.parseMethod(isGenerator, isAsync);
2527
+ } else if (!isPattern && !containsEsc &&
2528
+ this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
2529
+ (prop.key.name === "get" || prop.key.name === "set") &&
2530
+ (this.type !== types.comma && this.type !== types.braceR)) {
2531
+ if (isGenerator || isAsync) { this.unexpected(); }
2532
+ prop.kind = prop.key.name;
2533
+ this.parsePropertyName(prop);
2534
+ prop.value = this.parseMethod(false);
2535
+ var paramCount = prop.kind === "get" ? 0 : 1;
2536
+ if (prop.value.params.length !== paramCount) {
2537
+ var start = prop.value.start;
2538
+ if (prop.kind === "get")
2539
+ { this.raiseRecoverable(start, "getter should have no params"); }
2540
+ else
2541
+ { this.raiseRecoverable(start, "setter should have exactly one param"); }
2542
+ } else {
2543
+ if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
2544
+ { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
2545
+ }
2546
+ } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
2547
+ if (isGenerator || isAsync) { this.unexpected(); }
2548
+ this.checkUnreserved(prop.key);
2549
+ if (prop.key.name === "await" && !this.awaitIdentPos)
2550
+ { this.awaitIdentPos = startPos; }
2551
+ prop.kind = "init";
2552
+ if (isPattern) {
2553
+ prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key);
2554
+ } else if (this.type === types.eq && refDestructuringErrors) {
2555
+ if (refDestructuringErrors.shorthandAssign < 0)
2556
+ { refDestructuringErrors.shorthandAssign = this.start; }
2557
+ prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key);
2558
+ } else {
2559
+ prop.value = prop.key;
2560
+ }
2561
+ prop.shorthand = true;
2562
+ } else { this.unexpected(); }
2563
+ };
2564
+
2565
+ pp$3.parsePropertyName = function(prop) {
2566
+ if (this.options.ecmaVersion >= 6) {
2567
+ if (this.eat(types.bracketL)) {
2568
+ prop.computed = true;
2569
+ prop.key = this.parseMaybeAssign();
2570
+ this.expect(types.bracketR);
2571
+ return prop.key
2572
+ } else {
2573
+ prop.computed = false;
2574
+ }
2575
+ }
2576
+ return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")
2577
+ };
2578
+
2579
+ // Initialize empty function node.
2580
+
2581
+ pp$3.initFunction = function(node) {
2582
+ node.id = null;
2583
+ if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }
2584
+ if (this.options.ecmaVersion >= 8) { node.async = false; }
2585
+ };
2586
+
2587
+ // Parse object or class method.
2588
+
2589
+ pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
2590
+ var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
2591
+
2592
+ this.initFunction(node);
2593
+ if (this.options.ecmaVersion >= 6)
2594
+ { node.generator = isGenerator; }
2595
+ if (this.options.ecmaVersion >= 8)
2596
+ { node.async = !!isAsync; }
2597
+
2598
+ this.yieldPos = 0;
2599
+ this.awaitPos = 0;
2600
+ this.awaitIdentPos = 0;
2601
+ this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
2602
+
2603
+ this.expect(types.parenL);
2604
+ node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8);
2605
+ this.checkYieldAwaitInDefaultParams();
2606
+ this.parseFunctionBody(node, false, true);
2607
+
2608
+ this.yieldPos = oldYieldPos;
2609
+ this.awaitPos = oldAwaitPos;
2610
+ this.awaitIdentPos = oldAwaitIdentPos;
2611
+ return this.finishNode(node, "FunctionExpression")
2612
+ };
2613
+
2614
+ // Parse arrow function expression with given parameters.
2615
+
2616
+ pp$3.parseArrowExpression = function(node, params, isAsync) {
2617
+ var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
2618
+
2619
+ this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
2620
+ this.initFunction(node);
2621
+ if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }
2622
+
2623
+ this.yieldPos = 0;
2624
+ this.awaitPos = 0;
2625
+ this.awaitIdentPos = 0;
2626
+
2627
+ node.params = this.toAssignableList(params, true);
2628
+ this.parseFunctionBody(node, true, false);
2629
+
2630
+ this.yieldPos = oldYieldPos;
2631
+ this.awaitPos = oldAwaitPos;
2632
+ this.awaitIdentPos = oldAwaitIdentPos;
2633
+ return this.finishNode(node, "ArrowFunctionExpression")
2634
+ };
2635
+
2636
+ // Parse function body and check parameters.
2637
+
2638
+ pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) {
2639
+ var isExpression = isArrowFunction && this.type !== types.braceL;
2640
+ var oldStrict = this.strict, useStrict = false;
2641
+
2642
+ if (isExpression) {
2643
+ node.body = this.parseMaybeAssign();
2644
+ node.expression = true;
2645
+ this.checkParams(node, false);
2646
+ } else {
2647
+ var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
2648
+ if (!oldStrict || nonSimple) {
2649
+ useStrict = this.strictDirective(this.end);
2650
+ // If this is a strict mode function, verify that argument names
2651
+ // are not repeated, and it does not try to bind the words `eval`
2652
+ // or `arguments`.
2653
+ if (useStrict && nonSimple)
2654
+ { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); }
2655
+ }
2656
+ // Start a new scope with regard to labels and the `inFunction`
2657
+ // flag (restore them to their old value afterwards).
2658
+ var oldLabels = this.labels;
2659
+ this.labels = [];
2660
+ if (useStrict) { this.strict = true; }
2661
+
2662
+ // Add the params to varDeclaredNames to ensure that an error is thrown
2663
+ // if a let/const declaration in the function clashes with one of the params.
2664
+ this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
2665
+ node.body = this.parseBlock(false);
2666
+ node.expression = false;
2667
+ this.adaptDirectivePrologue(node.body.body);
2668
+ this.labels = oldLabels;
2669
+ }
2670
+ this.exitScope();
2671
+
2672
+ // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
2673
+ if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); }
2674
+ this.strict = oldStrict;
2675
+ };
2676
+
2677
+ pp$3.isSimpleParamList = function(params) {
2678
+ for (var i = 0, list = params; i < list.length; i += 1)
2679
+ {
2680
+ var param = list[i];
2681
+
2682
+ if (param.type !== "Identifier") { return false
2683
+ } }
2684
+ return true
2685
+ };
2686
+
2687
+ // Checks function params for various disallowed patterns such as using "eval"
2688
+ // or "arguments" and duplicate parameters.
2689
+
2690
+ pp$3.checkParams = function(node, allowDuplicates) {
2691
+ var nameHash = {};
2692
+ for (var i = 0, list = node.params; i < list.length; i += 1)
2693
+ {
2694
+ var param = list[i];
2695
+
2696
+ this.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash);
2697
+ }
2698
+ };
2699
+
2700
+ // Parses a comma-separated list of expressions, and returns them as
2701
+ // an array. `close` is the token type that ends the list, and
2702
+ // `allowEmpty` can be turned on to allow subsequent commas with
2703
+ // nothing in between them to be parsed as `null` (which is needed
2704
+ // for array literals).
2705
+
2706
+ pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
2707
+ var elts = [], first = true;
2708
+ while (!this.eat(close)) {
2709
+ if (!first) {
2710
+ this.expect(types.comma);
2711
+ if (allowTrailingComma && this.afterTrailingComma(close)) { break }
2712
+ } else { first = false; }
2713
+
2714
+ var elt = (void 0);
2715
+ if (allowEmpty && this.type === types.comma)
2716
+ { elt = null; }
2717
+ else if (this.type === types.ellipsis) {
2718
+ elt = this.parseSpread(refDestructuringErrors);
2719
+ if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0)
2720
+ { refDestructuringErrors.trailingComma = this.start; }
2721
+ } else {
2722
+ elt = this.parseMaybeAssign(false, refDestructuringErrors);
2723
+ }
2724
+ elts.push(elt);
2725
+ }
2726
+ return elts
2727
+ };
2728
+
2729
+ pp$3.checkUnreserved = function(ref) {
2730
+ var start = ref.start;
2731
+ var end = ref.end;
2732
+ var name = ref.name;
2733
+
2734
+ if (this.inGenerator && name === "yield")
2735
+ { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
2736
+ if (this.inAsync && name === "await")
2737
+ { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
2738
+ if (this.keywords.test(name))
2739
+ { this.raise(start, ("Unexpected keyword '" + name + "'")); }
2740
+ if (this.options.ecmaVersion < 6 &&
2741
+ this.input.slice(start, end).indexOf("\\") !== -1) { return }
2742
+ var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
2743
+ if (re.test(name)) {
2744
+ if (!this.inAsync && name === "await")
2745
+ { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); }
2746
+ this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved"));
2747
+ }
2748
+ };
2749
+
2750
+ // Parse the next token as an identifier. If `liberal` is true (used
2751
+ // when parsing properties), it will also convert keywords into
2752
+ // identifiers.
2753
+
2754
+ pp$3.parseIdent = function(liberal, isBinding) {
2755
+ var node = this.startNode();
2756
+ if (this.type === types.name) {
2757
+ node.name = this.value;
2758
+ } else if (this.type.keyword) {
2759
+ node.name = this.type.keyword;
2760
+
2761
+ // To fix https://github.com/acornjs/acorn/issues/575
2762
+ // `class` and `function` keywords push new context into this.context.
2763
+ // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.
2764
+ // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword
2765
+ if ((node.name === "class" || node.name === "function") &&
2766
+ (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
2767
+ this.context.pop();
2768
+ }
2769
+ } else {
2770
+ this.unexpected();
2771
+ }
2772
+ this.next();
2773
+ this.finishNode(node, "Identifier");
2774
+ if (!liberal) {
2775
+ this.checkUnreserved(node);
2776
+ if (node.name === "await" && !this.awaitIdentPos)
2777
+ { this.awaitIdentPos = node.start; }
2778
+ }
2779
+ return node
2780
+ };
2781
+
2782
+ // Parses yield expression inside generator.
2783
+
2784
+ pp$3.parseYield = function(noIn) {
2785
+ if (!this.yieldPos) { this.yieldPos = this.start; }
2786
+
2787
+ var node = this.startNode();
2788
+ this.next();
2789
+ if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) {
2790
+ node.delegate = false;
2791
+ node.argument = null;
2792
+ } else {
2793
+ node.delegate = this.eat(types.star);
2794
+ node.argument = this.parseMaybeAssign(noIn);
2795
+ }
2796
+ return this.finishNode(node, "YieldExpression")
2797
+ };
2798
+
2799
+ pp$3.parseAwait = function() {
2800
+ if (!this.awaitPos) { this.awaitPos = this.start; }
2801
+
2802
+ var node = this.startNode();
2803
+ this.next();
2804
+ node.argument = this.parseMaybeUnary(null, true);
2805
+ return this.finishNode(node, "AwaitExpression")
2806
+ };
2807
+
2808
+ var pp$4 = Parser.prototype;
2809
+
2810
+ // This function is used to raise exceptions on parse errors. It
2811
+ // takes an offset integer (into the current `input`) to indicate
2812
+ // the location of the error, attaches the position to the end
2813
+ // of the error message, and then raises a `SyntaxError` with that
2814
+ // message.
2815
+
2816
+ pp$4.raise = function(pos, message) {
2817
+ var loc = getLineInfo(this.input, pos);
2818
+ message += " (" + loc.line + ":" + loc.column + ")";
2819
+ var err = new SyntaxError(message);
2820
+ err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
2821
+ throw err
2822
+ };
2823
+
2824
+ pp$4.raiseRecoverable = pp$4.raise;
2825
+
2826
+ pp$4.curPosition = function() {
2827
+ if (this.options.locations) {
2828
+ return new Position(this.curLine, this.pos - this.lineStart)
2829
+ }
2830
+ };
2831
+
2832
+ var pp$5 = Parser.prototype;
2833
+
2834
+ var Scope = function Scope(flags) {
2835
+ this.flags = flags;
2836
+ // A list of var-declared names in the current lexical scope
2837
+ this.var = [];
2838
+ // A list of lexically-declared names in the current lexical scope
2839
+ this.lexical = [];
2840
+ // A list of lexically-declared FunctionDeclaration names in the current lexical scope
2841
+ this.functions = [];
2842
+ };
2843
+
2844
+ // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.
2845
+
2846
+ pp$5.enterScope = function(flags) {
2847
+ this.scopeStack.push(new Scope(flags));
2848
+ };
2849
+
2850
+ pp$5.exitScope = function() {
2851
+ this.scopeStack.pop();
2852
+ };
2853
+
2854
+ // The spec says:
2855
+ // > At the top level of a function, or script, function declarations are
2856
+ // > treated like var declarations rather than like lexical declarations.
2857
+ pp$5.treatFunctionsAsVarInScope = function(scope) {
2858
+ return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
2859
+ };
2860
+
2861
+ pp$5.declareName = function(name, bindingType, pos) {
2862
+ var redeclared = false;
2863
+ if (bindingType === BIND_LEXICAL) {
2864
+ var scope = this.currentScope();
2865
+ redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
2866
+ scope.lexical.push(name);
2867
+ if (this.inModule && (scope.flags & SCOPE_TOP))
2868
+ { delete this.undefinedExports[name]; }
2869
+ } else if (bindingType === BIND_SIMPLE_CATCH) {
2870
+ var scope$1 = this.currentScope();
2871
+ scope$1.lexical.push(name);
2872
+ } else if (bindingType === BIND_FUNCTION) {
2873
+ var scope$2 = this.currentScope();
2874
+ if (this.treatFunctionsAsVar)
2875
+ { redeclared = scope$2.lexical.indexOf(name) > -1; }
2876
+ else
2877
+ { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }
2878
+ scope$2.functions.push(name);
2879
+ } else {
2880
+ for (var i = this.scopeStack.length - 1; i >= 0; --i) {
2881
+ var scope$3 = this.scopeStack[i];
2882
+ if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||
2883
+ !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
2884
+ redeclared = true;
2885
+ break
2886
+ }
2887
+ scope$3.var.push(name);
2888
+ if (this.inModule && (scope$3.flags & SCOPE_TOP))
2889
+ { delete this.undefinedExports[name]; }
2890
+ if (scope$3.flags & SCOPE_VAR) { break }
2891
+ }
2892
+ }
2893
+ if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
2894
+ };
2895
+
2896
+ pp$5.checkLocalExport = function(id) {
2897
+ // scope.functions must be empty as Module code is always strict.
2898
+ if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&
2899
+ this.scopeStack[0].var.indexOf(id.name) === -1) {
2900
+ this.undefinedExports[id.name] = id;
2901
+ }
2902
+ };
2903
+
2904
+ pp$5.currentScope = function() {
2905
+ return this.scopeStack[this.scopeStack.length - 1]
2906
+ };
2907
+
2908
+ pp$5.currentVarScope = function() {
2909
+ for (var i = this.scopeStack.length - 1;; i--) {
2910
+ var scope = this.scopeStack[i];
2911
+ if (scope.flags & SCOPE_VAR) { return scope }
2912
+ }
2913
+ };
2914
+
2915
+ // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
2916
+ pp$5.currentThisScope = function() {
2917
+ for (var i = this.scopeStack.length - 1;; i--) {
2918
+ var scope = this.scopeStack[i];
2919
+ if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope }
2920
+ }
2921
+ };
2922
+
2923
+ var Node = function Node(parser, pos, loc) {
2924
+ this.type = "";
2925
+ this.start = pos;
2926
+ this.end = 0;
2927
+ if (parser.options.locations)
2928
+ { this.loc = new SourceLocation(parser, loc); }
2929
+ if (parser.options.directSourceFile)
2930
+ { this.sourceFile = parser.options.directSourceFile; }
2931
+ if (parser.options.ranges)
2932
+ { this.range = [pos, 0]; }
2933
+ };
2934
+
2935
+ // Start an AST node, attaching a start offset.
2936
+
2937
+ var pp$6 = Parser.prototype;
2938
+
2939
+ pp$6.startNode = function() {
2940
+ return new Node(this, this.start, this.startLoc)
2941
+ };
2942
+
2943
+ pp$6.startNodeAt = function(pos, loc) {
2944
+ return new Node(this, pos, loc)
2945
+ };
2946
+
2947
+ // Finish an AST node, adding `type` and `end` properties.
2948
+
2949
+ function finishNodeAt(node, type, pos, loc) {
2950
+ node.type = type;
2951
+ node.end = pos;
2952
+ if (this.options.locations)
2953
+ { node.loc.end = loc; }
2954
+ if (this.options.ranges)
2955
+ { node.range[1] = pos; }
2956
+ return node
2957
+ }
2958
+
2959
+ pp$6.finishNode = function(node, type) {
2960
+ return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
2961
+ };
2962
+
2963
+ // Finish node at given position
2964
+
2965
+ pp$6.finishNodeAt = function(node, type, pos, loc) {
2966
+ return finishNodeAt.call(this, node, type, pos, loc)
2967
+ };
2968
+
2969
+ // The algorithm used to determine whether a regexp can appear at a
2970
+
2971
+ var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
2972
+ this.token = token;
2973
+ this.isExpr = !!isExpr;
2974
+ this.preserveSpace = !!preserveSpace;
2975
+ this.override = override;
2976
+ this.generator = !!generator;
2977
+ };
2978
+
2979
+ var types$1 = {
2980
+ b_stat: new TokContext("{", false),
2981
+ b_expr: new TokContext("{", true),
2982
+ b_tmpl: new TokContext("${", false),
2983
+ p_stat: new TokContext("(", false),
2984
+ p_expr: new TokContext("(", true),
2985
+ q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
2986
+ f_stat: new TokContext("function", false),
2987
+ f_expr: new TokContext("function", true),
2988
+ f_expr_gen: new TokContext("function", true, false, null, true),
2989
+ f_gen: new TokContext("function", false, false, null, true)
2990
+ };
2991
+
2992
+ var pp$7 = Parser.prototype;
2993
+
2994
+ pp$7.initialContext = function() {
2995
+ return [types$1.b_stat]
2996
+ };
2997
+
2998
+ pp$7.braceIsBlock = function(prevType) {
2999
+ var parent = this.curContext();
3000
+ if (parent === types$1.f_expr || parent === types$1.f_stat)
3001
+ { return true }
3002
+ if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr))
3003
+ { return !parent.isExpr }
3004
+
3005
+ // The check for `tt.name && exprAllowed` detects whether we are
3006
+ // after a `yield` or `of` construct. See the `updateContext` for
3007
+ // `tt.name`.
3008
+ if (prevType === types._return || prevType === types.name && this.exprAllowed)
3009
+ { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }
3010
+ if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow)
3011
+ { return true }
3012
+ if (prevType === types.braceL)
3013
+ { return parent === types$1.b_stat }
3014
+ if (prevType === types._var || prevType === types._const || prevType === types.name)
3015
+ { return false }
3016
+ return !this.exprAllowed
3017
+ };
3018
+
3019
+ pp$7.inGeneratorContext = function() {
3020
+ for (var i = this.context.length - 1; i >= 1; i--) {
3021
+ var context = this.context[i];
3022
+ if (context.token === "function")
3023
+ { return context.generator }
3024
+ }
3025
+ return false
3026
+ };
3027
+
3028
+ pp$7.updateContext = function(prevType) {
3029
+ var update, type = this.type;
3030
+ if (type.keyword && prevType === types.dot)
3031
+ { this.exprAllowed = false; }
3032
+ else if (update = type.updateContext)
3033
+ { update.call(this, prevType); }
3034
+ else
3035
+ { this.exprAllowed = type.beforeExpr; }
3036
+ };
3037
+
3038
+ // Token-specific context update code
3039
+
3040
+ types.parenR.updateContext = types.braceR.updateContext = function() {
3041
+ if (this.context.length === 1) {
3042
+ this.exprAllowed = true;
3043
+ return
3044
+ }
3045
+ var out = this.context.pop();
3046
+ if (out === types$1.b_stat && this.curContext().token === "function") {
3047
+ out = this.context.pop();
3048
+ }
3049
+ this.exprAllowed = !out.isExpr;
3050
+ };
3051
+
3052
+ types.braceL.updateContext = function(prevType) {
3053
+ this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr);
3054
+ this.exprAllowed = true;
3055
+ };
3056
+
3057
+ types.dollarBraceL.updateContext = function() {
3058
+ this.context.push(types$1.b_tmpl);
3059
+ this.exprAllowed = true;
3060
+ };
3061
+
3062
+ types.parenL.updateContext = function(prevType) {
3063
+ var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
3064
+ this.context.push(statementParens ? types$1.p_stat : types$1.p_expr);
3065
+ this.exprAllowed = true;
3066
+ };
3067
+
3068
+ types.incDec.updateContext = function() {
3069
+ // tokExprAllowed stays unchanged
3070
+ };
3071
+
3072
+ types._function.updateContext = types._class.updateContext = function(prevType) {
3073
+ if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else &&
3074
+ !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
3075
+ !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat))
3076
+ { this.context.push(types$1.f_expr); }
3077
+ else
3078
+ { this.context.push(types$1.f_stat); }
3079
+ this.exprAllowed = false;
3080
+ };
3081
+
3082
+ types.backQuote.updateContext = function() {
3083
+ if (this.curContext() === types$1.q_tmpl)
3084
+ { this.context.pop(); }
3085
+ else
3086
+ { this.context.push(types$1.q_tmpl); }
3087
+ this.exprAllowed = false;
3088
+ };
3089
+
3090
+ types.star.updateContext = function(prevType) {
3091
+ if (prevType === types._function) {
3092
+ var index = this.context.length - 1;
3093
+ if (this.context[index] === types$1.f_expr)
3094
+ { this.context[index] = types$1.f_expr_gen; }
3095
+ else
3096
+ { this.context[index] = types$1.f_gen; }
3097
+ }
3098
+ this.exprAllowed = true;
3099
+ };
3100
+
3101
+ types.name.updateContext = function(prevType) {
3102
+ var allowed = false;
3103
+ if (this.options.ecmaVersion >= 6 && prevType !== types.dot) {
3104
+ if (this.value === "of" && !this.exprAllowed ||
3105
+ this.value === "yield" && this.inGeneratorContext())
3106
+ { allowed = true; }
3107
+ }
3108
+ this.exprAllowed = allowed;
3109
+ };
3110
+
3111
+ // This file contains Unicode properties extracted from the ECMAScript
3112
+ // specification. The lists are extracted like so:
3113
+ // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)
3114
+
3115
+ // #table-binary-unicode-properties
3116
+ var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
3117
+ var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
3118
+ var ecma11BinaryProperties = ecma10BinaryProperties;
3119
+ var unicodeBinaryProperties = {
3120
+ 9: ecma9BinaryProperties,
3121
+ 10: ecma10BinaryProperties,
3122
+ 11: ecma11BinaryProperties
3123
+ };
3124
+
3125
+ // #table-unicode-general-category-values
3126
+ var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
3127
+
3128
+ // #table-unicode-script-values
3129
+ var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
3130
+ var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
3131
+ var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
3132
+ var unicodeScriptValues = {
3133
+ 9: ecma9ScriptValues,
3134
+ 10: ecma10ScriptValues,
3135
+ 11: ecma11ScriptValues
3136
+ };
3137
+
3138
+ var data = {};
3139
+ function buildUnicodeData(ecmaVersion) {
3140
+ var d = data[ecmaVersion] = {
3141
+ binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
3142
+ nonBinary: {
3143
+ General_Category: wordsRegexp(unicodeGeneralCategoryValues),
3144
+ Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
3145
+ }
3146
+ };
3147
+ d.nonBinary.Script_Extensions = d.nonBinary.Script;
3148
+
3149
+ d.nonBinary.gc = d.nonBinary.General_Category;
3150
+ d.nonBinary.sc = d.nonBinary.Script;
3151
+ d.nonBinary.scx = d.nonBinary.Script_Extensions;
3152
+ }
3153
+ buildUnicodeData(9);
3154
+ buildUnicodeData(10);
3155
+ buildUnicodeData(11);
3156
+
3157
+ var pp$8 = Parser.prototype;
3158
+
3159
+ var RegExpValidationState = function RegExpValidationState(parser) {
3160
+ this.parser = parser;
3161
+ this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "");
3162
+ this.unicodeProperties = data[parser.options.ecmaVersion >= 11 ? 11 : parser.options.ecmaVersion];
3163
+ this.source = "";
3164
+ this.flags = "";
3165
+ this.start = 0;
3166
+ this.switchU = false;
3167
+ this.switchN = false;
3168
+ this.pos = 0;
3169
+ this.lastIntValue = 0;
3170
+ this.lastStringValue = "";
3171
+ this.lastAssertionIsQuantifiable = false;
3172
+ this.numCapturingParens = 0;
3173
+ this.maxBackReference = 0;
3174
+ this.groupNames = [];
3175
+ this.backReferenceNames = [];
3176
+ };
3177
+
3178
+ RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
3179
+ var unicode = flags.indexOf("u") !== -1;
3180
+ this.start = start | 0;
3181
+ this.source = pattern + "";
3182
+ this.flags = flags;
3183
+ this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
3184
+ this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
3185
+ };
3186
+
3187
+ RegExpValidationState.prototype.raise = function raise (message) {
3188
+ this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message));
3189
+ };
3190
+
3191
+ // If u flag is given, this returns the code point at the index (it combines a surrogate pair).
3192
+ // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
3193
+ RegExpValidationState.prototype.at = function at (i) {
3194
+ var s = this.source;
3195
+ var l = s.length;
3196
+ if (i >= l) {
3197
+ return -1
3198
+ }
3199
+ var c = s.charCodeAt(i);
3200
+ if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
3201
+ return c
3202
+ }
3203
+ return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00
3204
+ };
3205
+
3206
+ RegExpValidationState.prototype.nextIndex = function nextIndex (i) {
3207
+ var s = this.source;
3208
+ var l = s.length;
3209
+ if (i >= l) {
3210
+ return l
3211
+ }
3212
+ var c = s.charCodeAt(i);
3213
+ if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
3214
+ return i + 1
3215
+ }
3216
+ return i + 2
3217
+ };
3218
+
3219
+ RegExpValidationState.prototype.current = function current () {
3220
+ return this.at(this.pos)
3221
+ };
3222
+
3223
+ RegExpValidationState.prototype.lookahead = function lookahead () {
3224
+ return this.at(this.nextIndex(this.pos))
3225
+ };
3226
+
3227
+ RegExpValidationState.prototype.advance = function advance () {
3228
+ this.pos = this.nextIndex(this.pos);
3229
+ };
3230
+
3231
+ RegExpValidationState.prototype.eat = function eat (ch) {
3232
+ if (this.current() === ch) {
3233
+ this.advance();
3234
+ return true
3235
+ }
3236
+ return false
3237
+ };
3238
+
3239
+ function codePointToString(ch) {
3240
+ if (ch <= 0xFFFF) { return String.fromCharCode(ch) }
3241
+ ch -= 0x10000;
3242
+ return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00)
3243
+ }
3244
+
3245
+ /**
3246
+ * Validate the flags part of a given RegExpLiteral.
3247
+ *
3248
+ * @param {RegExpValidationState} state The state to validate RegExp.
3249
+ * @returns {void}
3250
+ */
3251
+ pp$8.validateRegExpFlags = function(state) {
3252
+ var validFlags = state.validFlags;
3253
+ var flags = state.flags;
3254
+
3255
+ for (var i = 0; i < flags.length; i++) {
3256
+ var flag = flags.charAt(i);
3257
+ if (validFlags.indexOf(flag) === -1) {
3258
+ this.raise(state.start, "Invalid regular expression flag");
3259
+ }
3260
+ if (flags.indexOf(flag, i + 1) > -1) {
3261
+ this.raise(state.start, "Duplicate regular expression flag");
3262
+ }
3263
+ }
3264
+ };
3265
+
3266
+ /**
3267
+ * Validate the pattern part of a given RegExpLiteral.
3268
+ *
3269
+ * @param {RegExpValidationState} state The state to validate RegExp.
3270
+ * @returns {void}
3271
+ */
3272
+ pp$8.validateRegExpPattern = function(state) {
3273
+ this.regexp_pattern(state);
3274
+
3275
+ // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of
3276
+ // parsing contains a |GroupName|, reparse with the goal symbol
3277
+ // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
3278
+ // exception if _P_ did not conform to the grammar, if any elements of _P_
3279
+ // were not matched by the parse, or if any Early Error conditions exist.
3280
+ if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {
3281
+ state.switchN = true;
3282
+ this.regexp_pattern(state);
3283
+ }
3284
+ };
3285
+
3286
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern
3287
+ pp$8.regexp_pattern = function(state) {
3288
+ state.pos = 0;
3289
+ state.lastIntValue = 0;
3290
+ state.lastStringValue = "";
3291
+ state.lastAssertionIsQuantifiable = false;
3292
+ state.numCapturingParens = 0;
3293
+ state.maxBackReference = 0;
3294
+ state.groupNames.length = 0;
3295
+ state.backReferenceNames.length = 0;
3296
+
3297
+ this.regexp_disjunction(state);
3298
+
3299
+ if (state.pos !== state.source.length) {
3300
+ // Make the same messages as V8.
3301
+ if (state.eat(0x29 /* ) */)) {
3302
+ state.raise("Unmatched ')'");
3303
+ }
3304
+ if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) {
3305
+ state.raise("Lone quantifier brackets");
3306
+ }
3307
+ }
3308
+ if (state.maxBackReference > state.numCapturingParens) {
3309
+ state.raise("Invalid escape");
3310
+ }
3311
+ for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
3312
+ var name = list[i];
3313
+
3314
+ if (state.groupNames.indexOf(name) === -1) {
3315
+ state.raise("Invalid named capture referenced");
3316
+ }
3317
+ }
3318
+ };
3319
+
3320
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
3321
+ pp$8.regexp_disjunction = function(state) {
3322
+ this.regexp_alternative(state);
3323
+ while (state.eat(0x7C /* | */)) {
3324
+ this.regexp_alternative(state);
3325
+ }
3326
+
3327
+ // Make the same message as V8.
3328
+ if (this.regexp_eatQuantifier(state, true)) {
3329
+ state.raise("Nothing to repeat");
3330
+ }
3331
+ if (state.eat(0x7B /* { */)) {
3332
+ state.raise("Lone quantifier brackets");
3333
+ }
3334
+ };
3335
+
3336
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
3337
+ pp$8.regexp_alternative = function(state) {
3338
+ while (state.pos < state.source.length && this.regexp_eatTerm(state))
3339
+ { }
3340
+ };
3341
+
3342
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
3343
+ pp$8.regexp_eatTerm = function(state) {
3344
+ if (this.regexp_eatAssertion(state)) {
3345
+ // Handle `QuantifiableAssertion Quantifier` alternative.
3346
+ // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion
3347
+ // is a QuantifiableAssertion.
3348
+ if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
3349
+ // Make the same message as V8.
3350
+ if (state.switchU) {
3351
+ state.raise("Invalid quantifier");
3352
+ }
3353
+ }
3354
+ return true
3355
+ }
3356
+
3357
+ if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
3358
+ this.regexp_eatQuantifier(state);
3359
+ return true
3360
+ }
3361
+
3362
+ return false
3363
+ };
3364
+
3365
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion
3366
+ pp$8.regexp_eatAssertion = function(state) {
3367
+ var start = state.pos;
3368
+ state.lastAssertionIsQuantifiable = false;
3369
+
3370
+ // ^, $
3371
+ if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {
3372
+ return true
3373
+ }
3374
+
3375
+ // \b \B
3376
+ if (state.eat(0x5C /* \ */)) {
3377
+ if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {
3378
+ return true
3379
+ }
3380
+ state.pos = start;
3381
+ }
3382
+
3383
+ // Lookahead / Lookbehind
3384
+ if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {
3385
+ var lookbehind = false;
3386
+ if (this.options.ecmaVersion >= 9) {
3387
+ lookbehind = state.eat(0x3C /* < */);
3388
+ }
3389
+ if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {
3390
+ this.regexp_disjunction(state);
3391
+ if (!state.eat(0x29 /* ) */)) {
3392
+ state.raise("Unterminated group");
3393
+ }
3394
+ state.lastAssertionIsQuantifiable = !lookbehind;
3395
+ return true
3396
+ }
3397
+ }
3398
+
3399
+ state.pos = start;
3400
+ return false
3401
+ };
3402
+
3403
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier
3404
+ pp$8.regexp_eatQuantifier = function(state, noError) {
3405
+ if ( noError === void 0 ) noError = false;
3406
+
3407
+ if (this.regexp_eatQuantifierPrefix(state, noError)) {
3408
+ state.eat(0x3F /* ? */);
3409
+ return true
3410
+ }
3411
+ return false
3412
+ };
3413
+
3414
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix
3415
+ pp$8.regexp_eatQuantifierPrefix = function(state, noError) {
3416
+ return (
3417
+ state.eat(0x2A /* * */) ||
3418
+ state.eat(0x2B /* + */) ||
3419
+ state.eat(0x3F /* ? */) ||
3420
+ this.regexp_eatBracedQuantifier(state, noError)
3421
+ )
3422
+ };
3423
+ pp$8.regexp_eatBracedQuantifier = function(state, noError) {
3424
+ var start = state.pos;
3425
+ if (state.eat(0x7B /* { */)) {
3426
+ var min = 0, max = -1;
3427
+ if (this.regexp_eatDecimalDigits(state)) {
3428
+ min = state.lastIntValue;
3429
+ if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {
3430
+ max = state.lastIntValue;
3431
+ }
3432
+ if (state.eat(0x7D /* } */)) {
3433
+ // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term
3434
+ if (max !== -1 && max < min && !noError) {
3435
+ state.raise("numbers out of order in {} quantifier");
3436
+ }
3437
+ return true
3438
+ }
3439
+ }
3440
+ if (state.switchU && !noError) {
3441
+ state.raise("Incomplete quantifier");
3442
+ }
3443
+ state.pos = start;
3444
+ }
3445
+ return false
3446
+ };
3447
+
3448
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom
3449
+ pp$8.regexp_eatAtom = function(state) {
3450
+ return (
3451
+ this.regexp_eatPatternCharacters(state) ||
3452
+ state.eat(0x2E /* . */) ||
3453
+ this.regexp_eatReverseSolidusAtomEscape(state) ||
3454
+ this.regexp_eatCharacterClass(state) ||
3455
+ this.regexp_eatUncapturingGroup(state) ||
3456
+ this.regexp_eatCapturingGroup(state)
3457
+ )
3458
+ };
3459
+ pp$8.regexp_eatReverseSolidusAtomEscape = function(state) {
3460
+ var start = state.pos;
3461
+ if (state.eat(0x5C /* \ */)) {
3462
+ if (this.regexp_eatAtomEscape(state)) {
3463
+ return true
3464
+ }
3465
+ state.pos = start;
3466
+ }
3467
+ return false
3468
+ };
3469
+ pp$8.regexp_eatUncapturingGroup = function(state) {
3470
+ var start = state.pos;
3471
+ if (state.eat(0x28 /* ( */)) {
3472
+ if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {
3473
+ this.regexp_disjunction(state);
3474
+ if (state.eat(0x29 /* ) */)) {
3475
+ return true
3476
+ }
3477
+ state.raise("Unterminated group");
3478
+ }
3479
+ state.pos = start;
3480
+ }
3481
+ return false
3482
+ };
3483
+ pp$8.regexp_eatCapturingGroup = function(state) {
3484
+ if (state.eat(0x28 /* ( */)) {
3485
+ if (this.options.ecmaVersion >= 9) {
3486
+ this.regexp_groupSpecifier(state);
3487
+ } else if (state.current() === 0x3F /* ? */) {
3488
+ state.raise("Invalid group");
3489
+ }
3490
+ this.regexp_disjunction(state);
3491
+ if (state.eat(0x29 /* ) */)) {
3492
+ state.numCapturingParens += 1;
3493
+ return true
3494
+ }
3495
+ state.raise("Unterminated group");
3496
+ }
3497
+ return false
3498
+ };
3499
+
3500
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
3501
+ pp$8.regexp_eatExtendedAtom = function(state) {
3502
+ return (
3503
+ state.eat(0x2E /* . */) ||
3504
+ this.regexp_eatReverseSolidusAtomEscape(state) ||
3505
+ this.regexp_eatCharacterClass(state) ||
3506
+ this.regexp_eatUncapturingGroup(state) ||
3507
+ this.regexp_eatCapturingGroup(state) ||
3508
+ this.regexp_eatInvalidBracedQuantifier(state) ||
3509
+ this.regexp_eatExtendedPatternCharacter(state)
3510
+ )
3511
+ };
3512
+
3513
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier
3514
+ pp$8.regexp_eatInvalidBracedQuantifier = function(state) {
3515
+ if (this.regexp_eatBracedQuantifier(state, true)) {
3516
+ state.raise("Nothing to repeat");
3517
+ }
3518
+ return false
3519
+ };
3520
+
3521
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter
3522
+ pp$8.regexp_eatSyntaxCharacter = function(state) {
3523
+ var ch = state.current();
3524
+ if (isSyntaxCharacter(ch)) {
3525
+ state.lastIntValue = ch;
3526
+ state.advance();
3527
+ return true
3528
+ }
3529
+ return false
3530
+ };
3531
+ function isSyntaxCharacter(ch) {
3532
+ return (
3533
+ ch === 0x24 /* $ */ ||
3534
+ ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||
3535
+ ch === 0x2E /* . */ ||
3536
+ ch === 0x3F /* ? */ ||
3537
+ ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||
3538
+ ch >= 0x7B /* { */ && ch <= 0x7D /* } */
3539
+ )
3540
+ }
3541
+
3542
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter
3543
+ // But eat eager.
3544
+ pp$8.regexp_eatPatternCharacters = function(state) {
3545
+ var start = state.pos;
3546
+ var ch = 0;
3547
+ while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {
3548
+ state.advance();
3549
+ }
3550
+ return state.pos !== start
3551
+ };
3552
+
3553
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter
3554
+ pp$8.regexp_eatExtendedPatternCharacter = function(state) {
3555
+ var ch = state.current();
3556
+ if (
3557
+ ch !== -1 &&
3558
+ ch !== 0x24 /* $ */ &&
3559
+ !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&
3560
+ ch !== 0x2E /* . */ &&
3561
+ ch !== 0x3F /* ? */ &&
3562
+ ch !== 0x5B /* [ */ &&
3563
+ ch !== 0x5E /* ^ */ &&
3564
+ ch !== 0x7C /* | */
3565
+ ) {
3566
+ state.advance();
3567
+ return true
3568
+ }
3569
+ return false
3570
+ };
3571
+
3572
+ // GroupSpecifier[U] ::
3573
+ // [empty]
3574
+ // `?` GroupName[?U]
3575
+ pp$8.regexp_groupSpecifier = function(state) {
3576
+ if (state.eat(0x3F /* ? */)) {
3577
+ if (this.regexp_eatGroupName(state)) {
3578
+ if (state.groupNames.indexOf(state.lastStringValue) !== -1) {
3579
+ state.raise("Duplicate capture group name");
3580
+ }
3581
+ state.groupNames.push(state.lastStringValue);
3582
+ return
3583
+ }
3584
+ state.raise("Invalid group");
3585
+ }
3586
+ };
3587
+
3588
+ // GroupName[U] ::
3589
+ // `<` RegExpIdentifierName[?U] `>`
3590
+ // Note: this updates `state.lastStringValue` property with the eaten name.
3591
+ pp$8.regexp_eatGroupName = function(state) {
3592
+ state.lastStringValue = "";
3593
+ if (state.eat(0x3C /* < */)) {
3594
+ if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {
3595
+ return true
3596
+ }
3597
+ state.raise("Invalid capture group name");
3598
+ }
3599
+ return false
3600
+ };
3601
+
3602
+ // RegExpIdentifierName[U] ::
3603
+ // RegExpIdentifierStart[?U]
3604
+ // RegExpIdentifierName[?U] RegExpIdentifierPart[?U]
3605
+ // Note: this updates `state.lastStringValue` property with the eaten name.
3606
+ pp$8.regexp_eatRegExpIdentifierName = function(state) {
3607
+ state.lastStringValue = "";
3608
+ if (this.regexp_eatRegExpIdentifierStart(state)) {
3609
+ state.lastStringValue += codePointToString(state.lastIntValue);
3610
+ while (this.regexp_eatRegExpIdentifierPart(state)) {
3611
+ state.lastStringValue += codePointToString(state.lastIntValue);
3612
+ }
3613
+ return true
3614
+ }
3615
+ return false
3616
+ };
3617
+
3618
+ // RegExpIdentifierStart[U] ::
3619
+ // UnicodeIDStart
3620
+ // `$`
3621
+ // `_`
3622
+ // `\` RegExpUnicodeEscapeSequence[?U]
3623
+ pp$8.regexp_eatRegExpIdentifierStart = function(state) {
3624
+ var start = state.pos;
3625
+ var ch = state.current();
3626
+ state.advance();
3627
+
3628
+ if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {
3629
+ ch = state.lastIntValue;
3630
+ }
3631
+ if (isRegExpIdentifierStart(ch)) {
3632
+ state.lastIntValue = ch;
3633
+ return true
3634
+ }
3635
+
3636
+ state.pos = start;
3637
+ return false
3638
+ };
3639
+ function isRegExpIdentifierStart(ch) {
3640
+ return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
3641
+ }
3642
+
3643
+ // RegExpIdentifierPart[U] ::
3644
+ // UnicodeIDContinue
3645
+ // `$`
3646
+ // `_`
3647
+ // `\` RegExpUnicodeEscapeSequence[?U]
3648
+ // <ZWNJ>
3649
+ // <ZWJ>
3650
+ pp$8.regexp_eatRegExpIdentifierPart = function(state) {
3651
+ var start = state.pos;
3652
+ var ch = state.current();
3653
+ state.advance();
3654
+
3655
+ if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {
3656
+ ch = state.lastIntValue;
3657
+ }
3658
+ if (isRegExpIdentifierPart(ch)) {
3659
+ state.lastIntValue = ch;
3660
+ return true
3661
+ }
3662
+
3663
+ state.pos = start;
3664
+ return false
3665
+ };
3666
+ function isRegExpIdentifierPart(ch) {
3667
+ return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */
3668
+ }
3669
+
3670
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape
3671
+ pp$8.regexp_eatAtomEscape = function(state) {
3672
+ if (
3673
+ this.regexp_eatBackReference(state) ||
3674
+ this.regexp_eatCharacterClassEscape(state) ||
3675
+ this.regexp_eatCharacterEscape(state) ||
3676
+ (state.switchN && this.regexp_eatKGroupName(state))
3677
+ ) {
3678
+ return true
3679
+ }
3680
+ if (state.switchU) {
3681
+ // Make the same message as V8.
3682
+ if (state.current() === 0x63 /* c */) {
3683
+ state.raise("Invalid unicode escape");
3684
+ }
3685
+ state.raise("Invalid escape");
3686
+ }
3687
+ return false
3688
+ };
3689
+ pp$8.regexp_eatBackReference = function(state) {
3690
+ var start = state.pos;
3691
+ if (this.regexp_eatDecimalEscape(state)) {
3692
+ var n = state.lastIntValue;
3693
+ if (state.switchU) {
3694
+ // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape
3695
+ if (n > state.maxBackReference) {
3696
+ state.maxBackReference = n;
3697
+ }
3698
+ return true
3699
+ }
3700
+ if (n <= state.numCapturingParens) {
3701
+ return true
3702
+ }
3703
+ state.pos = start;
3704
+ }
3705
+ return false
3706
+ };
3707
+ pp$8.regexp_eatKGroupName = function(state) {
3708
+ if (state.eat(0x6B /* k */)) {
3709
+ if (this.regexp_eatGroupName(state)) {
3710
+ state.backReferenceNames.push(state.lastStringValue);
3711
+ return true
3712
+ }
3713
+ state.raise("Invalid named reference");
3714
+ }
3715
+ return false
3716
+ };
3717
+
3718
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape
3719
+ pp$8.regexp_eatCharacterEscape = function(state) {
3720
+ return (
3721
+ this.regexp_eatControlEscape(state) ||
3722
+ this.regexp_eatCControlLetter(state) ||
3723
+ this.regexp_eatZero(state) ||
3724
+ this.regexp_eatHexEscapeSequence(state) ||
3725
+ this.regexp_eatRegExpUnicodeEscapeSequence(state) ||
3726
+ (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
3727
+ this.regexp_eatIdentityEscape(state)
3728
+ )
3729
+ };
3730
+ pp$8.regexp_eatCControlLetter = function(state) {
3731
+ var start = state.pos;
3732
+ if (state.eat(0x63 /* c */)) {
3733
+ if (this.regexp_eatControlLetter(state)) {
3734
+ return true
3735
+ }
3736
+ state.pos = start;
3737
+ }
3738
+ return false
3739
+ };
3740
+ pp$8.regexp_eatZero = function(state) {
3741
+ if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {
3742
+ state.lastIntValue = 0;
3743
+ state.advance();
3744
+ return true
3745
+ }
3746
+ return false
3747
+ };
3748
+
3749
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape
3750
+ pp$8.regexp_eatControlEscape = function(state) {
3751
+ var ch = state.current();
3752
+ if (ch === 0x74 /* t */) {
3753
+ state.lastIntValue = 0x09; /* \t */
3754
+ state.advance();
3755
+ return true
3756
+ }
3757
+ if (ch === 0x6E /* n */) {
3758
+ state.lastIntValue = 0x0A; /* \n */
3759
+ state.advance();
3760
+ return true
3761
+ }
3762
+ if (ch === 0x76 /* v */) {
3763
+ state.lastIntValue = 0x0B; /* \v */
3764
+ state.advance();
3765
+ return true
3766
+ }
3767
+ if (ch === 0x66 /* f */) {
3768
+ state.lastIntValue = 0x0C; /* \f */
3769
+ state.advance();
3770
+ return true
3771
+ }
3772
+ if (ch === 0x72 /* r */) {
3773
+ state.lastIntValue = 0x0D; /* \r */
3774
+ state.advance();
3775
+ return true
3776
+ }
3777
+ return false
3778
+ };
3779
+
3780
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter
3781
+ pp$8.regexp_eatControlLetter = function(state) {
3782
+ var ch = state.current();
3783
+ if (isControlLetter(ch)) {
3784
+ state.lastIntValue = ch % 0x20;
3785
+ state.advance();
3786
+ return true
3787
+ }
3788
+ return false
3789
+ };
3790
+ function isControlLetter(ch) {
3791
+ return (
3792
+ (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||
3793
+ (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)
3794
+ )
3795
+ }
3796
+
3797
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
3798
+ pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state) {
3799
+ var start = state.pos;
3800
+
3801
+ if (state.eat(0x75 /* u */)) {
3802
+ if (this.regexp_eatFixedHexDigits(state, 4)) {
3803
+ var lead = state.lastIntValue;
3804
+ if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) {
3805
+ var leadSurrogateEnd = state.pos;
3806
+ if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
3807
+ var trail = state.lastIntValue;
3808
+ if (trail >= 0xDC00 && trail <= 0xDFFF) {
3809
+ state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
3810
+ return true
3811
+ }
3812
+ }
3813
+ state.pos = leadSurrogateEnd;
3814
+ state.lastIntValue = lead;
3815
+ }
3816
+ return true
3817
+ }
3818
+ if (
3819
+ state.switchU &&
3820
+ state.eat(0x7B /* { */) &&
3821
+ this.regexp_eatHexDigits(state) &&
3822
+ state.eat(0x7D /* } */) &&
3823
+ isValidUnicode(state.lastIntValue)
3824
+ ) {
3825
+ return true
3826
+ }
3827
+ if (state.switchU) {
3828
+ state.raise("Invalid unicode escape");
3829
+ }
3830
+ state.pos = start;
3831
+ }
3832
+
3833
+ return false
3834
+ };
3835
+ function isValidUnicode(ch) {
3836
+ return ch >= 0 && ch <= 0x10FFFF
3837
+ }
3838
+
3839
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape
3840
+ pp$8.regexp_eatIdentityEscape = function(state) {
3841
+ if (state.switchU) {
3842
+ if (this.regexp_eatSyntaxCharacter(state)) {
3843
+ return true
3844
+ }
3845
+ if (state.eat(0x2F /* / */)) {
3846
+ state.lastIntValue = 0x2F; /* / */
3847
+ return true
3848
+ }
3849
+ return false
3850
+ }
3851
+
3852
+ var ch = state.current();
3853
+ if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {
3854
+ state.lastIntValue = ch;
3855
+ state.advance();
3856
+ return true
3857
+ }
3858
+
3859
+ return false
3860
+ };
3861
+
3862
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape
3863
+ pp$8.regexp_eatDecimalEscape = function(state) {
3864
+ state.lastIntValue = 0;
3865
+ var ch = state.current();
3866
+ if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {
3867
+ do {
3868
+ state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
3869
+ state.advance();
3870
+ } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)
3871
+ return true
3872
+ }
3873
+ return false
3874
+ };
3875
+
3876
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape
3877
+ pp$8.regexp_eatCharacterClassEscape = function(state) {
3878
+ var ch = state.current();
3879
+
3880
+ if (isCharacterClassEscape(ch)) {
3881
+ state.lastIntValue = -1;
3882
+ state.advance();
3883
+ return true
3884
+ }
3885
+
3886
+ if (
3887
+ state.switchU &&
3888
+ this.options.ecmaVersion >= 9 &&
3889
+ (ch === 0x50 /* P */ || ch === 0x70 /* p */)
3890
+ ) {
3891
+ state.lastIntValue = -1;
3892
+ state.advance();
3893
+ if (
3894
+ state.eat(0x7B /* { */) &&
3895
+ this.regexp_eatUnicodePropertyValueExpression(state) &&
3896
+ state.eat(0x7D /* } */)
3897
+ ) {
3898
+ return true
3899
+ }
3900
+ state.raise("Invalid property name");
3901
+ }
3902
+
3903
+ return false
3904
+ };
3905
+ function isCharacterClassEscape(ch) {
3906
+ return (
3907
+ ch === 0x64 /* d */ ||
3908
+ ch === 0x44 /* D */ ||
3909
+ ch === 0x73 /* s */ ||
3910
+ ch === 0x53 /* S */ ||
3911
+ ch === 0x77 /* w */ ||
3912
+ ch === 0x57 /* W */
3913
+ )
3914
+ }
3915
+
3916
+ // UnicodePropertyValueExpression ::
3917
+ // UnicodePropertyName `=` UnicodePropertyValue
3918
+ // LoneUnicodePropertyNameOrValue
3919
+ pp$8.regexp_eatUnicodePropertyValueExpression = function(state) {
3920
+ var start = state.pos;
3921
+
3922
+ // UnicodePropertyName `=` UnicodePropertyValue
3923
+ if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {
3924
+ var name = state.lastStringValue;
3925
+ if (this.regexp_eatUnicodePropertyValue(state)) {
3926
+ var value = state.lastStringValue;
3927
+ this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
3928
+ return true
3929
+ }
3930
+ }
3931
+ state.pos = start;
3932
+
3933
+ // LoneUnicodePropertyNameOrValue
3934
+ if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
3935
+ var nameOrValue = state.lastStringValue;
3936
+ this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);
3937
+ return true
3938
+ }
3939
+ return false
3940
+ };
3941
+ pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
3942
+ if (!has(state.unicodeProperties.nonBinary, name))
3943
+ { state.raise("Invalid property name"); }
3944
+ if (!state.unicodeProperties.nonBinary[name].test(value))
3945
+ { state.raise("Invalid property value"); }
3946
+ };
3947
+ pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
3948
+ if (!state.unicodeProperties.binary.test(nameOrValue))
3949
+ { state.raise("Invalid property name"); }
3950
+ };
3951
+
3952
+ // UnicodePropertyName ::
3953
+ // UnicodePropertyNameCharacters
3954
+ pp$8.regexp_eatUnicodePropertyName = function(state) {
3955
+ var ch = 0;
3956
+ state.lastStringValue = "";
3957
+ while (isUnicodePropertyNameCharacter(ch = state.current())) {
3958
+ state.lastStringValue += codePointToString(ch);
3959
+ state.advance();
3960
+ }
3961
+ return state.lastStringValue !== ""
3962
+ };
3963
+ function isUnicodePropertyNameCharacter(ch) {
3964
+ return isControlLetter(ch) || ch === 0x5F /* _ */
3965
+ }
3966
+
3967
+ // UnicodePropertyValue ::
3968
+ // UnicodePropertyValueCharacters
3969
+ pp$8.regexp_eatUnicodePropertyValue = function(state) {
3970
+ var ch = 0;
3971
+ state.lastStringValue = "";
3972
+ while (isUnicodePropertyValueCharacter(ch = state.current())) {
3973
+ state.lastStringValue += codePointToString(ch);
3974
+ state.advance();
3975
+ }
3976
+ return state.lastStringValue !== ""
3977
+ };
3978
+ function isUnicodePropertyValueCharacter(ch) {
3979
+ return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)
3980
+ }
3981
+
3982
+ // LoneUnicodePropertyNameOrValue ::
3983
+ // UnicodePropertyValueCharacters
3984
+ pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
3985
+ return this.regexp_eatUnicodePropertyValue(state)
3986
+ };
3987
+
3988
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass
3989
+ pp$8.regexp_eatCharacterClass = function(state) {
3990
+ if (state.eat(0x5B /* [ */)) {
3991
+ state.eat(0x5E /* ^ */);
3992
+ this.regexp_classRanges(state);
3993
+ if (state.eat(0x5D /* [ */)) {
3994
+ return true
3995
+ }
3996
+ // Unreachable since it threw "unterminated regular expression" error before.
3997
+ state.raise("Unterminated character class");
3998
+ }
3999
+ return false
4000
+ };
4001
+
4002
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges
4003
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges
4004
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash
4005
+ pp$8.regexp_classRanges = function(state) {
4006
+ while (this.regexp_eatClassAtom(state)) {
4007
+ var left = state.lastIntValue;
4008
+ if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {
4009
+ var right = state.lastIntValue;
4010
+ if (state.switchU && (left === -1 || right === -1)) {
4011
+ state.raise("Invalid character class");
4012
+ }
4013
+ if (left !== -1 && right !== -1 && left > right) {
4014
+ state.raise("Range out of order in character class");
4015
+ }
4016
+ }
4017
+ }
4018
+ };
4019
+
4020
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom
4021
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash
4022
+ pp$8.regexp_eatClassAtom = function(state) {
4023
+ var start = state.pos;
4024
+
4025
+ if (state.eat(0x5C /* \ */)) {
4026
+ if (this.regexp_eatClassEscape(state)) {
4027
+ return true
4028
+ }
4029
+ if (state.switchU) {
4030
+ // Make the same message as V8.
4031
+ var ch$1 = state.current();
4032
+ if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {
4033
+ state.raise("Invalid class escape");
4034
+ }
4035
+ state.raise("Invalid escape");
4036
+ }
4037
+ state.pos = start;
4038
+ }
4039
+
4040
+ var ch = state.current();
4041
+ if (ch !== 0x5D /* [ */) {
4042
+ state.lastIntValue = ch;
4043
+ state.advance();
4044
+ return true
4045
+ }
4046
+
4047
+ return false
4048
+ };
4049
+
4050
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape
4051
+ pp$8.regexp_eatClassEscape = function(state) {
4052
+ var start = state.pos;
4053
+
4054
+ if (state.eat(0x62 /* b */)) {
4055
+ state.lastIntValue = 0x08; /* <BS> */
4056
+ return true
4057
+ }
4058
+
4059
+ if (state.switchU && state.eat(0x2D /* - */)) {
4060
+ state.lastIntValue = 0x2D; /* - */
4061
+ return true
4062
+ }
4063
+
4064
+ if (!state.switchU && state.eat(0x63 /* c */)) {
4065
+ if (this.regexp_eatClassControlLetter(state)) {
4066
+ return true
4067
+ }
4068
+ state.pos = start;
4069
+ }
4070
+
4071
+ return (
4072
+ this.regexp_eatCharacterClassEscape(state) ||
4073
+ this.regexp_eatCharacterEscape(state)
4074
+ )
4075
+ };
4076
+
4077
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter
4078
+ pp$8.regexp_eatClassControlLetter = function(state) {
4079
+ var ch = state.current();
4080
+ if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {
4081
+ state.lastIntValue = ch % 0x20;
4082
+ state.advance();
4083
+ return true
4084
+ }
4085
+ return false
4086
+ };
4087
+
4088
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
4089
+ pp$8.regexp_eatHexEscapeSequence = function(state) {
4090
+ var start = state.pos;
4091
+ if (state.eat(0x78 /* x */)) {
4092
+ if (this.regexp_eatFixedHexDigits(state, 2)) {
4093
+ return true
4094
+ }
4095
+ if (state.switchU) {
4096
+ state.raise("Invalid escape");
4097
+ }
4098
+ state.pos = start;
4099
+ }
4100
+ return false
4101
+ };
4102
+
4103
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits
4104
+ pp$8.regexp_eatDecimalDigits = function(state) {
4105
+ var start = state.pos;
4106
+ var ch = 0;
4107
+ state.lastIntValue = 0;
4108
+ while (isDecimalDigit(ch = state.current())) {
4109
+ state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
4110
+ state.advance();
4111
+ }
4112
+ return state.pos !== start
4113
+ };
4114
+ function isDecimalDigit(ch) {
4115
+ return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */
4116
+ }
4117
+
4118
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits
4119
+ pp$8.regexp_eatHexDigits = function(state) {
4120
+ var start = state.pos;
4121
+ var ch = 0;
4122
+ state.lastIntValue = 0;
4123
+ while (isHexDigit(ch = state.current())) {
4124
+ state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
4125
+ state.advance();
4126
+ }
4127
+ return state.pos !== start
4128
+ };
4129
+ function isHexDigit(ch) {
4130
+ return (
4131
+ (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||
4132
+ (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||
4133
+ (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)
4134
+ )
4135
+ }
4136
+ function hexToInt(ch) {
4137
+ if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {
4138
+ return 10 + (ch - 0x41 /* A */)
4139
+ }
4140
+ if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {
4141
+ return 10 + (ch - 0x61 /* a */)
4142
+ }
4143
+ return ch - 0x30 /* 0 */
4144
+ }
4145
+
4146
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence
4147
+ // Allows only 0-377(octal) i.e. 0-255(decimal).
4148
+ pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) {
4149
+ if (this.regexp_eatOctalDigit(state)) {
4150
+ var n1 = state.lastIntValue;
4151
+ if (this.regexp_eatOctalDigit(state)) {
4152
+ var n2 = state.lastIntValue;
4153
+ if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
4154
+ state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
4155
+ } else {
4156
+ state.lastIntValue = n1 * 8 + n2;
4157
+ }
4158
+ } else {
4159
+ state.lastIntValue = n1;
4160
+ }
4161
+ return true
4162
+ }
4163
+ return false
4164
+ };
4165
+
4166
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit
4167
+ pp$8.regexp_eatOctalDigit = function(state) {
4168
+ var ch = state.current();
4169
+ if (isOctalDigit(ch)) {
4170
+ state.lastIntValue = ch - 0x30; /* 0 */
4171
+ state.advance();
4172
+ return true
4173
+ }
4174
+ state.lastIntValue = 0;
4175
+ return false
4176
+ };
4177
+ function isOctalDigit(ch) {
4178
+ return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */
4179
+ }
4180
+
4181
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits
4182
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit
4183
+ // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
4184
+ pp$8.regexp_eatFixedHexDigits = function(state, length) {
4185
+ var start = state.pos;
4186
+ state.lastIntValue = 0;
4187
+ for (var i = 0; i < length; ++i) {
4188
+ var ch = state.current();
4189
+ if (!isHexDigit(ch)) {
4190
+ state.pos = start;
4191
+ return false
4192
+ }
4193
+ state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
4194
+ state.advance();
4195
+ }
4196
+ return true
4197
+ };
4198
+
4199
+ // Object type used to represent tokens. Note that normally, tokens
4200
+ // simply exist as properties on the parser object. This is only
4201
+ // used for the onToken callback and the external tokenizer.
4202
+
4203
+ var Token = function Token(p) {
4204
+ this.type = p.type;
4205
+ this.value = p.value;
4206
+ this.start = p.start;
4207
+ this.end = p.end;
4208
+ if (p.options.locations)
4209
+ { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }
4210
+ if (p.options.ranges)
4211
+ { this.range = [p.start, p.end]; }
4212
+ };
4213
+
4214
+ // ## Tokenizer
4215
+
4216
+ var pp$9 = Parser.prototype;
4217
+
4218
+ // Move to the next token
4219
+
4220
+ pp$9.next = function() {
4221
+ if (this.options.onToken)
4222
+ { this.options.onToken(new Token(this)); }
4223
+
4224
+ this.lastTokEnd = this.end;
4225
+ this.lastTokStart = this.start;
4226
+ this.lastTokEndLoc = this.endLoc;
4227
+ this.lastTokStartLoc = this.startLoc;
4228
+ this.nextToken();
4229
+ };
4230
+
4231
+ pp$9.getToken = function() {
4232
+ this.next();
4233
+ return new Token(this)
4234
+ };
4235
+
4236
+ // If we're in an ES6 environment, make parsers iterable
4237
+ if (typeof Symbol !== "undefined")
4238
+ { pp$9[Symbol.iterator] = function() {
4239
+ var this$1 = this;
4240
+
4241
+ return {
4242
+ next: function () {
4243
+ var token = this$1.getToken();
4244
+ return {
4245
+ done: token.type === types.eof,
4246
+ value: token
4247
+ }
4248
+ }
4249
+ }
4250
+ }; }
4251
+
4252
+ // Toggle strict mode. Re-reads the next number or string to please
4253
+ // pedantic tests (`"use strict"; 010;` should fail).
4254
+
4255
+ pp$9.curContext = function() {
4256
+ return this.context[this.context.length - 1]
4257
+ };
4258
+
4259
+ // Read a single token, updating the parser object's token-related
4260
+ // properties.
4261
+
4262
+ pp$9.nextToken = function() {
4263
+ var curContext = this.curContext();
4264
+ if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }
4265
+
4266
+ this.start = this.pos;
4267
+ if (this.options.locations) { this.startLoc = this.curPosition(); }
4268
+ if (this.pos >= this.input.length) { return this.finishToken(types.eof) }
4269
+
4270
+ if (curContext.override) { return curContext.override(this) }
4271
+ else { this.readToken(this.fullCharCodeAtPos()); }
4272
+ };
4273
+
4274
+ pp$9.readToken = function(code) {
4275
+ // Identifier or keyword. '\uXXXX' sequences are allowed in
4276
+ // identifiers, so '\' also dispatches to that.
4277
+ if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */)
4278
+ { return this.readWord() }
4279
+
4280
+ return this.getTokenFromCode(code)
4281
+ };
4282
+
4283
+ pp$9.fullCharCodeAtPos = function() {
4284
+ var code = this.input.charCodeAt(this.pos);
4285
+ if (code <= 0xd7ff || code >= 0xe000) { return code }
4286
+ var next = this.input.charCodeAt(this.pos + 1);
4287
+ return (code << 10) + next - 0x35fdc00
4288
+ };
4289
+
4290
+ pp$9.skipBlockComment = function() {
4291
+ var startLoc = this.options.onComment && this.curPosition();
4292
+ var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
4293
+ if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
4294
+ this.pos = end + 2;
4295
+ if (this.options.locations) {
4296
+ lineBreakG.lastIndex = start;
4297
+ var match;
4298
+ while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
4299
+ ++this.curLine;
4300
+ this.lineStart = match.index + match[0].length;
4301
+ }
4302
+ }
4303
+ if (this.options.onComment)
4304
+ { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
4305
+ startLoc, this.curPosition()); }
4306
+ };
4307
+
4308
+ pp$9.skipLineComment = function(startSkip) {
4309
+ var start = this.pos;
4310
+ var startLoc = this.options.onComment && this.curPosition();
4311
+ var ch = this.input.charCodeAt(this.pos += startSkip);
4312
+ while (this.pos < this.input.length && !isNewLine(ch)) {
4313
+ ch = this.input.charCodeAt(++this.pos);
4314
+ }
4315
+ if (this.options.onComment)
4316
+ { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,
4317
+ startLoc, this.curPosition()); }
4318
+ };
4319
+
4320
+ // Called at the start of the parse and after every token. Skips
4321
+ // whitespace and comments, and.
4322
+
4323
+ pp$9.skipSpace = function() {
4324
+ loop: while (this.pos < this.input.length) {
4325
+ var ch = this.input.charCodeAt(this.pos);
4326
+ switch (ch) {
4327
+ case 32: case 160: // ' '
4328
+ ++this.pos;
4329
+ break
4330
+ case 13:
4331
+ if (this.input.charCodeAt(this.pos + 1) === 10) {
4332
+ ++this.pos;
4333
+ }
4334
+ case 10: case 8232: case 8233:
4335
+ ++this.pos;
4336
+ if (this.options.locations) {
4337
+ ++this.curLine;
4338
+ this.lineStart = this.pos;
4339
+ }
4340
+ break
4341
+ case 47: // '/'
4342
+ switch (this.input.charCodeAt(this.pos + 1)) {
4343
+ case 42: // '*'
4344
+ this.skipBlockComment();
4345
+ break
4346
+ case 47:
4347
+ this.skipLineComment(2);
4348
+ break
4349
+ default:
4350
+ break loop
4351
+ }
4352
+ break
4353
+ default:
4354
+ if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
4355
+ ++this.pos;
4356
+ } else {
4357
+ break loop
4358
+ }
4359
+ }
4360
+ }
4361
+ };
4362
+
4363
+ // Called at the end of every token. Sets `end`, `val`, and
4364
+ // maintains `context` and `exprAllowed`, and skips the space after
4365
+ // the token, so that the next one's `start` will point at the
4366
+ // right position.
4367
+
4368
+ pp$9.finishToken = function(type, val) {
4369
+ this.end = this.pos;
4370
+ if (this.options.locations) { this.endLoc = this.curPosition(); }
4371
+ var prevType = this.type;
4372
+ this.type = type;
4373
+ this.value = val;
4374
+
4375
+ this.updateContext(prevType);
4376
+ };
4377
+
4378
+ // ### Token reading
4379
+
4380
+ // This is the function that is called to fetch the next token. It
4381
+ // is somewhat obscure, because it works in character codes rather
4382
+ // than characters, and because operator parsing has been inlined
4383
+ // into it.
4384
+ //
4385
+ // All in the name of speed.
4386
+ //
4387
+ pp$9.readToken_dot = function() {
4388
+ var next = this.input.charCodeAt(this.pos + 1);
4389
+ if (next >= 48 && next <= 57) { return this.readNumber(true) }
4390
+ var next2 = this.input.charCodeAt(this.pos + 2);
4391
+ if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'
4392
+ this.pos += 3;
4393
+ return this.finishToken(types.ellipsis)
4394
+ } else {
4395
+ ++this.pos;
4396
+ return this.finishToken(types.dot)
4397
+ }
4398
+ };
4399
+
4400
+ pp$9.readToken_slash = function() { // '/'
4401
+ var next = this.input.charCodeAt(this.pos + 1);
4402
+ if (this.exprAllowed) { ++this.pos; return this.readRegexp() }
4403
+ if (next === 61) { return this.finishOp(types.assign, 2) }
4404
+ return this.finishOp(types.slash, 1)
4405
+ };
4406
+
4407
+ pp$9.readToken_mult_modulo_exp = function(code) { // '%*'
4408
+ var next = this.input.charCodeAt(this.pos + 1);
4409
+ var size = 1;
4410
+ var tokentype = code === 42 ? types.star : types.modulo;
4411
+
4412
+ // exponentiation operator ** and **=
4413
+ if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {
4414
+ ++size;
4415
+ tokentype = types.starstar;
4416
+ next = this.input.charCodeAt(this.pos + 2);
4417
+ }
4418
+
4419
+ if (next === 61) { return this.finishOp(types.assign, size + 1) }
4420
+ return this.finishOp(tokentype, size)
4421
+ };
4422
+
4423
+ pp$9.readToken_pipe_amp = function(code) { // '|&'
4424
+ var next = this.input.charCodeAt(this.pos + 1);
4425
+ if (next === code) { return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) }
4426
+ if (next === 61) { return this.finishOp(types.assign, 2) }
4427
+ return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1)
4428
+ };
4429
+
4430
+ pp$9.readToken_caret = function() { // '^'
4431
+ var next = this.input.charCodeAt(this.pos + 1);
4432
+ if (next === 61) { return this.finishOp(types.assign, 2) }
4433
+ return this.finishOp(types.bitwiseXOR, 1)
4434
+ };
4435
+
4436
+ pp$9.readToken_plus_min = function(code) { // '+-'
4437
+ var next = this.input.charCodeAt(this.pos + 1);
4438
+ if (next === code) {
4439
+ if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&
4440
+ (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {
4441
+ // A `-->` line comment
4442
+ this.skipLineComment(3);
4443
+ this.skipSpace();
4444
+ return this.nextToken()
4445
+ }
4446
+ return this.finishOp(types.incDec, 2)
4447
+ }
4448
+ if (next === 61) { return this.finishOp(types.assign, 2) }
4449
+ return this.finishOp(types.plusMin, 1)
4450
+ };
4451
+
4452
+ pp$9.readToken_lt_gt = function(code) { // '<>'
4453
+ var next = this.input.charCodeAt(this.pos + 1);
4454
+ var size = 1;
4455
+ if (next === code) {
4456
+ size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
4457
+ if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }
4458
+ return this.finishOp(types.bitShift, size)
4459
+ }
4460
+ if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
4461
+ this.input.charCodeAt(this.pos + 3) === 45) {
4462
+ // `<!--`, an XML-style comment that should be interpreted as a line comment
4463
+ this.skipLineComment(4);
4464
+ this.skipSpace();
4465
+ return this.nextToken()
4466
+ }
4467
+ if (next === 61) { size = 2; }
4468
+ return this.finishOp(types.relational, size)
4469
+ };
4470
+
4471
+ pp$9.readToken_eq_excl = function(code) { // '=!'
4472
+ var next = this.input.charCodeAt(this.pos + 1);
4473
+ if (next === 61) { return this.finishOp(types.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }
4474
+ if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'
4475
+ this.pos += 2;
4476
+ return this.finishToken(types.arrow)
4477
+ }
4478
+ return this.finishOp(code === 61 ? types.eq : types.prefix, 1)
4479
+ };
4480
+
4481
+ pp$9.getTokenFromCode = function(code) {
4482
+ switch (code) {
4483
+ // The interpretation of a dot depends on whether it is followed
4484
+ // by a digit or another two dots.
4485
+ case 46: // '.'
4486
+ return this.readToken_dot()
4487
+
4488
+ // Punctuation tokens.
4489
+ case 40: ++this.pos; return this.finishToken(types.parenL)
4490
+ case 41: ++this.pos; return this.finishToken(types.parenR)
4491
+ case 59: ++this.pos; return this.finishToken(types.semi)
4492
+ case 44: ++this.pos; return this.finishToken(types.comma)
4493
+ case 91: ++this.pos; return this.finishToken(types.bracketL)
4494
+ case 93: ++this.pos; return this.finishToken(types.bracketR)
4495
+ case 123: ++this.pos; return this.finishToken(types.braceL)
4496
+ case 125: ++this.pos; return this.finishToken(types.braceR)
4497
+ case 58: ++this.pos; return this.finishToken(types.colon)
4498
+ case 63: ++this.pos; return this.finishToken(types.question)
4499
+
4500
+ case 96: // '`'
4501
+ if (this.options.ecmaVersion < 6) { break }
4502
+ ++this.pos;
4503
+ return this.finishToken(types.backQuote)
4504
+
4505
+ case 48: // '0'
4506
+ var next = this.input.charCodeAt(this.pos + 1);
4507
+ if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number
4508
+ if (this.options.ecmaVersion >= 6) {
4509
+ if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number
4510
+ if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number
4511
+ }
4512
+
4513
+ // Anything else beginning with a digit is an integer, octal
4514
+ // number, or float.
4515
+ case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9
4516
+ return this.readNumber(false)
4517
+
4518
+ // Quotes produce strings.
4519
+ case 34: case 39: // '"', "'"
4520
+ return this.readString(code)
4521
+
4522
+ // Operators are parsed inline in tiny state machines. '=' (61) is
4523
+ // often referred to. `finishOp` simply skips the amount of
4524
+ // characters it is given as second argument, and returns a token
4525
+ // of the type given by its first argument.
4526
+
4527
+ case 47: // '/'
4528
+ return this.readToken_slash()
4529
+
4530
+ case 37: case 42: // '%*'
4531
+ return this.readToken_mult_modulo_exp(code)
4532
+
4533
+ case 124: case 38: // '|&'
4534
+ return this.readToken_pipe_amp(code)
4535
+
4536
+ case 94: // '^'
4537
+ return this.readToken_caret()
4538
+
4539
+ case 43: case 45: // '+-'
4540
+ return this.readToken_plus_min(code)
4541
+
4542
+ case 60: case 62: // '<>'
4543
+ return this.readToken_lt_gt(code)
4544
+
4545
+ case 61: case 33: // '=!'
4546
+ return this.readToken_eq_excl(code)
4547
+
4548
+ case 126: // '~'
4549
+ return this.finishOp(types.prefix, 1)
4550
+ }
4551
+
4552
+ this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'");
4553
+ };
4554
+
4555
+ pp$9.finishOp = function(type, size) {
4556
+ var str = this.input.slice(this.pos, this.pos + size);
4557
+ this.pos += size;
4558
+ return this.finishToken(type, str)
4559
+ };
4560
+
4561
+ pp$9.readRegexp = function() {
4562
+ var escaped, inClass, start = this.pos;
4563
+ for (;;) {
4564
+ if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); }
4565
+ var ch = this.input.charAt(this.pos);
4566
+ if (lineBreak.test(ch)) { this.raise(start, "Unterminated regular expression"); }
4567
+ if (!escaped) {
4568
+ if (ch === "[") { inClass = true; }
4569
+ else if (ch === "]" && inClass) { inClass = false; }
4570
+ else if (ch === "/" && !inClass) { break }
4571
+ escaped = ch === "\\";
4572
+ } else { escaped = false; }
4573
+ ++this.pos;
4574
+ }
4575
+ var pattern = this.input.slice(start, this.pos);
4576
+ ++this.pos;
4577
+ var flagsStart = this.pos;
4578
+ var flags = this.readWord1();
4579
+ if (this.containsEsc) { this.unexpected(flagsStart); }
4580
+
4581
+ // Validate pattern
4582
+ var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));
4583
+ state.reset(start, pattern, flags);
4584
+ this.validateRegExpFlags(state);
4585
+ this.validateRegExpPattern(state);
4586
+
4587
+ // Create Literal#value property value.
4588
+ var value = null;
4589
+ try {
4590
+ value = new RegExp(pattern, flags);
4591
+ } catch (e) {
4592
+ // ESTree requires null if it failed to instantiate RegExp object.
4593
+ // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral
4594
+ }
4595
+
4596
+ return this.finishToken(types.regexp, {pattern: pattern, flags: flags, value: value})
4597
+ };
4598
+
4599
+ // Read an integer in the given radix. Return null if zero digits
4600
+ // were read, the integer value otherwise. When `len` is given, this
4601
+ // will return `null` unless the integer has exactly `len` digits.
4602
+
4603
+ pp$9.readInt = function(radix, len) {
4604
+ var start = this.pos, total = 0;
4605
+ for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) {
4606
+ var code = this.input.charCodeAt(this.pos), val = (void 0);
4607
+ if (code >= 97) { val = code - 97 + 10; } // a
4608
+ else if (code >= 65) { val = code - 65 + 10; } // A
4609
+ else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9
4610
+ else { val = Infinity; }
4611
+ if (val >= radix) { break }
4612
+ ++this.pos;
4613
+ total = total * radix + val;
4614
+ }
4615
+ if (this.pos === start || len != null && this.pos - start !== len) { return null }
4616
+
4617
+ return total
4618
+ };
4619
+
4620
+ pp$9.readRadixNumber = function(radix) {
4621
+ var start = this.pos;
4622
+ this.pos += 2; // 0x
4623
+ var val = this.readInt(radix);
4624
+ if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); }
4625
+ if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {
4626
+ val = typeof BigInt !== "undefined" ? BigInt(this.input.slice(start, this.pos)) : null;
4627
+ ++this.pos;
4628
+ } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
4629
+ return this.finishToken(types.num, val)
4630
+ };
4631
+
4632
+ // Read an integer, octal integer, or floating-point number.
4633
+
4634
+ pp$9.readNumber = function(startsWithDot) {
4635
+ var start = this.pos;
4636
+ if (!startsWithDot && this.readInt(10) === null) { this.raise(start, "Invalid number"); }
4637
+ var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
4638
+ if (octal && this.strict) { this.raise(start, "Invalid number"); }
4639
+ if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
4640
+ var next = this.input.charCodeAt(this.pos);
4641
+ if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
4642
+ var str$1 = this.input.slice(start, this.pos);
4643
+ var val$1 = typeof BigInt !== "undefined" ? BigInt(str$1) : null;
4644
+ ++this.pos;
4645
+ if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
4646
+ return this.finishToken(types.num, val$1)
4647
+ }
4648
+ if (next === 46 && !octal) { // '.'
4649
+ ++this.pos;
4650
+ this.readInt(10);
4651
+ next = this.input.charCodeAt(this.pos);
4652
+ }
4653
+ if ((next === 69 || next === 101) && !octal) { // 'eE'
4654
+ next = this.input.charCodeAt(++this.pos);
4655
+ if (next === 43 || next === 45) { ++this.pos; } // '+-'
4656
+ if (this.readInt(10) === null) { this.raise(start, "Invalid number"); }
4657
+ }
4658
+ if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
4659
+
4660
+ var str = this.input.slice(start, this.pos);
4661
+ var val = octal ? parseInt(str, 8) : parseFloat(str);
4662
+ return this.finishToken(types.num, val)
4663
+ };
4664
+
4665
+ // Read a string value, interpreting backslash-escapes.
4666
+
4667
+ pp$9.readCodePoint = function() {
4668
+ var ch = this.input.charCodeAt(this.pos), code;
4669
+
4670
+ if (ch === 123) { // '{'
4671
+ if (this.options.ecmaVersion < 6) { this.unexpected(); }
4672
+ var codePos = ++this.pos;
4673
+ code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos);
4674
+ ++this.pos;
4675
+ if (code > 0x10FFFF) { this.invalidStringToken(codePos, "Code point out of bounds"); }
4676
+ } else {
4677
+ code = this.readHexChar(4);
4678
+ }
4679
+ return code
4680
+ };
4681
+
4682
+ function codePointToString$1(code) {
4683
+ // UTF-16 Decoding
4684
+ if (code <= 0xFFFF) { return String.fromCharCode(code) }
4685
+ code -= 0x10000;
4686
+ return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
4687
+ }
4688
+
4689
+ pp$9.readString = function(quote) {
4690
+ var out = "", chunkStart = ++this.pos;
4691
+ for (;;) {
4692
+ if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); }
4693
+ var ch = this.input.charCodeAt(this.pos);
4694
+ if (ch === quote) { break }
4695
+ if (ch === 92) { // '\'
4696
+ out += this.input.slice(chunkStart, this.pos);
4697
+ out += this.readEscapedChar(false);
4698
+ chunkStart = this.pos;
4699
+ } else {
4700
+ if (isNewLine(ch, this.options.ecmaVersion >= 10)) { this.raise(this.start, "Unterminated string constant"); }
4701
+ ++this.pos;
4702
+ }
4703
+ }
4704
+ out += this.input.slice(chunkStart, this.pos++);
4705
+ return this.finishToken(types.string, out)
4706
+ };
4707
+
4708
+ // Reads template string tokens.
4709
+
4710
+ var INVALID_TEMPLATE_ESCAPE_ERROR = {};
4711
+
4712
+ pp$9.tryReadTemplateToken = function() {
4713
+ this.inTemplateElement = true;
4714
+ try {
4715
+ this.readTmplToken();
4716
+ } catch (err) {
4717
+ if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
4718
+ this.readInvalidTemplateToken();
4719
+ } else {
4720
+ throw err
4721
+ }
4722
+ }
4723
+
4724
+ this.inTemplateElement = false;
4725
+ };
4726
+
4727
+ pp$9.invalidStringToken = function(position, message) {
4728
+ if (this.inTemplateElement && this.options.ecmaVersion >= 9) {
4729
+ throw INVALID_TEMPLATE_ESCAPE_ERROR
4730
+ } else {
4731
+ this.raise(position, message);
4732
+ }
4733
+ };
4734
+
4735
+ pp$9.readTmplToken = function() {
4736
+ var out = "", chunkStart = this.pos;
4737
+ for (;;) {
4738
+ if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); }
4739
+ var ch = this.input.charCodeAt(this.pos);
4740
+ if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${'
4741
+ if (this.pos === this.start && (this.type === types.template || this.type === types.invalidTemplate)) {
4742
+ if (ch === 36) {
4743
+ this.pos += 2;
4744
+ return this.finishToken(types.dollarBraceL)
4745
+ } else {
4746
+ ++this.pos;
4747
+ return this.finishToken(types.backQuote)
4748
+ }
4749
+ }
4750
+ out += this.input.slice(chunkStart, this.pos);
4751
+ return this.finishToken(types.template, out)
4752
+ }
4753
+ if (ch === 92) { // '\'
4754
+ out += this.input.slice(chunkStart, this.pos);
4755
+ out += this.readEscapedChar(true);
4756
+ chunkStart = this.pos;
4757
+ } else if (isNewLine(ch)) {
4758
+ out += this.input.slice(chunkStart, this.pos);
4759
+ ++this.pos;
4760
+ switch (ch) {
4761
+ case 13:
4762
+ if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; }
4763
+ case 10:
4764
+ out += "\n";
4765
+ break
4766
+ default:
4767
+ out += String.fromCharCode(ch);
4768
+ break
4769
+ }
4770
+ if (this.options.locations) {
4771
+ ++this.curLine;
4772
+ this.lineStart = this.pos;
4773
+ }
4774
+ chunkStart = this.pos;
4775
+ } else {
4776
+ ++this.pos;
4777
+ }
4778
+ }
4779
+ };
4780
+
4781
+ // Reads a template token to search for the end, without validating any escape sequences
4782
+ pp$9.readInvalidTemplateToken = function() {
4783
+ for (; this.pos < this.input.length; this.pos++) {
4784
+ switch (this.input[this.pos]) {
4785
+ case "\\":
4786
+ ++this.pos;
4787
+ break
4788
+
4789
+ case "$":
4790
+ if (this.input[this.pos + 1] !== "{") {
4791
+ break
4792
+ }
4793
+ // falls through
4794
+
4795
+ case "`":
4796
+ return this.finishToken(types.invalidTemplate, this.input.slice(this.start, this.pos))
4797
+
4798
+ // no default
4799
+ }
4800
+ }
4801
+ this.raise(this.start, "Unterminated template");
4802
+ };
4803
+
4804
+ // Used to read escaped characters
4805
+
4806
+ pp$9.readEscapedChar = function(inTemplate) {
4807
+ var ch = this.input.charCodeAt(++this.pos);
4808
+ ++this.pos;
4809
+ switch (ch) {
4810
+ case 110: return "\n" // 'n' -> '\n'
4811
+ case 114: return "\r" // 'r' -> '\r'
4812
+ case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'
4813
+ case 117: return codePointToString$1(this.readCodePoint()) // 'u'
4814
+ case 116: return "\t" // 't' -> '\t'
4815
+ case 98: return "\b" // 'b' -> '\b'
4816
+ case 118: return "\u000b" // 'v' -> '\u000b'
4817
+ case 102: return "\f" // 'f' -> '\f'
4818
+ case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\r\n'
4819
+ case 10: // ' \n'
4820
+ if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
4821
+ return ""
4822
+ default:
4823
+ if (ch >= 48 && ch <= 55) {
4824
+ var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
4825
+ var octal = parseInt(octalStr, 8);
4826
+ if (octal > 255) {
4827
+ octalStr = octalStr.slice(0, -1);
4828
+ octal = parseInt(octalStr, 8);
4829
+ }
4830
+ this.pos += octalStr.length - 1;
4831
+ ch = this.input.charCodeAt(this.pos);
4832
+ if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
4833
+ this.invalidStringToken(
4834
+ this.pos - 1 - octalStr.length,
4835
+ inTemplate
4836
+ ? "Octal literal in template string"
4837
+ : "Octal literal in strict mode"
4838
+ );
4839
+ }
4840
+ return String.fromCharCode(octal)
4841
+ }
4842
+ if (isNewLine(ch)) {
4843
+ // Unicode new line characters after \ get removed from output in both
4844
+ // template literals and strings
4845
+ return ""
4846
+ }
4847
+ return String.fromCharCode(ch)
4848
+ }
4849
+ };
4850
+
4851
+ // Used to read character escape sequences ('\x', '\u', '\U').
4852
+
4853
+ pp$9.readHexChar = function(len) {
4854
+ var codePos = this.pos;
4855
+ var n = this.readInt(16, len);
4856
+ if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); }
4857
+ return n
4858
+ };
4859
+
4860
+ // Read an identifier, and return it as a string. Sets `this.containsEsc`
4861
+ // to whether the word contained a '\u' escape.
4862
+ //
4863
+ // Incrementally adds only escaped chars, adding other chunks as-is
4864
+ // as a micro-optimization.
4865
+
4866
+ pp$9.readWord1 = function() {
4867
+ this.containsEsc = false;
4868
+ var word = "", first = true, chunkStart = this.pos;
4869
+ var astral = this.options.ecmaVersion >= 6;
4870
+ while (this.pos < this.input.length) {
4871
+ var ch = this.fullCharCodeAtPos();
4872
+ if (isIdentifierChar(ch, astral)) {
4873
+ this.pos += ch <= 0xffff ? 1 : 2;
4874
+ } else if (ch === 92) { // "\"
4875
+ this.containsEsc = true;
4876
+ word += this.input.slice(chunkStart, this.pos);
4877
+ var escStart = this.pos;
4878
+ if (this.input.charCodeAt(++this.pos) !== 117) // "u"
4879
+ { this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); }
4880
+ ++this.pos;
4881
+ var esc = this.readCodePoint();
4882
+ if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))
4883
+ { this.invalidStringToken(escStart, "Invalid Unicode escape"); }
4884
+ word += codePointToString$1(esc);
4885
+ chunkStart = this.pos;
4886
+ } else {
4887
+ break
4888
+ }
4889
+ first = false;
4890
+ }
4891
+ return word + this.input.slice(chunkStart, this.pos)
4892
+ };
4893
+
4894
+ // Read an identifier or keyword token. Will check for reserved
4895
+ // words when necessary.
4896
+
4897
+ pp$9.readWord = function() {
4898
+ var word = this.readWord1();
4899
+ var type = types.name;
4900
+ if (this.keywords.test(word)) {
4901
+ if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + word); }
4902
+ type = keywords$1[word];
4903
+ }
4904
+ return this.finishToken(type, word)
4905
+ };
4906
+
4907
+ // Acorn is a tiny, fast JavaScript parser written in JavaScript.
4908
+
4909
+ var version = "6.3.0";
4910
+
4911
+ // The main exported interface (under `self.acorn` when in the
4912
+ // browser) is a `parse` function that takes a code string and
4913
+ // returns an abstract syntax tree as specified by [Mozilla parser
4914
+ // API][api].
4915
+ //
4916
+ // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
4917
+
4918
+ function parse(input, options) {
4919
+ return Parser.parse(input, options)
4920
+ }
4921
+
4922
+ // This function tries to parse a single expression at a given
4923
+ // offset in a string. Useful for parsing mixed-language formats
4924
+ // that embed JavaScript expressions.
4925
+
4926
+ function parseExpressionAt(input, pos, options) {
4927
+ return Parser.parseExpressionAt(input, pos, options)
4928
+ }
4929
+
4930
+ // Acorn is organized as a tokenizer and a recursive-descent parser.
4931
+ // The `tokenizer` export provides an interface to the tokenizer.
4932
+
4933
+ function tokenizer(input, options) {
4934
+ return Parser.tokenizer(input, options)
4935
+ }
4936
+
4937
+ export { Node, Parser, Position, SourceLocation, TokContext, Token, TokenType, defaultOptions, getLineInfo, isIdentifierChar, isIdentifierStart, isNewLine, keywords$1 as keywordTypes, lineBreak, lineBreakG, nonASCIIwhitespace, parse, parseExpressionAt, types$1 as tokContexts, types as tokTypes, tokenizer, version };